uispecrunner 0.4.3 → 0.4.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.
@@ -0,0 +1,76 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ version = "1.3">
4
+ <BuildAction
5
+ parallelizeBuildables = "YES"
6
+ buildImplicitDependencies = "YES">
7
+ <BuildActionEntries>
8
+ <BuildActionEntry
9
+ buildForTesting = "YES"
10
+ buildForRunning = "YES"
11
+ buildForProfiling = "YES"
12
+ buildForArchiving = "YES"
13
+ buildForAnalyzing = "YES">
14
+ <BuildableReference
15
+ BuildableIdentifier = "primary"
16
+ BlueprintIdentifier = "8DD76F960486AA7600D96B5E"
17
+ BuildableName = "waxsim"
18
+ BlueprintName = "WaxSim"
19
+ ReferencedContainer = "container:WaxSim.xcodeproj">
20
+ </BuildableReference>
21
+ </BuildActionEntry>
22
+ </BuildActionEntries>
23
+ </BuildAction>
24
+ <TestAction
25
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
26
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
27
+ shouldUseLaunchSchemeArgsEnv = "YES"
28
+ buildConfiguration = "Debug">
29
+ <Testables>
30
+ </Testables>
31
+ </TestAction>
32
+ <LaunchAction
33
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
34
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
35
+ displayScaleIsEnabled = "NO"
36
+ displayScale = "1.00"
37
+ launchStyle = "0"
38
+ useCustomWorkingDirectory = "NO"
39
+ buildConfiguration = "Debug">
40
+ <BuildableProductRunnable>
41
+ <BuildableReference
42
+ BuildableIdentifier = "primary"
43
+ BlueprintIdentifier = "8DD76F960486AA7600D96B5E"
44
+ BuildableName = "waxsim"
45
+ BlueprintName = "WaxSim"
46
+ ReferencedContainer = "container:WaxSim.xcodeproj">
47
+ </BuildableReference>
48
+ </BuildableProductRunnable>
49
+ <AdditionalOptions>
50
+ </AdditionalOptions>
51
+ </LaunchAction>
52
+ <ProfileAction
53
+ displayScaleIsEnabled = "NO"
54
+ displayScale = "1.00"
55
+ shouldUseLaunchSchemeArgsEnv = "YES"
56
+ savedToolIdentifier = ""
57
+ useCustomWorkingDirectory = "NO"
58
+ buildConfiguration = "Release">
59
+ <BuildableProductRunnable>
60
+ <BuildableReference
61
+ BuildableIdentifier = "primary"
62
+ BlueprintIdentifier = "8DD76F960486AA7600D96B5E"
63
+ BuildableName = "waxsim"
64
+ BlueprintName = "WaxSim"
65
+ ReferencedContainer = "container:WaxSim.xcodeproj">
66
+ </BuildableReference>
67
+ </BuildableProductRunnable>
68
+ </ProfileAction>
69
+ <AnalyzeAction
70
+ buildConfiguration = "Debug">
71
+ </AnalyzeAction>
72
+ <ArchiveAction
73
+ buildConfiguration = "Release"
74
+ revealArchiveInOrganizer = "YES">
75
+ </ArchiveAction>
76
+ </Scheme>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>WaxSim.xcscheme</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ <key>SuppressBuildableAutocreation</key>
14
+ <dict>
15
+ <key>8DD76F960486AA7600D96B5E</key>
16
+ <dict>
17
+ <key>primary</key>
18
+ <true/>
19
+ </dict>
20
+ </dict>
21
+ </dict>
22
+ </plist>
@@ -18,11 +18,7 @@ class UISpecRunner
18
18
  command = "#{config.app_executable_path} -RegisterForSystemEvents"
19
19
  puts "Executing: #{command}" if config.verbose?
20
20
  output = `#{command}`
21
- exit_code = $?
22
- unless exit_code == 0
23
- puts "[!] Failed specs running UISpec target (exit code #{exit_code})"
24
- exit 1
25
- end
21
+ return $?
26
22
  end
27
23
  end
28
24
 
@@ -21,10 +21,17 @@ class UISpecRunner
21
21
 
22
22
  def run_specs(env)
23
23
  env_args = env.map { |k,v| "-e #{k}=#{v} "}.join(' ')
