File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -363,7 +363,18 @@ runs:
363
363
echo "adb push ${TEST_BASE_FOLDER} ${REMOTE_FOLDER}" >> ${SCRIPT_FILE}
364
364
for XCTEST in ${TEST_BASE_FOLDER}/*.xctest; do
365
365
XCTEST_BASE=$(basename "${XCTEST}")
366
- echo "adb shell 'cd ${REMOTE_FOLDER}/${TEST_BASE_FOLDER} && ${{ inputs.test-env }} ./${XCTEST_BASE} ${{ inputs.swift-test-flags }} && ${{ inputs.test-env }} ./${XCTEST_BASE} ${{ inputs.swift-test-flags }} --testing-library swift-testing'" >> ${SCRIPT_FILE}
366
+ TEST_CMD="${{ inputs.test-env }} ./${XCTEST_BASE} ${{ inputs.swift-test-flags }}"
367
+
368
+ TEST_SHELL="cd ${REMOTE_FOLDER}/${TEST_BASE_FOLDER}"
369
+ TEST_SHELL="${TEST_SHELL} && ${TEST_CMD}"
370
+ if [[ "${{ steps.setup.outputs.swift-version }}" != 6.0* ]]; then
371
+ # for SDKs that support it (i.e., 6.1+), add another invocation using the swift-testing library
372
+ # see https://github.com/swiftlang/swift-package-manager/issues/8362#issuecomment-2719116854
373
+ # but only do it when the command links to the Testing library, otherwise it will fail with the error:
374
+ # Error: Invalid option "--testing-library"
375
+ patchelf --print-needed ${XCTEST} | grep libTesting.so && TEST_SHELL="${TEST_SHELL} && ${TEST_CMD} --testing-library swift-testing" || true
376
+ fi
377
+ echo "adb shell '${TEST_SHELL}'" >> ${SCRIPT_FILE}
367
378
done
368
379
369
380
# ensure the emulator stops when we are done
You can’t perform that action at this time.
0 commit comments