Skip to content

Commit c68dea2

Browse files
committed
Update emulator testing
1 parent e509d05 commit c68dea2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,17 @@ jobs:
234234
235235
cd -
236236
237-
adb shell "cd /data/local/tmp/${STAGING} && ./${PACKAGE}PackageTests.xctest"
237+
TEST_CMD="./${PACKAGE}PackageTests.xctest"
238+
TEST_SHELL="cd /data/local/tmp/${STAGING}"
239+
TEST_SHELL="${TEST_SHELL} && ${TEST_CMD}"
240+
241+
# Run a second time with the Swift Testing library
242+
# We additionally need to handle the special exit code EXIT_NO_TESTS_FOUND (69 on Android),
243+
# which can happen when the tests link to Testing, but no tests are executed
244+
# see: https://github.com/swiftlang/swift-package-manager/blob/1b593469e8ad3daf2cc10e798340bd2de68c402d/Sources/Commands/SwiftTestCommand.swift#L1542
245+
TEST_SHELL="${TEST_SHELL} && ${TEST_CMD} --testing-library swift-testing && [ \$? -eq 0 ] || [ \$? -eq 69 ]"
246+
247+
adb shell "${TEST_SHELL}"
238248
EOF
239249
240250
chmod +x run-tests.sh
@@ -258,6 +268,8 @@ jobs:
258268
run: ./run-tests.sh apple/swift-system
259269

260270
- name: Run swift-crypto tests
271+
# references Tests/ file paths by absolute filename
272+
if: false
261273
run: ./run-tests.sh apple/swift-crypto
262274

263275
- name: Run swift-nio tests

0 commit comments

Comments
 (0)