24
- # TODO: Add support for family...
24
+ exit_status = nil
25
25
  command = %Q{#{waxsim_path} -s #{config.sdk_version} #{family_switch} #{env_args} "#{config.app_path}"}
26
- puts "Executing: #{command}"
26
+ puts "Executing command: #{command}" if config.verbose?
27
27
  `#{command}`
28
+
29
+ # TODO: Total hack. Can't figure out how to get the exit status any other way.
30
+ # WaxSim can't get the child pid because the process isn't forked as a child. The output
31
+ # can't be parsed directly because of funkiness with the file descriptors. Better ideas?
32
+ exit_status = `tail /var/log/system.log| grep "Exiting with status code:"`.split(/code\:\s/).last.to_i
33
+
34
+ return exit_status
28
35
  end
29
36
  end
30
37
  end
data/lib/uispecrunner.rb CHANGED
@@ -110,8 +110,11 @@ class UISpecRunner
110
110
  puts "Running specs via #{driver}..."
111
111
  env['UISPEC_EXIT_ON_FINISH'] = self.exit_on_finish? ? 'YES' : 'NO'
112
112
  driver = driver_class.new(self)
113
- driver.run_specs(env.merge(self.env))
114
- # TODO: Exit with exit code from the process...
113
+ exit_code = driver.run_specs(env.merge(self.env))
114
+ unless exit_code == 0
115
+ puts "[!] Failed specs running UISpec target (exit code #{exit_code})"
116
+ exit(exit_code)
117
+ end
115
118
  else
116
119
  puts "Failed to build"
117
120
  # TODO: Exit with the exit code from xcodebuild...
@@ -36,8 +36,10 @@
36
36
  -(void)onFinish:(int)count {
37
37
  [super onFinish:count];
38
38
 
39
- if (self.exitOnFinish) {
40
- exit(errors.count);
39
+ if (self.exitOnFinish) {
40
+ int exitStatus = [errors count] > 0 ? EXIT_FAILURE : EXIT_SUCCESS;
41
+ NSLog(@"Exiting with status code: %d", exitStatus);
42
+ exit(exitStatus);
41
43
  }
42
44
  }
43
45
 
data/uispecrunner.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{uispecrunner}
8
- s.version = "0.4.3"
8
+ s.version = "0.4.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Blake Watters"]
12
- s.date = %q{2011-03-19}
12
+ s.date = %q{2011-04-19}
13
13
  s.default_executable = %q{uispec}
14
14
  s.description = %q{Provides a simple Ruby interface for running UISpec iPhone tests}
15
15
  s.email = %q{blake@twotoasters.com}
@@ -32,6 +32,10 @@ Gem::Specification.new do |s|
32
32
  "ext/WaxSim/Simulator.m",
33
33
  "ext/WaxSim/WaxSim.m",
34
34
  "ext/WaxSim/WaxSim.xcodeproj/project.pbxproj",
35
+ "ext/WaxSim/WaxSim.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
36
+ "ext/WaxSim/WaxSim.xcodeproj/project.xcworkspace/xcuserdata/blake.xcuserdatad/UserInterfaceState.xcuserstate",
37
+ "ext/WaxSim/WaxSim.xcodeproj/xcuserdata/blake.xcuserdatad/xcschemes/WaxSim.xcscheme",
38
+ "ext/WaxSim/WaxSim.xcodeproj/xcuserdata/blake.xcuserdatad/xcschemes/xcschememanagement.plist",
35
39
  "ext/WaxSim/WaxSim_Prefix.pch",
36
40
  "ext/WaxSim/iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h",
37
41
  "lib/uispecrunner.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uispecrunner
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 3
10
- version: 0.4.3
9
+ - 4
10
+ version: 0.4.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Blake Watters
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-19 00:00:00 -04:00
18
+ date: 2011-04-19 00:00:00 -04:00
19
19
  default_executable: uispec
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -72,6 +72,10 @@ files:
72
72
  - ext/WaxSim/Simulator.m
73
73
  - ext/WaxSim/WaxSim.m
74
74
  - ext/WaxSim/WaxSim.xcodeproj/project.pbxproj
75
+ - ext/WaxSim/WaxSim.xcodeproj/project.xcworkspace/contents.xcworkspacedata
76
+ - ext/WaxSim/WaxSim.xcodeproj/project.xcworkspace/xcuserdata/blake.xcuserdatad/UserInterfaceState.xcuserstate
77
+ - ext/WaxSim/WaxSim.xcodeproj/xcuserdata/blake.xcuserdatad/xcschemes/WaxSim.xcscheme
78
+ - ext/WaxSim/WaxSim.xcodeproj/xcuserdata/blake.xcuserdatad/xcschemes/xcschememanagement.plist
75
79
  - ext/WaxSim/WaxSim_Prefix.pch
76
80
  - ext/WaxSim/iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h
77
81
  - lib/uispecrunner.rb