xctest-runner 1.0.2 → 1.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11f53f11b1eb91b817ae41f67084548470960650
4
- data.tar.gz: 832ad3fd279e31452562382269e1d26c7d81cd32
3
+ metadata.gz: d10f874c2b67ee948c32d8d6efd58d11e2002a5b
4
+ data.tar.gz: fd82cfd507ab49523a8c873c96c7d84e0e81289b
5
5
  SHA512:
6
- metadata.gz: 43782e7084a62a97c0ce81322573c48db03a82e63c68ed3fa55a71cd45f3919f11988d85766ee92cd2c8bb94e1e168b2a7cb5dcf469461731ff20ad136550eee
7
- data.tar.gz: ae123b2183e941195723b6a7a983b43ad80d28ac989eee811c4534cc2ca9f33072e54cd1ca7740ce1d96ba6ca5c63bbd9b717639e60d1b881773d6be46861994
6
+ metadata.gz: 52bef96bef8d7eaeaf66c3e922dd68ff2ac31b9e2e27a9c832b9642f658f18868db8665620ef96a3da3c8424707d5a1bc49179bfc50c71448e61d4f886e92a75
7
+ data.tar.gz: 5009425e9b2e198eeda199301642b419bd8fafc5448a5a2b674f99b84b7a138f601632e40ab889dacb9c89d1b565545a9479410f5163f137c0df1b37af76760c
data/README.md CHANGED
@@ -32,6 +32,12 @@ $ xctest-runner -test SampleTests/testSample
32
32
  $ xctest-runner -scheme YourScheme
33
33
  ```
34
34
 
35
+ ### If you specify a project
36
+
37
+ ```shell
38
+ $ xctest-runner -project Sample.xcodeproj
39
+ ```
40
+
35
41
  ### If you specify a workspace
36
42
 
37
43
  ```shell
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
data/bin/xctest-runner CHANGED
@@ -11,6 +11,7 @@ require 'optparse'
11
11
  opts = {}
12
12
  opt = OptionParser.new
13
13
  opt.on('--scheme NAME', 'build the scheme NAME') {|v| opts[:scheme] = v }
14
+ opt.on('--project NAME', 'build the project NAME') {|v| opts[:project] = v }
14
15
  opt.on('--workspace NAME', 'build the workspace NAME') {|v| opts[:workspace] = v }
15
16
  opt.on('--sdk SDK', 'use SDK as the name or path of the base SDK when building the project') {|v| opts[:sdk] = v }
16
17
  opt.on('--arch ARCH', 'build each target for the architecture ARCH') {|v| opts[:arch] = v }
data/lib/xctest-runner.rb CHANGED
@@ -13,6 +13,7 @@ class XCTestRunner
13
13
  def initialize(opts = {})
14
14
  @clean = opts[:clean] || false
15
15
  @scheme = opts[:scheme] || nil
16
+ @project = opts[:project] || nil
16
17
  @workspace = opts[:workspace] || nil
17
18
  @sdk = opts[:sdk] || 'iphonesimulator'
18
19
  @configuration = opts[:configuration] || 'Debug'
@@ -20,7 +21,7 @@ class XCTestRunner
20
21
  @test_class = opts[:test] || 'Self'
21
22
  @suffix = opts[:suffix] || ''
22
23
 
23
- @scheme = default_scheme unless @scheme
24
+ @scheme = default_scheme(build_command) unless @scheme
24
25
  @env = current_environment(build_command)
25
26
  @arch = default_build_arch if @arch.nil?
26
27
  @build_option = nil
@@ -81,6 +82,7 @@ class XCTestRunner
81
82
  unless @build_option
82
83
  options = []
83
84
  options << "-scheme #{@scheme}" if @scheme
85
+ options << "-project #{@project}" if @project
84
86
  options << "-workspace #{@workspace}" if @workspace
85
87
  options << "-sdk #{@sdk}" if @sdk
86
88
  options << "-configuration #{@configuration}" if @configuration
@@ -20,16 +20,16 @@ class XCTestRunner
20
20
  env
21
21
  end
22
22
 
23
- def xcodebuild_list
24
- execute_command("xcodebuild -list")
23
+ def xcodebuild_list(build_command)
24
+ execute_command("#{build_command} -list")
25
25
  end
26
26
 
27
- def default_scheme
27
+ def default_scheme(build_command)
28
28
  unless @default_scheme
29
29
  scheme = nil
30
30
  is_scheme = false
31
31
 
32
- output = xcodebuild_list
32
+ output = xcodebuild_list(build_command)
33
33
  output.each_line do |line|
34
34
  line = line.strip
35
35
  if line =~ /\w+:/
@@ -90,6 +90,17 @@ describe XCTestRunner do
90
90
  end
91
91
  end
92
92
 
93
+ context '-project option' do
94
+ let(:arguments) {
95
+ {:project => 'Sample'}
96
+ }
97
+
98
+ it 'has some build arguments' do
99
+ expect(opts.count).to eq 4
100
+ expect(opts['-project']).to eq 'Sample'
101
+ end
102
+ end
103
+
93
104
  context '-sdk option' do
94
105
  let(:arguments) {
95
106
  {:sdk => 'iphoneos'}
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "xctest-runner"
8
- s.version = "1.0.2"
8
+ s.version = "1.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["tokorom"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xctest-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - tokorom