Browse Source

add xcpretty

Daniel Zlotin 7 years ago
parent
commit
55f2984786
4 changed files with 24 additions and 3 deletions
  1. 2
    0
      .travis.yml
  2. 3
    0
      scripts/env/installXcpretty.sh
  3. 9
    1
      scripts/test.e2e.ios.js
  4. 10
    2
      scripts/test.unit.ios.js

+ 2
- 0
.travis.yml View File

28
   - source ./scripts/env/installAndroidSDK.sh
28
   - source ./scripts/env/installAndroidSDK.sh
29
         # AppleSimUtils
29
         # AppleSimUtils
30
   - source ./scripts/env/installAppleSimUtils.sh
30
   - source ./scripts/env/installAppleSimUtils.sh
31
+        # xcpretty
32
+  - source ./scripts/env/installXcpretty.sh
31
 
33
 
32
 script:
34
 script:
33
   - set -e
35
   - set -e

+ 3
- 0
scripts/env/installXcpretty.sh View File

1
+#!/bin/bash -e
2
+
3
+gem install xcpretty

+ 9
- 1
scripts/test.e2e.ios.js View File

7
   const scheme = release ? `playground_release` : `playground`;
7
   const scheme = release ? `playground_release` : `playground`;
8
   const conf = release ? `Release` : `Debug`;
8
   const conf = release ? `Release` : `Debug`;
9
 
9
 
10
-  exec.execSync(`cd ./playground/ios &&
10
+  execWithXcprettyIfPossible(`cd ./playground/ios &&
11
             RCT_NO_LAUNCH_PACKAGER=true
11
             RCT_NO_LAUNCH_PACKAGER=true
12
             xcodebuild build
12
             xcodebuild build
13
             -scheme ${scheme}
13
             -scheme ${scheme}
38
   e2e();
38
   e2e();
39
 }
39
 }
40
 
40
 
41
+function execWithXcprettyIfPossible(cmd) {
42
+  if (exec.which('xcpretty')) {
43
+    exec.execSync(`${cmd} | xcpretty`);
44
+  } else {
45
+    exec.execSync(cmd);
46
+  }
47
+}
48
+
41
 run();
49
 run();

+ 10
- 2
scripts/test.unit.ios.js View File

6
 function run() {
6
 function run() {
7
   const conf = release ? `Release` : `Debug`;
7
   const conf = release ? `Release` : `Debug`;
8
 
8
 
9
-  exec.execSync(`cd ./playground/ios &&
9
+  execWithXcprettyIfPossible(`cd ./playground/ios &&
10
             RCT_NO_LAUNCH_PACKAGER=true
10
             RCT_NO_LAUNCH_PACKAGER=true
11
             xcodebuild build build-for-testing
11
             xcodebuild build build-for-testing
12
             -scheme "ReactNativeNavigation"
12
             -scheme "ReactNativeNavigation"
16
             -derivedDataPath ./DerivedData/playground
16
             -derivedDataPath ./DerivedData/playground
17
             ONLY_ACTIVE_ARCH=YES`);
17
             ONLY_ACTIVE_ARCH=YES`);
18
 
18
 
19
-  exec.execSync(`cd ./playground/ios &&
19
+  execWithXcprettyIfPossible(`cd ./playground/ios &&
20
             RCT_NO_LAUNCH_PACKAGER=true
20
             RCT_NO_LAUNCH_PACKAGER=true
21
             xcodebuild test-without-building
21
             xcodebuild test-without-building
22
             -scheme "ReactNativeNavigation"
22
             -scheme "ReactNativeNavigation"
28
             ONLY_ACTIVE_ARCH=YES`);
28
             ONLY_ACTIVE_ARCH=YES`);
29
 }
29
 }
30
 
30
 
31
+function execWithXcprettyIfPossible(cmd) {
32
+  if (exec.which('xcpretty')) {
33
+    exec.execSync(`${cmd} | xcpretty`);
34
+  } else {
35
+    exec.execSync(cmd);
36
+  }
37
+}
38
+
31
 run();
39
 run();