diff options
Diffstat (limited to 'tests/test.sh')
-rwxr-xr-x | tests/test.sh | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/tests/test.sh b/tests/test.sh deleted file mode 100755 index 1d01f06..0000000 --- a/tests/test.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -tests='bf -control_flow -types -include -arrs_slices -ptr_arithmetic -defer -sizeof -new -arr -arr2 -arr3 -foreign -params -nms -varargs -printf -use -misc' - -STARTPWD=$(pwd) -cd $(pwd)/$(dirname $0) -TOC=../toc -CFLAGS="-g -Wno-parentheses-equality" -echo $$ - -compile_c() { - EXTRA_FLAGS="" - if [ "$CC" = "gcc -O0 -g" ]; then - EXTRA_FLAGS="-Wno-builtin-declaration-mismatch" - elif [ "$CC" = "clang -O3 -s" ]; then - EXTRA_FLAGS="-Wno-builtin-requires-header -Wno-format-security" - elif [ "$CC" = "tcc" ]; then - EXTRA_FLAGS="-w" - fi - $CC $CFLAGS $EXTRA_FLAGS -Werror -o a.out out.c || exit 1 -} - -failed=false - -do_tests() { - echo "----$1----" - valgrind -q --exit-on-first-error=yes --error-exitcode=1 $TOC "$1.toc" -o out.c || exit 1 - for CC in "gcc -O0 -g" "tcc" "clang -O3 -s"; do - if [ "$1" = "sizeof" ]; then - if [ "$CC" = "tcc" ]; then - continue # some versions of tcc don't have _Alignof - fi - fi - printf "Running test $1 with C compiler $CC... " - compile_c "$1" - ./a.out > got - if diff "$1"_expected got; then - printf '\x1b[92mpassed!\x1b[0m\n' - else - printf '\x1b[91mfailed!\x1b[0m\n' - exit 1 - fi - done -} -for x in $tests; do - do_tests "$x" -done - -rm got a.out out.c |