소스 검색

add xcpretty

Daniel Zlotin 6 년 전
부모
커밋
55f2984786
4개의 변경된 파일24개의 추가작업 그리고 3개의 파일을 삭제
  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 파일 보기

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

+ 3
- 0
scripts/env/installXcpretty.sh 파일 보기

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

+ 9
- 1
scripts/test.e2e.ios.js 파일 보기

@@ -7,7 +7,7 @@ function buildProjForDetox() {
7 7
   const scheme = release ? `playground_release` : `playground`;
8 8
   const conf = release ? `Release` : `Debug`;
9 9
 
10
-  exec.execSync(`cd ./playground/ios &&
10
+  execWithXcprettyIfPossible(`cd ./playground/ios &&
11 11
             RCT_NO_LAUNCH_PACKAGER=true
12 12
             xcodebuild build
13 13
             -scheme ${scheme}
@@ -38,4 +38,12 @@ function run() {
38 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 49
 run();

+ 10
- 2
scripts/test.unit.ios.js 파일 보기

@@ -6,7 +6,7 @@ const release = _.includes(process.argv, 'release');
6 6
 function run() {
7 7
   const conf = release ? `Release` : `Debug`;
8 8
 
9
-  exec.execSync(`cd ./playground/ios &&
9
+  execWithXcprettyIfPossible(`cd ./playground/ios &&
10 10
             RCT_NO_LAUNCH_PACKAGER=true
11 11
             xcodebuild build build-for-testing
12 12
             -scheme "ReactNativeNavigation"
@@ -16,7 +16,7 @@ function run() {
16 16
             -derivedDataPath ./DerivedData/playground
17 17
             ONLY_ACTIVE_ARCH=YES`);
18 18
 
19
-  exec.execSync(`cd ./playground/ios &&
19
+  execWithXcprettyIfPossible(`cd ./playground/ios &&
20 20
             RCT_NO_LAUNCH_PACKAGER=true
21 21
             xcodebuild test-without-building
22 22
             -scheme "ReactNativeNavigation"
@@ -28,4 +28,12 @@ function run() {
28 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 39
 run();