forked from espressif/esp-usb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_host_tests.sh
More file actions
executable file
·26 lines (22 loc) · 853 Bytes
/
Copy pathrun_host_tests.sh
File metadata and controls
executable file
·26 lines (22 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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