-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from espressif/ci/host_test_refactor
refactor(host test): Refactor host test CI run
- Loading branch information
Showing
5 changed files
with
31 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
host/class/cdc/usb_host_cdc_acm/host_test/main/test_main.cpp
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# Extra arguments for the .elf files, to make the host test results and failures more informative | ||
# (https://github.com/catchorg/Catch2/tree/devel/docs) | ||
EXTRA_ARGS="--reporter Automake --reporter console::out=-::colour-mode=ansi" | ||
|
||
# Indicator for the CI job, whether a host test has failed or not | ||
TEST_FAILED=0 | ||
|
||
## Find all host_test*.elf files | ||
for test_file in $(find . -type f -name "host_test*.elf"); do | ||
echo "Running $test_file..." | ||
"$test_file" $EXTRA_ARGS # Call the host_test*.elf file with the extra arguments | ||
if [ $? -ne 0 ]; then # Check whether the host test failed | ||
TEST_FAILED=1 | ||
fi | ||
done | ||
|
||
# Return exit value 1 (FAIL) 0 (PASS) to ensure that the CI job passes/fails | ||
if [ $TEST_FAILED -ne 0 ]; then | ||
echo "Some host tests failed." | ||
exit 1 | ||
else | ||
echo "All host tests passed." | ||
exit 0 | ||
fi |