Skip to content

Commit b4286f5

Browse files
committed
Handle exit code EXIT_NO_TESTS_FOUND (69) when Testing finds no test cases (see swiftlang/swift-package-manager#8362 (comment))
1 parent a72c2d1 commit b4286f5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

action.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,11 @@ runs:
375375
# see https://github.com/swiftlang/swift-package-manager/issues/8362#issuecomment-2719116854
376376
# but only do it when the command links to the Testing library, otherwise it will fail with the error:
377377
# Error: Invalid option "--testing-library"
378-
patchelf --print-needed ${XCTEST} | grep libTesting.so && TEST_SHELL="${TEST_SHELL} && ${TEST_CMD} --testing-library swift-testing" || true
378+
#
379+
# We additionally need to handle the special exit code EXIT_NO_TESTS_FOUND (69 on Android),
380+
# which can happen when the tests link to Testing, but no tests are executed
381+
# see: https://github.com/swiftlang/swift-package-manager/blob/1b593469e8ad3daf2cc10e798340bd2de68c402d/Sources/Commands/SwiftTestCommand.swift#L1542
382+
patchelf --print-needed ${XCTEST} | grep libTesting.so && TEST_SHELL="${TEST_SHELL} && ${TEST_CMD} --testing-library swift-testing && [ $? -eq 0 ] || [ $? -eq 69 ]" || true
379383
fi
380384
echo "adb shell '${TEST_SHELL}'" >> ${SCRIPT_FILE}
381385
done

0 commit comments

Comments
 (0)