xctest_list 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/xctest_list.rb +6 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e05b2f3684347fb874457cba8b36d4e6c9cf6802
4
- data.tar.gz: 979539b74160fd8b3cbbe4b163b505e03ff9ceda
3
+ metadata.gz: d30d77f0b8ae324ef87fedfc67f4eb2a4318614e
4
+ data.tar.gz: 4c754fe3ac7b4c3b2b62b3c5f0e148e7d3d43ec6
5
5
  SHA512:
6
- metadata.gz: 513cf3e9e66e30b1daea52caa7f0d3a9025024ef03c818574465fe67486fca72cf079607f57ecc90f2b0206c475b58177a6c57638d6ea3a387e75f931233b626
7
- data.tar.gz: c41082180e27dee4d6f4c721745ea5a50b7d297e90f9c7b4ee069562d41da2f7424766413e61776600c00e27c521c07022dbfca5365f76f2fe08dd71c2a016a6
6
+ metadata.gz: b65b18f150b9508f29082310e64bb0562027551861cfbe5a8231bce5590e1c19183776f6ae03d2862491f5f24bd91dc841c89481b877e37cad8ab0676b9e7926
7
+ data.tar.gz: 6167a34071da94533cc0e225a9f2bce1a38ca537d67d0adb0d2b2175f1233df052abc013913a2f6c21bb88abd47ad95d1e0eccc3a9ec216822dd211e8d0c514c
data/lib/xctest_list.rb CHANGED
@@ -31,18 +31,15 @@ class XCTestList
31
31
 
32
32
  # find the Objective-C symbols in the bundle's binary
33
33
  def self.objc_tests(xctest_bundle_path)
34
- objc_symbols_cmd = 'nm -U '
35
- objc_symbols_cmd << "'#{binary_path(xctest_bundle_path)}'"
36
-
37
34
  tests = []
38
- Open3.popen2e(objc_symbols_cmd) do |stdin, io, thread|
39
- io.sync = true
40
- io.each do |line|
35
+ objc_symbols_command_output_tempfile = Tempfile.new(File.basename(xctest_bundle_path) + "objc")
36
+ system("nm -U '#{binary_path(xctest_bundle_path)}' > '#{objc_symbols_command_output_tempfile.path}'")
37
+ tests = []
38
+ File.open(objc_symbols_command_output_tempfile.path, 'r').each do |line|
41
39
  if / t -\[(?<testclass>\w+) (?<testmethod>test\w+)\]/ =~ line
42
40
  tests << "#{testclass}/#{testmethod}"
43
41
  end
44
42
  end
45
- end
46
43
  tests
47
44
  end
48
45
 
@@ -53,11 +50,11 @@ class XCTestList
53
50
 
54
51
  # find the Swift symbols in the bundle's binary
55
52
  def self.swift_tests(xctest_bundle_path)
56
- swift_symbols_command_output_tempfile = Tempfile.new(File.basename(xctest_bundle_path))
53
+ swift_symbols_command_output_tempfile = Tempfile.new(File.basename(xctest_bundle_path) + "swift")
57
54
  system("nm -gU '#{binary_path(xctest_bundle_path)}' > '#{swift_symbols_command_output_tempfile.path}'")
58
55
  tests = []
59
56
  File.open(swift_symbols_command_output_tempfile.path, 'r').each do |line|
60
- if /\w+\.(?<testclass>[^\.]+)\.(?<testmethod>test[^\(]+)/ =~ system("xcrun swift-demangle #{line}")
57
+ if /.*-\[.*\]/ !~ line && /\w+\.(?<testclass>[^\.]+)\.(?<testmethod>test[^\(]+)/ =~ system("xcrun swift-demangle #{line}")
61
58
  tests << "#{testclass}/#{testmethod}"
62
59
  end
63
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xctest_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lyndsey Ferguson