Show and log what the functional test driver is running (#70)
Show and log what the functional test driver is running
* Log errors in the log file
* list all failed tests at the end
* pretty colors :x
* Print stderr when the test has failed
---------
Signed-off-by: Aurelien Bouteiller <aurelien.bouteiller@amd.com>
[ROCm/rocshmem commit: 67bc5b9e5a]
This commit is contained in:
committad av
GitHub
förälder
32f11bd5e5
incheckning
19e7b4798e
@@ -23,6 +23,13 @@
|
||||
###############################################################################
|
||||
|
||||
#!/bin/bash
|
||||
if true || tty -s; then
|
||||
PRETTY_FAILED="\033[1;31mFAILED\033[0m"
|
||||
PRETTY_PASSED="\033[1;32mPASSED\033[0m"
|
||||
else
|
||||
PRETTY_FAILED="FAILED"
|
||||
PRETTY_PASSED="PASSED"
|
||||
fi
|
||||
|
||||
# This names/values should match the TestType enum in rocSHMEM/tests/functional_tests/tester.hpp
|
||||
declare -A TEST_NUMBERS=(
|
||||
@@ -146,17 +153,20 @@ ExecTest() {
|
||||
TEST_LOG_NAME+=_"$MAX_MSG_SIZE"B
|
||||
fi
|
||||
|
||||
CMD+=" > $LOG_DIR/$TEST_LOG_NAME.log"
|
||||
CMD+=" >> $LOG_DIR/$TEST_LOG_NAME.log 2>&1"
|
||||
|
||||
# Run Test
|
||||
echo $TEST_LOG_NAME
|
||||
echo "# $CMD" >"$LOG_DIR/$TEST_LOG_NAME.log"
|
||||
eval $CMD
|
||||
|
||||
# Validate Test
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Failed $TEST_CONFIG" >&2
|
||||
echo -e "$PRETTY_FAILED: $TEST_LOG_NAME" >&2
|
||||
cat "$LOG_DIR/$TEST_LOG_NAME.log"
|
||||
DRIVER_RETURN_STATUS=1
|
||||
FAILED_LIST="$FAILED_LIST $TEST_LOG_NAME"
|
||||
fi
|
||||
|
||||
unset ROCSHMEM_MAX_NUM_CONTEXTS
|
||||
@@ -488,4 +498,10 @@ case $TEST in
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $(($DRIVER_RETURN_STATUS || $?))
|
||||
EXIT_STATUS=$(($DRIVER_RETURN_STATUS || $?))
|
||||
if [ $EXIT_STATUS -eq 0 ]; then
|
||||
echo -e "TESTS PASSED"
|
||||
else
|
||||
echo -e "TESTS FAILED: $FAILED_LIST"
|
||||
fi
|
||||
exit $EXIT_STATUS
|
||||
|
||||
Referens i nytt ärende
Block a user