mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-11-28 05:00:26 +08:00
Adds the following changes to copy tests: - print the body of the test if the test fails - add a count of how many tests passed out of the total - remove the -r flag from the tests
24 lines
No EOL
636 B
Bash
Executable file
24 lines
No EOL
636 B
Bash
Executable file
#!/bin/bash
|
|
|
|
cd "$(dirname "$0")"
|
|
source testutil.sh
|
|
|
|
TOTAL_COPY_TESTS_RUN=0
|
|
TOTAL_COPY_TESTS_PASSED=0
|
|
|
|
for fname in cases/*.sh; do
|
|
setup_testcp
|
|
#"${fname}" | read outerr && printf "\e[32mPASS $fname\n\n\e[0m" || printf "\e[31mFAIL $fname: $outerr \n\n\e[0m"
|
|
if ! outerr=$("${fname}" 2>&1); then
|
|
printf "\e[31mFAIL $fname:\n$outerr \n\e[0m"
|
|
cat "${fname}"
|
|
printf "\n"
|
|
else
|
|
printf "\e[32mPASS $fname\n\n\e[0m"
|
|
((TOTAL_COPY_TESTS_PASSED++))
|
|
fi
|
|
cleanup_testcp
|
|
((TOTAL_COPY_TESTS_RUN++))
|
|
done
|
|
|
|
printf "\n\e[32m${TOTAL_COPY_TESTS_PASSED} of ${TOTAL_COPY_TESTS_RUN} Tests Passed \e[0m\n\n" |