heptagon/test/gen_ctests
Gwenal Delaval 6011353cec Added test of options
Added script test_option which:
- compile and run without option
- compile with option given as argument, run
- diff on the two outputs, fails if different outputs

config file checks for existence of compiler (fails if not exist)

statics1.ept is a copy of statics.ept ; statics2.ept depends on statics1.ept
instead of statics.ept (so as dependency order => lexical order on file names)
2012-07-19 15:23:40 +02:00

34 lines
760 B
Bash
Executable file

#!/bin/bash
for i in bad/*.ept; do
echo 'ADD_TEST(compile_fail_'`basename $i .ept` '"scripts/compile_fail"' '"'$i'" "-memalloc")'
done
for i in good/*.ept; do
echo 'ADD_TEST(compile_only_'`basename $i .ept` '"scripts/compile_only"' '"'$i'")'
done
for i in good/*.ept; do
echo 'ADD_TEST(compile_gcc_run_'`basename $i .ept` '"scripts/compile_gcc_run"' '"'$i'")'
done
function compile_diff () {
option=$1
for i in good/*.ept; do
echo "ADD_TEST(test_option_${option}_`basename $i .ept`" '"scripts/test_option"' '"'$i'"' '"-'$option'")'
done
}
compile_diff "bool"
compile_diff "deadcode"
compile_diff "tomato"
compile_diff "flatten"
compile_diff "itfusion"
compile_diff "memalloc"
compile_diff "unroll"
compile_diff "O"