iCuke 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitmodules +1 -1
- data/Gemfile +12 -0
- data/Gemfile.lock +41 -0
- data/README.markdown +126 -0
- data/Rakefile +34 -12
- data/VERSION +1 -1
- data/bin/icuke +12 -10
- data/ext/Rakefile +6 -0
- data/ext/iCuke/{sdk3.1/DefaultsResponse.h → DefaultsResponse.h} +0 -0
- data/ext/iCuke/{sdk3.1/DefaultsResponse.m → DefaultsResponse.m} +0 -0
- data/ext/iCuke/{sdk3.1/EventResponse.h → EventResponse.h} +0 -0
- data/ext/iCuke/{sdk3.1/EventResponse.m → EventResponse.m} +0 -0
- data/ext/iCuke/{sdk3.1/ModuleResponse.h → ModuleResponse.h} +0 -0
- data/ext/iCuke/{sdk3.1/ModuleResponse.m → ModuleResponse.m} +0 -0
- data/ext/iCuke/{sdk3.1/QuitResponse.h → QuitResponse.h} +0 -0
- data/ext/iCuke/{sdk3.1/QuitResponse.m → QuitResponse.m} +0 -0
- data/ext/iCuke/Rakefile +14 -13
- data/ext/iCuke/{sdk3.1/Recorder.h → Recorder.h} +0 -0
- data/ext/iCuke/{sdk3.1/Recorder.m → Recorder.m} +0 -0
- data/ext/iCuke/{sdk3.1/RecorderResponse.h → RecorderResponse.h} +0 -0
- data/ext/iCuke/{sdk3.1/RecorderResponse.m → RecorderResponse.m} +0 -0
- data/ext/iCuke/{sdk3.1/SynthesizeSingleton.h → SynthesizeSingleton.h} +0 -0
- data/ext/iCuke/{sdk3.1/ViewResponse.h → ViewResponse.h} +0 -0
- data/ext/iCuke/{sdk3.1/ViewResponse.m → ViewResponse.m} +0 -0
- data/ext/iCuke/{sdk3.1/Viewer.h → Viewer.h} +0 -0
- data/ext/iCuke/{sdk4.0/Viewer.m → Viewer.m} +0 -0
- data/ext/iCuke/{sdk3.1/iCukeHTTPResponseHandler.h → iCukeHTTPResponseHandler.h} +0 -0
- data/ext/iCuke/{sdk3.1/iCukeHTTPResponseHandler.m → iCukeHTTPResponseHandler.m} +0 -0
- data/ext/iCuke/{sdk3.1/iCukeHTTPServer.h → iCukeHTTPServer.h} +0 -0
- data/ext/iCuke/{sdk4.0/iCukeHTTPServer.m → iCukeHTTPServer.m} +4 -2
- data/ext/iCuke/{sdk3.1/iCukeServer.h → iCukeServer.h} +0 -0
- data/ext/iCuke/{sdk3.1/iCukeServer.m → iCukeServer.m} +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/JSON.h +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/NSObject+SBJSON.h +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/NSObject+SBJSON.m +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/NSString+SBJSON.h +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/NSString+SBJSON.m +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/SBJSON.h +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/SBJSON.m +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/SBJsonBase.h +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/SBJsonBase.m +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/SBJsonParser.h +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/SBJsonParser.m +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/SBJsonWriter.h +0 -0
- data/ext/iCuke/{sdk3.1/json → json}/SBJsonWriter.m +0 -0
- data/features/starting_project.feature +18 -0
- data/features/step_definitions/shell.rb +41 -0
- data/features/support/env.rb +2 -0
- data/features/support/environment.rb +40 -0
- data/features/supported_sdks.feature +12 -0
- data/iCuke.gemspec +149 -161
- data/lib/icuke/configuration.rb +19 -0
- data/lib/icuke/core_ext.rb +27 -0
- data/lib/icuke/cucumber.rb +29 -265
- data/lib/icuke/cucumber_compat.rb +4 -0
- data/lib/icuke/icuke_world.rb +149 -0
- data/lib/icuke/sdk.rb +5 -13
- data/lib/icuke/simulator_driver.rb +201 -0
- data/lib/icuke/waxsim.rb +47 -9
- data/spec/cucumber_spec.rb +130 -0
- data/spec/fixtures/controls_page.xml +252 -0
- data/spec/process_spec.rb +76 -0
- data/spec/screen_spec.rb +173 -0
- data/spec/simulate_spec.rb +75 -0
- data/spec/simulator_spec.rb +28 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +67 -0
- metadata +222 -121
- data/.gitignore +0 -15
- data/README.rdoc +0 -68
- data/ext/WaxSim/Simulator.h +0 -31
- data/ext/WaxSim/Simulator.m +0 -131
- data/ext/WaxSim/WaxSim.m +0 -110
- data/ext/WaxSim/WaxSim.xcodeproj/project.pbxproj +0 -238
- data/ext/WaxSim/WaxSim_Prefix.pch +0 -7
- data/ext/WaxSim/build/Release/waxsim +0 -0
- data/ext/WaxSim/build/Release/waxsim.dSYM/Contents/Info.plist +0 -20
- data/ext/WaxSim/build/Release/waxsim.dSYM/Contents/Resources/DWARF/waxsim +0 -0
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/Objects-normal/x86_64/Simulator.o +0 -0
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/Objects-normal/x86_64/WaxSim.o +0 -0
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/Objects-normal/x86_64/waxsim.LinkFileList +0 -2
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/WaxSim.dep +0 -6
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/WaxSim~.dep +0 -6
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/build-state.dat +0 -227
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/build-state~.dat +0 -227
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/waxsim-all-target-headers.hmap +0 -0
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/waxsim-generated-files.hmap +0 -0
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/waxsim-own-target-headers.hmap +0 -0
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/waxsim-project-headers.hmap +0 -0
- data/ext/WaxSim/build/WaxSim.build/Release/WaxSim.build/waxsim.hmap +0 -0
- data/ext/WaxSim/iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h +0 -126
- data/ext/iCuke/sdk3.1/Rakefile +0 -20
- data/ext/iCuke/sdk3.1/Viewer.m +0 -203
- data/ext/iCuke/sdk3.1/iCukeHTTPServer.m +0 -365
- data/ext/iCuke/sdk4.0/DefaultsResponse.h +0 -5
- data/ext/iCuke/sdk4.0/DefaultsResponse.m +0 -66
- data/ext/iCuke/sdk4.0/EventResponse.h +0 -5
- data/ext/iCuke/sdk4.0/EventResponse.m +0 -130
- data/ext/iCuke/sdk4.0/ModuleResponse.h +0 -5
- data/ext/iCuke/sdk4.0/ModuleResponse.m +0 -76
- data/ext/iCuke/sdk4.0/QuitResponse.h +0 -5
- data/ext/iCuke/sdk4.0/QuitResponse.m +0 -23
- data/ext/iCuke/sdk4.0/Rakefile +0 -20
- data/ext/iCuke/sdk4.0/Recorder.h +0 -17
- data/ext/iCuke/sdk4.0/Recorder.m +0 -90
- data/ext/iCuke/sdk4.0/RecorderResponse.h +0 -6
- data/ext/iCuke/sdk4.0/RecorderResponse.m +0 -68
- data/ext/iCuke/sdk4.0/SynthesizeSingleton.h +0 -68
- data/ext/iCuke/sdk4.0/ViewResponse.h +0 -5
- data/ext/iCuke/sdk4.0/ViewResponse.m +0 -84
- data/ext/iCuke/sdk4.0/Viewer.h +0 -8
- data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.h +0 -50
- data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.m +0 -381
- data/ext/iCuke/sdk4.0/iCukeHTTPServer.h +0 -53
- data/ext/iCuke/sdk4.0/iCukeServer.h +0 -14
- data/ext/iCuke/sdk4.0/iCukeServer.m +0 -65
- data/ext/iCuke/sdk4.0/json/JSON.h +0 -50
- data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.h +0 -68
- data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.m +0 -53
- data/ext/iCuke/sdk4.0/json/NSString+SBJSON.h +0 -58
- data/ext/iCuke/sdk4.0/json/NSString+SBJSON.m +0 -55
- data/ext/iCuke/sdk4.0/json/SBJSON.h +0 -75
- data/ext/iCuke/sdk4.0/json/SBJSON.m +0 -212
- data/ext/iCuke/sdk4.0/json/SBJsonBase.h +0 -86
- data/ext/iCuke/sdk4.0/json/SBJsonBase.m +0 -78
- data/ext/iCuke/sdk4.0/json/SBJsonParser.h +0 -87
- data/ext/iCuke/sdk4.0/json/SBJsonParser.m +0 -475
- data/ext/iCuke/sdk4.0/json/SBJsonWriter.h +0 -129
- data/ext/iCuke/sdk4.0/json/SBJsonWriter.m +0 -228
data/.gitignore
DELETED
data/README.rdoc
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
= iCuke
|
|
2
|
-
|
|
3
|
-
iCuke allows you to test an iPhone application with cucumber. It provides a selection of step definitions similar to
|
|
4
|
-
those provided for testing web applications.
|
|
5
|
-
|
|
6
|
-
== Usage
|
|
7
|
-
|
|
8
|
-
Install the gem and load the iCuke step definitions in a cucumber support file:
|
|
9
|
-
|
|
10
|
-
require 'icuke/cucumber'
|
|
11
|
-
|
|
12
|
-
Write some scenarios like:
|
|
13
|
-
|
|
14
|
-
Background:
|
|
15
|
-
Given "iCuke" from "app/iCuke/iCuke.xcodeproj" is loaded in the simulator
|
|
16
|
-
|
|
17
|
-
Scenario: User views the About screen
|
|
18
|
-
When I tap "About"
|
|
19
|
-
Then I should see "Author:"
|
|
20
|
-
|
|
21
|
-
== How it works
|
|
22
|
-
|
|
23
|
-
iCuke launches your application into the iPhone Simulator. A preload library is used to add a HTTP server into your
|
|
24
|
-
application.
|
|
25
|
-
|
|
26
|
-
The HTTP server allows us to see an XML version of the iPhone's screen, and to emulate taps/swipes etc.
|
|
27
|
-
|
|
28
|
-
iCuke should not require any code changes to your application to work, however, it relies on accessibility information
|
|
29
|
-
to function sensibly. If your accessibility information is not accurate, iCuke may not work as expected.
|
|
30
|
-
|
|
31
|
-
== Bugs
|
|
32
|
-
|
|
33
|
-
iCuke does not support testing applications on real devices, because I don't know of a way get a preload library to
|
|
34
|
-
load on the device.
|
|
35
|
-
|
|
36
|
-
iCuke does not support pinches yet. They'll be here soon!
|
|
37
|
-
|
|
38
|
-
iCuke compiles against the latest 3.1 and 4.0 SDKs it can find. Compiling against 3.2 is not currently supported as Apple have released two versions with different ABIs.
|
|
39
|
-
|
|
40
|
-
== Contributors
|
|
41
|
-
|
|
42
|
-
* Nigel Taylor
|
|
43
|
-
* Aslak Hellesøy
|
|
44
|
-
* Dominic Baggott
|
|
45
|
-
* Jeff Morgan
|
|
46
|
-
* Luke Redpath
|
|
47
|
-
|
|
48
|
-
== Thanks
|
|
49
|
-
|
|
50
|
-
Thanks go to the people who's work iCuke is based on:
|
|
51
|
-
|
|
52
|
-
* Matt Gallagher
|
|
53
|
-
* Ian Dees
|
|
54
|
-
* Felipe Barreto
|
|
55
|
-
|
|
56
|
-
== Note on Patches/Pull Requests
|
|
57
|
-
|
|
58
|
-
* Fork the project.
|
|
59
|
-
* Make your feature addition or bug fix.
|
|
60
|
-
* Add tests for it. This is important so I don't break it in a
|
|
61
|
-
future version unintentionally.
|
|
62
|
-
* Commit, do not mess with rakefile, version, or history.
|
|
63
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
|
64
|
-
* Send me a pull request. Bonus points for topic branches.
|
|
65
|
-
|
|
66
|
-
== Copyright
|
|
67
|
-
|
|
68
|
-
Copyright (c) 2010 Unboxed Consulting. See LICENSE for details.
|
data/ext/WaxSim/Simulator.h
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Simulator.h
|
|
3
|
-
// Sim
|
|
4
|
-
//
|
|
5
|
-
// Created by ProbablyInteractive on 7/28/09.
|
|
6
|
-
// Copyright 2009 Probably Interactive. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <Cocoa/Cocoa.h>
|
|
10
|
-
#import "iPhoneSimulatorRemoteClient.h"
|
|
11
|
-
|
|
12
|
-
@class DTiPhoneSimulatorSystemRoot;
|
|
13
|
-
|
|
14
|
-
@interface Simulator : NSObject <DTiPhoneSimulatorSessionDelegate> {
|
|
15
|
-
NSString *_appPath;
|
|
16
|
-
DTiPhoneSimulatorSystemRoot *_sdk;
|
|
17
|
-
NSNumber *_family;
|
|
18
|
-
DTiPhoneSimulatorSession* _session;
|
|
19
|
-
NSDictionary *_env;
|
|
20
|
-
NSArray *_args;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@property (nonatomic, readonly) DTiPhoneSimulatorSession* session;
|
|
24
|
-
|
|
25
|
-
+ (NSArray *)availableSDKs;
|
|
26
|
-
|
|
27
|
-
- (id)initWithAppPath:(NSString *)appPath sdk:(NSString *)sdk family:(NSString *)family env:(NSDictionary *)env args:(NSArray *)args;
|
|
28
|
-
- (int)launch;
|
|
29
|
-
- (void)end;
|
|
30
|
-
|
|
31
|
-
@end
|
data/ext/WaxSim/Simulator.m
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// Sim
|
|
4
|
-
//
|
|
5
|
-
// Created by ProbablyInteractive on 7/28/09.
|
|
6
|
-
// Copyright 2009 Probably Interactive. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import "Simulator.h"
|
|
10
|
-
|
|
11
|
-
#include <sys/param.h>
|
|
12
|
-
#include <objc/runtime.h>
|
|
13
|
-
|
|
14
|
-
#define WaxLog(format, args...) \
|
|
15
|
-
printf("%s\n", [[NSString stringWithFormat:(format), ## args] UTF8String])
|
|
16
|
-
|
|
17
|
-
@implementation Simulator
|
|
18
|
-
|
|
19
|
-
@synthesize session=_session;
|
|
20
|
-
|
|
21
|
-
- (id)initWithAppPath:(NSString *)appPath sdk:(NSString *)sdk family:(NSString *)family env:(NSDictionary *)env args:(NSArray *)args {
|
|
22
|
-
self = [super init];
|
|
23
|
-
|
|
24
|
-
NSFileManager *fileManager = [NSFileManager defaultManager];
|
|
25
|
-
if (![appPath isAbsolutePath]) {
|
|
26
|
-
appPath = [[fileManager currentDirectoryPath] stringByAppendingPathComponent:appPath];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
_appPath = [appPath retain];
|
|
30
|
-
|
|
31
|
-
if (![fileManager fileExistsAtPath:_appPath]) {
|
|
32
|
-
WaxLog(@"App path '%@' does not exist!", _appPath);
|
|
33
|
-
exit(EXIT_FAILURE);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (!sdk) _sdk = [[DTiPhoneSimulatorSystemRoot defaultRoot] retain];
|
|
37
|
-
else {
|
|
38
|
-
_sdk = [[DTiPhoneSimulatorSystemRoot rootWithSDKVersion:sdk] retain];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (!_sdk) {
|
|
42
|
-
WaxLog(@"Unknown sdk '%@'", sdk);
|
|
43
|
-
WaxLog(@"Available sdks are...");
|
|
44
|
-
for (id root in [DTiPhoneSimulatorSystemRoot knownRoots]) {
|
|
45
|
-
WaxLog(@" %@", [root sdkVersion]);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
exit(EXIT_FAILURE);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if ([family isEqualToString: @"ipad"]) {
|
|
52
|
-
_family = [NSNumber numberWithInt: 2];
|
|
53
|
-
} else {
|
|
54
|
-
_family = [NSNumber numberWithInt: 1];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
_env = [env retain];
|
|
58
|
-
_args = [args retain];
|
|
59
|
-
|
|
60
|
-
return self;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
+ (NSArray *)availableSDKs {
|
|
64
|
-
NSMutableArray *sdks = [NSMutableArray array];
|
|
65
|
-
for (id root in [DTiPhoneSimulatorSystemRoot knownRoots]) {
|
|
66
|
-
[sdks addObject:[root sdkVersion]];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return sdks;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
- (int)launch {
|
|
73
|
-
WaxLog(@"Launching '%@' on'%@'", _appPath, [_sdk sdkDisplayName]);
|
|
74
|
-
|
|
75
|
-
DTiPhoneSimulatorApplicationSpecifier *appSpec = [DTiPhoneSimulatorApplicationSpecifier specifierWithApplicationPath:_appPath];
|
|
76
|
-
if (!appSpec) {
|
|
77
|
-
WaxLog(@"Could not load application specifier for '%@'", _appPath);
|
|
78
|
-
return EXIT_FAILURE;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
DTiPhoneSimulatorSystemRoot *sdkRoot = [DTiPhoneSimulatorSystemRoot defaultRoot];
|
|
82
|
-
|
|
83
|
-
DTiPhoneSimulatorSessionConfig *config = [[DTiPhoneSimulatorSessionConfig alloc] init];
|
|
84
|
-
[config setApplicationToSimulateOnStart:appSpec];
|
|
85
|
-
[config setSimulatedSystemRoot:sdkRoot];
|
|
86
|
-
[config setSimulatedDeviceFamily:_family];
|
|
87
|
-
[config setSimulatedApplicationShouldWaitForDebugger:NO];
|
|
88
|
-
[config setSimulatedApplicationLaunchArgs:_args];
|
|
89
|
-
[config setSimulatedApplicationLaunchEnvironment:_env];
|
|
90
|
-
[config setLocalizedClientName:@"iCuke"];
|
|
91
|
-
|
|
92
|
-
// Make the simulator output to the current STDOUT & STDERR
|
|
93
|
-
char path[MAXPATHLEN];
|
|
94
|
-
fcntl(STDOUT_FILENO, F_GETPATH, &path);
|
|
95
|
-
[config setSimulatedApplicationStdOutPath:[NSString stringWithUTF8String:path]];
|
|
96
|
-
|
|
97
|
-
fcntl(STDERR_FILENO, F_GETPATH, &path);
|
|
98
|
-
[config setSimulatedApplicationStdErrPath:[NSString stringWithUTF8String:path]];
|
|
99
|
-
|
|
100
|
-
_session = [[DTiPhoneSimulatorSession alloc] init];
|
|
101
|
-
[_session setDelegate:self];
|
|
102
|
-
[_session setSimulatedApplicationPID:[NSNumber numberWithInt:35]];
|
|
103
|
-
|
|
104
|
-
NSError *error;
|
|
105
|
-
if (![_session requestStartWithConfig:config timeout:30 error:&error]) {
|
|
106
|
-
WaxLog(@"Could not start simulator session: %@", [error localizedDescription]);
|
|
107
|
-
return EXIT_FAILURE;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return EXIT_SUCCESS;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
- (void)end {
|
|
114
|
-
[_session requestEndWithTimeout:0];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// DTiPhoneSimulatorSession Delegate
|
|
118
|
-
// ---------------------------------
|
|
119
|
-
- (void)session:(DTiPhoneSimulatorSession *)session didStart:(BOOL)started withError:(NSError *)error {
|
|
120
|
-
if (!started) {
|
|
121
|
-
WaxLog(@"Session failed to start. %@", [error localizedDescription]);
|
|
122
|
-
exit(EXIT_FAILURE);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
- (void)session:(DTiPhoneSimulatorSession *)session didEndWithError:(NSError *)error {
|
|
127
|
-
WaxLog(@"Session ended with error. %@", [error localizedDescription]);
|
|
128
|
-
if ([error code] != 2) exit(EXIT_FAILURE); // if it is a timeout error, that's cool. We are probably rebooting
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
@end
|
data/ext/WaxSim/WaxSim.m
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
#import <AppKit/AppKit.h>
|
|
2
|
-
#import "iPhoneSimulatorRemoteClient.h"
|
|
3
|
-
#import "Simulator.h"
|
|
4
|
-
#import "termios.h"
|
|
5
|
-
|
|
6
|
-
static BOOL gReset = false;
|
|
7
|
-
|
|
8
|
-
void printUsage();
|
|
9
|
-
void simulate(NSString *sdk, NSString *family, NSString *appPath, NSDictionary *environment, NSArray *additionalArgs);
|
|
10
|
-
void resetSignal(int sig);
|
|
11
|
-
|
|
12
|
-
int main(int argc, char *argv[]) {
|
|
13
|
-
signal(SIGQUIT, resetSignal);
|
|
14
|
-
|
|
15
|
-
int c;
|
|
16
|
-
char *sdk = nil;
|
|
17
|
-
char *family = nil;
|
|
18
|
-
char *appPath = nil;
|
|
19
|
-
NSMutableArray *additionalArgs = [NSMutableArray array];
|
|
20
|
-
NSMutableDictionary *environment = [NSMutableDictionary dictionary];
|
|
21
|
-
NSString *environment_variable;
|
|
22
|
-
NSArray *environment_variable_parts;
|
|
23
|
-
|
|
24
|
-
while ((c = getopt(argc, argv, "e:s:f:ah")) != -1) {
|
|
25
|
-
switch(c) {
|
|
26
|
-
case 'e':
|
|
27
|
-
environment_variable = [NSString stringWithCString:optarg encoding:NSUTF8StringEncoding];
|
|
28
|
-
environment_variable_parts = [environment_variable componentsSeparatedByString:@"="];
|
|
29
|
-
|
|
30
|
-
[environment setObject:[environment_variable_parts objectAtIndex:1] forKey:[environment_variable_parts objectAtIndex:0]];
|
|
31
|
-
break;
|
|
32
|
-
case 's':
|
|
33
|
-
sdk = optarg;
|
|
34
|
-
break;
|
|
35
|
-
case 'f':
|
|
36
|
-
family = optarg;
|
|
37
|
-
break;
|
|
38
|
-
case 'a':
|
|
39
|
-
fprintf(stdout, "Available SDK Versions.\n", optopt);
|
|
40
|
-
for (NSString *sdkVersion in [Simulator availableSDKs]) {
|
|
41
|
-
fprintf(stderr, " %s\n", [sdkVersion UTF8String]);
|
|
42
|
-
}
|
|
43
|
-
return 1;
|
|
44
|
-
case 'h':
|
|
45
|
-
printUsage();
|
|
46
|
-
return 1;
|
|
47
|
-
case '?':
|
|
48
|
-
if (optopt == 's' || optopt == 'f') {
|
|
49
|
-
fprintf(stderr, "Option -%c requires an argument.\n", optopt);
|
|
50
|
-
printUsage();
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
fprintf(stderr, "Unknown option `-%c'.\n", optopt);
|
|
54
|
-
printUsage();
|
|
55
|
-
}
|
|
56
|
-
return 1;
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
abort ();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (argc > optind) {
|
|
65
|
-
appPath = argv[optind++];
|
|
66
|
-
|
|
67
|
-
// Additional args are sent to app
|
|
68
|
-
for (int i = optind; i < argc; i++) {
|
|
69
|
-
[additionalArgs addObject:[NSString stringWithUTF8String:argv[i]]];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
fprintf(stderr, "No app-path was specified!\n");
|
|
74
|
-
printUsage();
|
|
75
|
-
return 1;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
NSString *sdkString = sdk ? [NSString stringWithUTF8String:sdk] : nil;
|
|
80
|
-
NSString *familyString = family ? [NSString stringWithUTF8String:family] : nil;
|
|
81
|
-
NSString *appPathString = [NSString stringWithUTF8String:appPath];
|
|
82
|
-
|
|
83
|
-
simulate(sdkString, familyString, appPathString, environment, additionalArgs);
|
|
84
|
-
|
|
85
|
-
return 0;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
void simulate(NSString *sdk, NSString *family, NSString *appPath, NSDictionary *environment, NSArray *additionalArgs) {
|
|
89
|
-
Simulator *simulator = [[Simulator alloc] initWithAppPath:appPath sdk:sdk family:family env:environment args:additionalArgs];
|
|
90
|
-
[simulator launch];
|
|
91
|
-
|
|
92
|
-
while (!gReset && [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:-1]]) ;
|
|
93
|
-
|
|
94
|
-
[simulator end];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
void printUsage() {
|
|
98
|
-
fprintf(stderr, "usage: waxsim [options] app-path\n");
|
|
99
|
-
fprintf(stderr, "example: waxsim -s 2.2 /path/to/app.app\n");
|
|
100
|
-
fprintf(stderr, "Available options are:\n");
|
|
101
|
-
fprintf(stderr, "\t-s sdk\tVersion number of sdk to use (-s 3.1)\n");
|
|
102
|
-
fprintf(stderr, "\t-f family\tDevice to use (-f ipad)\n");
|
|
103
|
-
fprintf(stderr, "\t-e VAR=value\tEnvironment variable to set (-e CFFIXED_HOME=/tmp/iphonehome)\n");
|
|
104
|
-
fprintf(stderr, "\t-a \tAvailable SDK's\n");
|
|
105
|
-
fprintf(stderr, "\t-h \tPrints out this wonderful documentation!\n");
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
void resetSignal(int sig) {
|
|
109
|
-
gReset = true;
|
|
110
|
-
}
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
// !$*UTF8*$!
|
|
2
|
-
{
|
|
3
|
-
archiveVersion = 1;
|
|
4
|
-
classes = {
|
|
5
|
-
};
|
|
6
|
-
objectVersion = 45;
|
|
7
|
-
objects = {
|
|
8
|
-
|
|
9
|
-
/* Begin PBXBuildFile section */
|
|
10
|
-
048274F11126398C003DFACB /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 048274F01126398C003DFACB /* AppKit.framework */; };
|
|
11
|
-
048275B2112639B7003DFACB /* Simulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 048275B1112639B7003DFACB /* Simulator.m */; };
|
|
12
|
-
048275C011263A74003DFACB /* iPhoneSimulatorRemoteClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 048275BF11263A74003DFACB /* iPhoneSimulatorRemoteClient.framework */; };
|
|
13
|
-
8DD76F9A0486AA7600D96B5E /* WaxSim.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* WaxSim.m */; settings = {ATTRIBUTES = (); }; };
|
|
14
|
-
8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
|
|
15
|
-
/* End PBXBuildFile section */
|
|
16
|
-
|
|
17
|
-
/* Begin PBXCopyFilesBuildPhase section */
|
|
18
|
-
8DD76F9E0486AA7600D96B5E /* CopyFiles */ = {
|
|
19
|
-
isa = PBXCopyFilesBuildPhase;
|
|
20
|
-
buildActionMask = 8;
|
|
21
|
-
dstPath = /usr/share/man/man1/;
|
|
22
|
-
dstSubfolderSpec = 0;
|
|
23
|
-
files = (
|
|
24
|
-
);
|
|
25
|
-
runOnlyForDeploymentPostprocessing = 1;
|
|
26
|
-
};
|
|
27
|
-
/* End PBXCopyFilesBuildPhase section */
|
|
28
|
-
|
|
29
|
-
/* Begin PBXFileReference section */
|
|
30
|
-
048274F01126398C003DFACB /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
|
31
|
-
048275AF112639B7003DFACB /* iPhoneSimulatorRemoteClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iPhoneSimulatorRemoteClient.h; path = iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h; sourceTree = "<group>"; };
|
|
32
|
-
048275B0112639B7003DFACB /* Simulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Simulator.h; sourceTree = "<group>"; };
|
|
33
|
-
048275B1112639B7003DFACB /* Simulator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Simulator.m; sourceTree = "<group>"; };
|
|
34
|
-
048275BF11263A74003DFACB /* iPhoneSimulatorRemoteClient.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iPhoneSimulatorRemoteClient.framework; path = Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework; sourceTree = DEVELOPER_DIR; };
|
|
35
|
-
08FB7796FE84155DC02AAC07 /* WaxSim.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WaxSim.m; sourceTree = "<group>"; };
|
|
36
|
-
08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
|
37
|
-
32A70AAB03705E1F00C91783 /* WaxSim_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaxSim_Prefix.pch; sourceTree = "<group>"; };
|
|
38
|
-
8DD76FA10486AA7600D96B5E /* waxsim */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = waxsim; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
39
|
-
/* End PBXFileReference section */
|
|
40
|
-
|
|
41
|
-
/* Begin PBXFrameworksBuildPhase section */
|
|
42
|
-
8DD76F9B0486AA7600D96B5E /* Frameworks */ = {
|
|
43
|
-
isa = PBXFrameworksBuildPhase;
|
|
44
|
-
buildActionMask = 2147483647;
|
|
45
|
-
files = (
|
|
46
|
-
8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */,
|
|
47
|
-
048274F11126398C003DFACB /* AppKit.framework in Frameworks */,
|
|
48
|
-
048275C011263A74003DFACB /* iPhoneSimulatorRemoteClient.framework in Frameworks */,
|
|
49
|
-
);
|
|
50
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
51
|
-
};
|
|
52
|
-
/* End PBXFrameworksBuildPhase section */
|
|
53
|
-
|
|
54
|
-
/* Begin PBXGroup section */
|
|
55
|
-
08FB7794FE84155DC02AAC07 /* WaxSim */ = {
|
|
56
|
-
isa = PBXGroup;
|
|
57
|
-
children = (
|
|
58
|
-
08FB7795FE84155DC02AAC07 /* Source */,
|
|
59
|
-
08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
|
|
60
|
-
1AB674ADFE9D54B511CA2CBB /* Products */,
|
|
61
|
-
);
|
|
62
|
-
name = WaxSim;
|
|
63
|
-
sourceTree = "<group>";
|
|
64
|
-
};
|
|
65
|
-
08FB7795FE84155DC02AAC07 /* Source */ = {
|
|
66
|
-
isa = PBXGroup;
|
|
67
|
-
children = (
|
|
68
|
-
32A70AAB03705E1F00C91783 /* WaxSim_Prefix.pch */,
|
|
69
|
-
08FB7796FE84155DC02AAC07 /* WaxSim.m */,
|
|
70
|
-
048275B0112639B7003DFACB /* Simulator.h */,
|
|
71
|
-
048275B1112639B7003DFACB /* Simulator.m */,
|
|
72
|
-
048275AF112639B7003DFACB /* iPhoneSimulatorRemoteClient.h */,
|
|
73
|
-
);
|
|
74
|
-
name = Source;
|
|
75
|
-
sourceTree = "<group>";
|
|
76
|
-
};
|
|
77
|
-
08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
|
|
78
|
-
isa = PBXGroup;
|
|
79
|
-
children = (
|
|
80
|
-
048275BF11263A74003DFACB /* iPhoneSimulatorRemoteClient.framework */,
|
|
81
|
-
048274F01126398C003DFACB /* AppKit.framework */,
|
|
82
|
-
08FB779EFE84155DC02AAC07 /* Foundation.framework */,
|
|
83
|
-
);
|
|
84
|
-
name = "External Frameworks and Libraries";
|
|
85
|
-
sourceTree = "<group>";
|
|
86
|
-
};
|
|
87
|
-
1AB674ADFE9D54B511CA2CBB /* Products */ = {
|
|
88
|
-
isa = PBXGroup;
|
|
89
|
-
children = (
|
|
90
|
-
8DD76FA10486AA7600D96B5E /* waxsim */,
|
|
91
|
-
);
|
|
92
|
-
name = Products;
|
|
93
|
-
sourceTree = "<group>";
|
|
94
|
-
};
|
|
95
|
-
/* End PBXGroup section */
|
|
96
|
-
|
|
97
|
-
/* Begin PBXNativeTarget section */
|
|
98
|
-
8DD76F960486AA7600D96B5E /* WaxSim */ = {
|
|
99
|
-
isa = PBXNativeTarget;
|
|
100
|
-
buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "WaxSim" */;
|
|
101
|
-
buildPhases = (
|
|
102
|
-
8DD76F990486AA7600D96B5E /* Sources */,
|
|
103
|
-
8DD76F9B0486AA7600D96B5E /* Frameworks */,
|
|
104
|
-
8DD76F9E0486AA7600D96B5E /* CopyFiles */,
|
|
105
|
-
);
|
|
106
|
-
buildRules = (
|
|
107
|
-
);
|
|
108
|
-
dependencies = (
|
|
109
|
-
);
|
|
110
|
-
name = WaxSim;
|
|
111
|
-
productInstallPath = "$(HOME)/bin";
|
|
112
|
-
productName = WaxSim;
|
|
113
|
-
productReference = 8DD76FA10486AA7600D96B5E /* waxsim */;
|
|
114
|
-
productType = "com.apple.product-type.tool";
|
|
115
|
-
};
|
|
116
|
-
/* End PBXNativeTarget section */
|
|
117
|
-
|
|
118
|
-
/* Begin PBXProject section */
|
|
119
|
-
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
|
120
|
-
isa = PBXProject;
|
|
121
|
-
buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "WaxSim" */;
|
|
122
|
-
compatibilityVersion = "Xcode 3.1";
|
|
123
|
-
hasScannedForEncodings = 1;
|
|
124
|
-
mainGroup = 08FB7794FE84155DC02AAC07 /* WaxSim */;
|
|
125
|
-
projectDirPath = "";
|
|
126
|
-
projectRoot = "";
|
|
127
|
-
targets = (
|
|
128
|
-
8DD76F960486AA7600D96B5E /* WaxSim */,
|
|
129
|
-
);
|
|
130
|
-
};
|
|
131
|
-
/* End PBXProject section */
|
|
132
|
-
|
|
133
|
-
/* Begin PBXSourcesBuildPhase section */
|
|
134
|
-
8DD76F990486AA7600D96B5E /* Sources */ = {
|
|
135
|
-
isa = PBXSourcesBuildPhase;
|
|
136
|
-
buildActionMask = 2147483647;
|
|
137
|
-
files = (
|
|
138
|
-
8DD76F9A0486AA7600D96B5E /* WaxSim.m in Sources */,
|
|
139
|
-
048275B2112639B7003DFACB /* Simulator.m in Sources */,
|
|
140
|
-
);
|
|
141
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
142
|
-
};
|
|
143
|
-
/* End PBXSourcesBuildPhase section */
|
|
144
|
-
|
|
145
|
-
/* Begin XCBuildConfiguration section */
|
|
146
|
-
1DEB927508733DD40010E9CD /* Debug */ = {
|
|
147
|
-
isa = XCBuildConfiguration;
|
|
148
|
-
buildSettings = {
|
|
149
|
-
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
150
|
-
COPY_PHASE_STRIP = NO;
|
|
151
|
-
FRAMEWORK_SEARCH_PATHS = (
|
|
152
|
-
"$(inherited)",
|
|
153
|
-
"\"$(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks\"",
|
|
154
|
-
);
|
|
155
|
-
GCC_DYNAMIC_NO_PIC = NO;
|
|
156
|
-
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
|
157
|
-
GCC_ENABLE_OBJC_GC = supported;
|
|
158
|
-
GCC_MODEL_TUNING = G5;
|
|
159
|
-
GCC_OPTIMIZATION_LEVEL = 0;
|
|
160
|
-
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
|
161
|
-
GCC_PREFIX_HEADER = WaxSim_Prefix.pch;
|
|
162
|
-
INSTALL_PATH = /usr/local/bin;
|
|
163
|
-
LD_RUNPATH_SEARCH_PATHS = /Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks;
|
|
164
|
-
PRODUCT_NAME = waxsim;
|
|
165
|
-
};
|
|
166
|
-
name = Debug;
|
|
167
|
-
};
|
|
168
|
-
1DEB927608733DD40010E9CD /* Release */ = {
|
|
169
|
-
isa = XCBuildConfiguration;
|
|
170
|
-
buildSettings = {
|
|
171
|
-
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
172
|
-
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
|
173
|
-
FRAMEWORK_SEARCH_PATHS = (
|
|
174
|
-
"$(inherited)",
|
|
175
|
-
"\"$(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks\"",
|
|
176
|
-
);
|
|
177
|
-
GCC_ENABLE_OBJC_GC = supported;
|
|
178
|
-
GCC_MODEL_TUNING = G5;
|
|
179
|
-
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
|
180
|
-
GCC_PREFIX_HEADER = WaxSim_Prefix.pch;
|
|
181
|
-
INSTALL_PATH = /usr/local/bin;
|
|
182
|
-
LD_RUNPATH_SEARCH_PATHS = /Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks;
|
|
183
|
-
PRODUCT_NAME = waxsim;
|
|
184
|
-
};
|
|
185
|
-
name = Release;
|
|
186
|
-
};
|
|
187
|
-
1DEB927908733DD40010E9CD /* Debug */ = {
|
|
188
|
-
isa = XCBuildConfiguration;
|
|
189
|
-
buildSettings = {
|
|
190
|
-
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
|
191
|
-
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
192
|
-
GCC_OPTIMIZATION_LEVEL = 0;
|
|
193
|
-
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
|
194
|
-
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
195
|
-
ONLY_ACTIVE_ARCH = YES;
|
|
196
|
-
PREBINDING = NO;
|
|
197
|
-
SDKROOT = macosx10.6;
|
|
198
|
-
};
|
|
199
|
-
name = Debug;
|
|
200
|
-
};
|
|
201
|
-
1DEB927A08733DD40010E9CD /* Release */ = {
|
|
202
|
-
isa = XCBuildConfiguration;
|
|
203
|
-
buildSettings = {
|
|
204
|
-
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
|
205
|
-
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
206
|
-
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
|
207
|
-
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
208
|
-
ONLY_ACTIVE_ARCH = YES;
|
|
209
|
-
PREBINDING = NO;
|
|
210
|
-
SDKROOT = macosx10.6;
|
|
211
|
-
};
|
|
212
|
-
name = Release;
|
|
213
|
-
};
|
|
214
|
-
/* End XCBuildConfiguration section */
|
|
215
|
-
|
|
216
|
-
/* Begin XCConfigurationList section */
|
|
217
|
-
1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "WaxSim" */ = {
|
|
218
|
-
isa = XCConfigurationList;
|
|
219
|
-
buildConfigurations = (
|
|
220
|
-
1DEB927508733DD40010E9CD /* Debug */,
|
|
221
|
-
1DEB927608733DD40010E9CD /* Release */,
|
|
222
|
-
);
|
|
223
|
-
defaultConfigurationIsVisible = 0;
|
|
224
|
-
defaultConfigurationName = Release;
|
|
225
|
-
};
|
|
226
|
-
1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "WaxSim" */ = {
|
|
227
|
-
isa = XCConfigurationList;
|
|
228
|
-
buildConfigurations = (
|
|
229
|
-
1DEB927908733DD40010E9CD /* Debug */,
|
|
230
|
-
1DEB927A08733DD40010E9CD /* Release */,
|
|
231
|
-
);
|
|
232
|
-
defaultConfigurationIsVisible = 0;
|
|
233
|
-
defaultConfigurationName = Release;
|
|
234
|
-
};
|
|
235
|
-
/* End XCConfigurationList section */
|
|
236
|
-
};
|
|
237
|
-
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
|
|
238
|
-
}
|