xctest_list 1.1.6 → 1.1.7
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 +4 -4
- data/lib/xctest_list.rb +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec8f3b63f94d1d875896d92a3f4c5e2122eb8b12
|
4
|
+
data.tar.gz: 71a6ea6cd5760e944abd4026e1e1064c6da73704
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|