xctest_list 0.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/xctest_list.rb +36 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e430608a8b8ac110a40357cc0b68493a32bfeb2b
4
+ data.tar.gz: b9580c7b4b7e214d0995fe117939555cf7fc44ad
5
+ SHA512:
6
+ metadata.gz: b3cede873225df876d2453624f1ff948ed3cd3dbee8fd2943ef2130022cbff99b0edb2489fe4a60d4895e82ce63019932f707a9dddfbd46e02b17852eba4a3aa
7
+ data.tar.gz: 88447d663de2e64d9f7b38ffe3eca766d1c4b2753f6851667af7e1afa271114dc0a8021166c1f6d979a21b2f24ef7ea454ce92e99382aef3dcc276ae53567d4f
@@ -0,0 +1,36 @@
1
+ # NSString *swiftNmCmdline = @"nm -gU '%@' | cut -d' ' -f3 | xargs xcrun swift-demangle | cut -d' ' -f3 | grep -e '[\\.|_]'test";
2
+
3
+ require 'pathname'
4
+
5
+ class XCTestList
6
+ def self.validate_bundle(xctest_bundle_path)
7
+ raise "Cannot find xctest bundle at path '#{xctest_bundle_path}'" unless Dir.exist?(xctest_bundle_path)
8
+
9
+ is_xctest_bundle = File.extname(xctest_bundle_path) == '.xctest'
10
+ raise "Invalid xctest bundle given: '#{xctest_bundle_path}'" unless is_xctest_bundle
11
+ end
12
+
13
+ def self.binary_path(xctest_bundle_path)
14
+ validate_bundle(xctest_bundle_path)
15
+
16
+ xctest_binary_name = File.basename(xctest_bundle_path, '.*')
17
+ xctest_binary_path = File.join(xctest_bundle_path, xctest_binary_name)
18
+ unless File.exist?(xctest_binary_path)
19
+ raise "Missing xctest binary: '#{xctest_binary_path}'"
20
+ end
21
+ xctest_binary_path
22
+ end
23
+
24
+ def self.tests(xctest_bundle_path)
25
+ objc_symbols = 'nm -U '
26
+ objc_symbols << "'#{binary_path(xctest_bundle_path)}'"
27
+
28
+ tests = []
29
+ `#{objc_symbols}`.each_line do |line|
30
+ if / t -\[(?<testclass>\w+) (?<testmethod>test\w+)\]/ =~ line
31
+ tests << "#{testclass}/#{testmethod}"
32
+ end
33
+ end
34
+ tests
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xctest_list
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Lyndsey Ferguson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-09-22 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A gem to retrieve the tests in an iOS xctest bundle
14
+ email: lyndsey.ferguson@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/xctest_list.rb
20
+ homepage: https://github.com/lyndsey-ferguson/xctest_list
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.6.11
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: List the tests in the given xctest bundle
44
+ test_files: []
45
+ has_rdoc: