test: Add --gitlab flag
This commit is contained in:
parent
579650d3b7
commit
f9726d0229
20
test/main.sh
20
test/main.sh
@ -7,11 +7,21 @@ GREEN="\e[32m"
|
||||
YELLOW="\e[33m"
|
||||
RESET="\e[0m"
|
||||
|
||||
if [[ "$1" =~ --all|-a ]]; then
|
||||
DIFF_COMMAND="diff --color"
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--all|-a)
|
||||
check_all=true
|
||||
else
|
||||
check_all=false
|
||||
fi
|
||||
;;
|
||||
--gitlab|-g)
|
||||
# Disable colored output, because alpine diff is missing --color flag
|
||||
DIFF_COMMAND="diff"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
|
||||
EXIT_STATUS=0
|
||||
|
||||
@ -74,7 +84,7 @@ _test_dir() {
|
||||
input_file=${input//*\/}
|
||||
test_case_number=${input_file%%_in.txt}
|
||||
|
||||
if ! diff --color <(./a.out < "test_data/${test_case_number}_in.txt") "test_data/${test_case_number}_out.txt"; then
|
||||
if ! $DIFF_COMMAND <(./a.out < "test_data/${test_case_number}_in.txt") "test_data/${test_case_number}_out.txt"; then
|
||||
EXIT_STATUS=1
|
||||
((failed_inputs++))
|
||||
_log 2 "$dir (#$test_case_number)"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user