xctest_list 1.1.6 → 1.1.7

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 +11 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d26254a600644b00b6eea342fed333e47b41d2d6
4
- data.tar.gz: '09848cdab93750d56267ffc055fd7d11adbfc1a4'
3
+ metadata.gz: ec8f3b63f94d1d875896d92a3f4c5e2122eb8b12
4
+ data.tar.gz: 71a6ea6cd5760e944abd4026e1e1064c6da73704
5
5
  SHA512:
6
- metadata.gz: c23aaabdd76383c325d746ba55b8ecb3e07c4f66a33de00aad58c5d29ba9b7293209a831146f78e232a28c743f3b8dd2b98ff6f9344f92b6c9bce2011fcee1ee
7
- data.tar.gz: 467c99f5d646514830273895985ac49e46c68a3336930d18df858de5f95c54368aba6617927dbcf8ee4286245b18952b58af83f678f442a5567c280a07890a3b
6
+ metadata.gz: ea6e9e0ab3c56de6292aa2310d293b1f943fedaf8e4545a559dce13a6af3898d63b037c0988d418d9fb2d5b3d82c038675c456df091f27907ca800066e62b755
7
+ data.tar.gz: fe4f68de5326cb4f2e82b2f9c6de2508162bb7fe47bb34a76e36c1c7903326bb1fc1b95e3852d8ac00c427018cffa598e3a72fc6bb41fa4349170e87e610820e
data/lib/xctest_list.rb CHANGED
@@ -30,6 +30,7 @@ class XCTestList
30
30
  unless File.exist?(xctest_binary_path)
31
31
  raise "Missing xctest binary: '#{xctest_binary_path}'"
32
32
  end
33
+
33
34
  xctest_binary_path
34
35
  end
35
36
 
@@ -52,11 +53,19 @@ class XCTestList
52
53
  swift_symbols_cmd_output.gsub(/^.* .* (.*)$/, '\1')
53
54
  end
54
55
 
56
+ def self.swift_symbol_dump_command(xctest_binary_path)
57
+ nm_version_string = `nm -version | head -n 1 | sed -E 's/Apple LLVM version ([0-9]+\.[0-9]+\.[0-9]+).*/\\1/'`.chomp
58
+ if Gem::Version.new(nm_version_string) < Gem::Version.new('9.0.0')
59
+ "nm -gU '#{xctest_binary_path}' | cut -d' ' -f3 | xcrun swift-demangle | grep -E '^\\S+\\.test[^.]+\\(\\)$' | sed 's/ () -> ()/()/'"
60
+ else
61
+ "nm -gU '#{xctest_binary_path}' | cut -d' ' -f3 | xargs -s 131072 xcrun swift-demangle | cut -d' ' -f3 | grep -e '[\\.|_]'test"
62
+ end
63
+ end
64
+
55
65
  # find the Swift symbols in the bundle's binary
56
66
  def self.swift_tests(xctest_bundle_path)
57
67
  swift_symbols_command_output_tempfile = Tempfile.new(File.basename(xctest_bundle_path) + "swift")
58
- swift_symbol_dump_command = "nm -gU '#{binary_path(xctest_bundle_path)}' | cut -d' ' -f3 | xargs -s 131072 xcrun swift-demangle | cut -d' ' -f3 | grep -e '[\\.|_]'test"
59
- system("#{swift_symbol_dump_command} > '#{swift_symbols_command_output_tempfile.path}'")
68
+ system("#{swift_symbol_dump_command(binary_path(xctest_bundle_path))} > '#{swift_symbols_command_output_tempfile.path}'")
60
69
  tests = []
61
70
  File.foreach(swift_symbols_command_output_tempfile.path) do |line|
62
71
  if /.*-\[.*\]/ !~ line && /\w+\.(?<testclass>[^\.]+)\.(?<testmethod>test[^\(]+)\(/ =~ line
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.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lyndsey Ferguson