@@ -4,7 +4,7 @@ unset CDPATH
4
4
tests_dir=$( dirname $( readlink -f $0 ) )
5
5
cd " $tests_dir "
6
6
7
- trap ' rm -fr tmp. * a.out' EXIT INT TERM
7
+ trap ' rm -fr tmp* a.out' EXIT INT TERM
8
8
9
9
# some values reported in errors are not determinate (e.g. variable addresses)
10
10
# and will vary between execution and definitely between platforms
@@ -35,7 +35,7 @@ mkdir -p $expected_output_dir
35
35
test_failed=0
36
36
37
37
# don't change the variable src_file some tests rely on it
38
- for src_file in tests/extracted_compile_time_tests/* .c tests/compile_time/* .c tests/run_time/* .c
38
+ for src_file in tests/extracted_compile_time_tests/* .c tests/compile_time/* .c tests/run_time/* .*
39
39
do
40
40
rm -f a.out
41
41
44
44
45
45
for compile_options in $compile_options_list
46
46
do
47
- dcc_flags=
48
- suffix=` echo $compile_options | sed ' s/^dcc_flags=//;s/["$]//g;s/src_file//' `
49
- eval $compile_options
50
- expected_stderr_file=" $expected_output_dir /` basename $src_file .c` $suffix .txt"
51
- # echo "$dcc" --c-compiler=$c_compiler $dcc_flags "$src_file"
52
- " $dcc " --c-compiler=$c_compiler $dcc_flags " $src_file " 2> tmp.actual_stderr > /dev/null
53
- test ! -s tmp.actual_stderr && ./a.out < /dev/null 2>> tmp.actual_stderr > /dev/null
47
+ case " $src_file " in
48
+ * .c)
49
+ dcc_flags=
50
+ suffix=` echo $compile_options | sed ' s/^dcc_flags=//;s/["$]//g;s/src_file//' `
51
+ eval $compile_options
52
+ expected_stderr_file=" $expected_output_dir /` basename $src_file .c` $suffix .txt"
53
+ # echo "$dcc" --c-compiler=$c_compiler $dcc_flags "$src_file"
54
+ " $dcc " --c-compiler=$c_compiler $dcc_flags " $src_file " 2> tmp.actual_stderr > /dev/null
55
+ test ! -s tmp.actual_stderr && ./a.out < /dev/null 2>> tmp.actual_stderr > /dev/null
56
+ ;;
57
+
58
+ * .sh)
59
+ expected_stderr_file=" $expected_output_dir /` basename $src_file .sh` .txt"
60
+ $src_file < /dev/null 2> tmp.actual_stderr > /dev/null
61
+ esac
54
62
55
63
if test ! -s tmp.actual_stderr
56
64
then
0 commit comments