diff --git a/runtests.sh b/runtests.sh index 9133de38..e711ba48 100755 --- a/runtests.sh +++ b/runtests.sh @@ -79,6 +79,11 @@ if [ $run_make = yes ]; then fi +DIFF=$(which gdiff || which diff) +if $DIFF --help | grep -q -- --color; then + diff_color="--color=always" +fi + rm -rf tmp/tests mkdir -p tmp/tests @@ -213,11 +218,6 @@ function run_test() printf "\n\n\x1b[33m*** Command: %s ***\x1b[0m\n\n" "$command" > $diffpath - DIFF=$(which gdiff || which diff) - if $DIFF --help | grep -q -- --color; then - diff_color="--color=always" - fi - if $DIFF --text -u $diff_color <( generate_expected_output $joufile $correct_exit_code | tr -d '\r' ) <(