xcknife 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e5acda3f124de41802b17062e634930ace7e3c0
4
- data.tar.gz: d40b8c9aa81e4d4ffd1873b060ef50de4433f87f
3
+ metadata.gz: a16ad712fe21666c9ec13b16c1cc3007120bc9eb
4
+ data.tar.gz: fc3109c894275ca6c8e5fed344fd35a3a11d0457
5
5
  SHA512:
6
- metadata.gz: 9e5fdd50de1ab1790e7976ed7215208e010af1ea865b31faeec7f8c2d3f6b749adafda88c1cbb9df79e4f6cbb4251784e6088270feb9a4fc6a7e251265ce666d
7
- data.tar.gz: 57e39800658b08530bc29d0c6ddc67a1745733532f7e58474086fb24e86dc3dcd3dda9603fefa4ebcbd1c83c5fb8020556282c976562fdef52d12d70fb286018
6
+ metadata.gz: f364876c260015cc6b0729035c5835b295e1772b27671b50448064659841ab21e2384476b4e5860387e0f397db41d80f4fe48730b6e36879776295e18d89056d
7
+ data.tar.gz: 456da664e95295f2ae4a20982b245e7ade3a616047cf89dd654e0de0d5d053f2d1a11da6b9bc88b8f1099fd917111f7ed963a112b9c3c2cde6c50056a406a00d
@@ -114,17 +114,32 @@ static void PrintTestClass(FILE *outFile, NSString *testClass) {
114
114
  @"totalDuration" : @"0"});
115
115
  }
116
116
 
117
+ void enumerateTests();
118
+
117
119
  const int TEST_TARGET_LEVEL = 0;
118
120
  const int TEST_CLASS_LEVEL = 1;
119
121
  const int TEST_METHOD_LEVEL = 2;
120
122
 
123
+
121
124
  __attribute__((constructor))
122
125
  void initialize() {
126
+ NSString *testType = [NSString stringWithUTF8String: getenv("XCTEST_TYPE")];
127
+
128
+ if ([testType isEqualToString: @"APPTEST"]) {
129
+ [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidFinishLaunchingNotification object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) {
130
+ enumerateTests();
131
+ }];
132
+ } else {
133
+ enumerateTests();
134
+ }
135
+ }
136
+
137
+
138
+ void enumerateTests() {
123
139
  XCTestConfiguration *config = [[XCTestConfiguration alloc] init];
124
140
  NSString *testType = [NSString stringWithUTF8String: getenv("XCTEST_TYPE")];
125
141
  NSString *testTarget = [NSString stringWithUTF8String: getenv("XCTEST_TARGET")];
126
142
 
127
-
128
143
  if ([testType isEqualToString: @"APPTEST"]) {
129
144
  config.testBundleURL = [NSURL fileURLWithPath:NSProcessInfo.processInfo.environment[@"XCInjectBundle"]];
130
145
  config.targetApplicationPath = NSProcessInfo.processInfo.environment[@"XCInjectBundleInto"];
@@ -146,11 +161,11 @@ void initialize() {
146
161
 
147
162
  FILE *outFile;
148
163
  NSString *testDumperOutputPath = NSProcessInfo.processInfo.environment[@"TestDumperOutputPath"];
149
-
164
+
150
165
  if (testDumperOutputPath == nil) {
151
166
  outFile = stdout;
152
167
  } else {
153
- outFile = fopen(testDumperOutputPath.UTF8String, "w+");
168
+ outFile = fopen(testDumperOutputPath.UTF8String, "w+");
154
169
  }
155
170
 
156
171
  NSLog(@"Opened %@ with fd %p", testDumperOutputPath, outFile);
@@ -162,6 +177,7 @@ void initialize() {
162
177
  exit(0);
163
178
  }
164
179
 
180
+
165
181
  // This test enumerates the Xctest classes and targets, in the json-stream format. We only enumerate the first test method,
166
182
  // since xcknife does use test method level information (ref: https://github.com/square/xcknife)
167
183
  @implementation XCTestSuite (DumpAdditions)
@@ -6,5 +6,5 @@ require 'xcknife/test_dumper'
6
6
  require 'xcknife/exceptions'
7
7
 
8
8
  module XCKnife
9
- VERSION = '0.6.2'
9
+ VERSION = '0.6.3'
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcknife
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Ribeiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-25 00:00:00.000000000 Z
11
+ date: 2017-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler