|
@@ -0,0 +1,34 @@
|
|
1
|
+const _ = require('lodash');
|
|
2
|
+const shellUtils = require('shell-utils');
|
|
3
|
+const fs = require('fs');
|
|
4
|
+
|
|
5
|
+function testProject() {
|
|
6
|
+ shellUtils.exec.execSync(`echo 'travis_fold:start:xcodeunit'`);
|
|
7
|
+ const cmd = `RCT_NO_LAUNCH_PACKAGER=true
|
|
8
|
+ cd ios && xcodebuild
|
|
9
|
+ test
|
|
10
|
+ -scheme "playground"
|
|
11
|
+ -project playground.xcodeproj
|
|
12
|
+ -destination 'platform=iOS Simulator,name=iPhone 7'
|
|
13
|
+ `;
|
|
14
|
+
|
|
15
|
+ if (hasXcpretty()) {
|
|
16
|
+ shellUtils.exec.execSync(`${cmd} | xcpretty && exit \${PIPESTATUS[0]}`);
|
|
17
|
+ } else {
|
|
18
|
+ shellUtils.exec.execSync(`${cmd}`);
|
|
19
|
+ }
|
|
20
|
+ shellUtils.exec.execSync(`echo 'travis_fold:end:xcodeunit'`);
|
|
21
|
+}
|
|
22
|
+function hasXcpretty() {
|
|
23
|
+ try {
|
|
24
|
+ return shellUtils.exec.execSyncRead(`which xcpretty`);
|
|
25
|
+ } catch (e) {
|
|
26
|
+ return false;
|
|
27
|
+ }
|
|
28
|
+}
|
|
29
|
+
|
|
30
|
+function run() {
|
|
31
|
+ testProject();
|
|
32
|
+}
|
|
33
|
+
|
|
34
|
+run();
|