xctest_list 1.0.0 → 1.1.0
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 +10 -4
- 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: e05b2f3684347fb874457cba8b36d4e6c9cf6802
|
4
|
+
data.tar.gz: 979539b74160fd8b3cbbe4b163b505e03ff9ceda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 513cf3e9e66e30b1daea52caa7f0d3a9025024ef03c818574465fe67486fca72cf079607f57ecc90f2b0206c475b58177a6c57638d6ea3a387e75f931233b626
|
7
|
+
data.tar.gz: c41082180e27dee4d6f4c721745ea5a50b7d297e90f9c7b4ee069562d41da2f7424766413e61776600c00e27c521c07022dbfca5365f76f2fe08dd71c2a016a6
|
data/lib/xctest_list.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'open3'
|
2
|
+
require 'tempfile'
|
1
3
|
|
2
4
|
# A class to parse xctest bundles and return a list of tests that
|
3
5
|
# are in the bundle's binary.
|
@@ -33,11 +35,14 @@ class XCTestList
|
|
33
35
|
objc_symbols_cmd << "'#{binary_path(xctest_bundle_path)}'"
|
34
36
|
|
35
37
|
tests = []
|
36
|
-
|
38
|
+
Open3.popen2e(objc_symbols_cmd) do |stdin, io, thread|
|
39
|
+
io.sync = true
|
40
|
+
io.each do |line|
|
37
41
|
if / t -\[(?<testclass>\w+) (?<testmethod>test\w+)\]/ =~ line
|
38
42
|
tests << "#{testclass}/#{testmethod}"
|
39
43
|
end
|
40
44
|
end
|
45
|
+
end
|
41
46
|
tests
|
42
47
|
end
|
43
48
|
|
@@ -48,10 +53,11 @@ class XCTestList
|
|
48
53
|
|
49
54
|
# find the Swift symbols in the bundle's binary
|
50
55
|
def self.swift_tests(xctest_bundle_path)
|
51
|
-
|
56
|
+
swift_symbols_command_output_tempfile = Tempfile.new(File.basename(xctest_bundle_path))
|
57
|
+
system("nm -gU '#{binary_path(xctest_bundle_path)}' > '#{swift_symbols_command_output_tempfile.path}'")
|
52
58
|
tests = []
|
53
|
-
|
54
|
-
if /\w+\.(?<testclass>[^\.]+)\.(?<testmethod>test[^\(]+)/ =~ system("xcrun swift-demangle #{
|
59
|
+
File.open(swift_symbols_command_output_tempfile.path, 'r').each do |line|
|
60
|
+
if /\w+\.(?<testclass>[^\.]+)\.(?<testmethod>test[^\(]+)/ =~ system("xcrun swift-demangle #{line}")
|
55
61
|
tests << "#{testclass}/#{testmethod}"
|
56
62
|
end
|
57
63
|
end
|