From 6011353cec5812c4b6d826c95686c5fc8b60a6da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwena=EBl=20Delaval?= Date: Thu, 19 Jul 2012 15:23:40 +0200 Subject: [PATCH] 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) --- test/CTestTestfile.cmake | 584 ++++++++++++++++++++++++++++++++++- test/bad/side_effect.ept | 16 + test/gen_ctests | 18 ++ test/good/statics1.ept | 35 +++ test/good/statics2.ept | 2 +- test/scripts/compile_gcc_run | 8 +- test/scripts/config | 8 +- test/scripts/test_option | 129 ++++++++ 8 files changed, 791 insertions(+), 9 deletions(-) create mode 100644 test/bad/side_effect.ept create mode 100644 test/good/statics1.ept create mode 100755 test/scripts/test_option diff --git a/test/CTestTestfile.cmake b/test/CTestTestfile.cmake index 73dffd5..cd7d95d 100644 --- a/test/CTestTestfile.cmake +++ b/test/CTestTestfile.cmake @@ -17,6 +17,7 @@ ADD_TEST(compile_fail_linear_fun "scripts/compile_fail" "bad/linear_fun.ept" "-m ADD_TEST(compile_fail_linear_init "scripts/compile_fail" "bad/linear_init.ept" "-memalloc") ADD_TEST(compile_fail_linear_map "scripts/compile_fail" "bad/linear_map.ept" "-memalloc") ADD_TEST(compile_fail_linear_mapfold "scripts/compile_fail" "bad/linear_mapfold.ept" "-memalloc") +ADD_TEST(compile_fail_side_effect "scripts/compile_fail" "bad/side_effect.ept" "-memalloc") ADD_TEST(compile_fail_t10-initialization "scripts/compile_fail" "bad/t10-initialization.ept" "-memalloc") ADD_TEST(compile_fail_t11-initialization "scripts/compile_fail" "bad/t11-initialization.ept" "-memalloc") ADD_TEST(compile_fail_t1 "scripts/compile_fail" "bad/t1.ept" "-memalloc") @@ -69,8 +70,9 @@ ADD_TEST(compile_only_reinit "scripts/compile_only" "good/reinit.ept") ADD_TEST(compile_only_sampling_stateful_output2 "scripts/compile_only" "good/sampling_stateful_output2.ept") ADD_TEST(compile_only_sampling_stateful_output "scripts/compile_only" "good/sampling_stateful_output.ept") ADD_TEST(compile_only_side_effet "scripts/compile_only" "good/side_effet.ept") -ADD_TEST(compile_only_statics "scripts/compile_only" "good/statics.ept") +ADD_TEST(compile_only_statics1 "scripts/compile_only" "good/statics1.ept") ADD_TEST(compile_only_statics2 "scripts/compile_only" "good/statics2.ept") +ADD_TEST(compile_only_statics "scripts/compile_only" "good/statics.ept") ADD_TEST(compile_only_t10 "scripts/compile_only" "good/t10.ept") ADD_TEST(compile_only_t11 "scripts/compile_only" "good/t11.ept") ADD_TEST(compile_only_t12 "scripts/compile_only" "good/t12.ept") @@ -140,8 +142,9 @@ ADD_TEST(compile_gcc_run_reinit "scripts/compile_gcc_run" "good/reinit.ept") ADD_TEST(compile_gcc_run_sampling_stateful_output2 "scripts/compile_gcc_run" "good/sampling_stateful_output2.ept") ADD_TEST(compile_gcc_run_sampling_stateful_output "scripts/compile_gcc_run" "good/sampling_stateful_output.ept") ADD_TEST(compile_gcc_run_side_effet "scripts/compile_gcc_run" "good/side_effet.ept") -ADD_TEST(compile_gcc_run_statics "scripts/compile_gcc_run" "good/statics.ept") +ADD_TEST(compile_gcc_run_statics1 "scripts/compile_gcc_run" "good/statics1.ept") ADD_TEST(compile_gcc_run_statics2 "scripts/compile_gcc_run" "good/statics2.ept") +ADD_TEST(compile_gcc_run_statics "scripts/compile_gcc_run" "good/statics.ept") ADD_TEST(compile_gcc_run_t10 "scripts/compile_gcc_run" "good/t10.ept") ADD_TEST(compile_gcc_run_t11 "scripts/compile_gcc_run" "good/t11.ept") ADD_TEST(compile_gcc_run_t12 "scripts/compile_gcc_run" "good/t12.ept") @@ -171,4 +174,579 @@ ADD_TEST(compile_gcc_run_tuple_args "scripts/compile_gcc_run" "good/tuple_args.e ADD_TEST(compile_gcc_run_type_alias "scripts/compile_gcc_run" "good/type_alias.ept") ADD_TEST(compile_gcc_run_updown "scripts/compile_gcc_run" "good/updown.ept") ADD_TEST(compile_gcc_run_when_merge1 "scripts/compile_gcc_run" "good/when_merge1.ept") - +ADD_TEST(test_option_bool_alloc "scripts/test_option" "good/alloc.ept" "-bool") +ADD_TEST(test_option_bool_array1 "scripts/test_option" "good/array1.ept" "-bool") +ADD_TEST(test_option_bool_array2 "scripts/test_option" "good/array2.ept" "-bool") +ADD_TEST(test_option_bool_array_fill "scripts/test_option" "good/array_fill.ept" "-bool") +ADD_TEST(test_option_bool_array_iterators2 "scripts/test_option" "good/array_iterators2.ept" "-bool") +ADD_TEST(test_option_bool_array_iterators "scripts/test_option" "good/array_iterators.ept" "-bool") +ADD_TEST(test_option_bool_array_power "scripts/test_option" "good/array_power.ept" "-bool") +ADD_TEST(test_option_bool_auto2 "scripts/test_option" "good/auto2.ept" "-bool") +ADD_TEST(test_option_bool_auto "scripts/test_option" "good/auto.ept" "-bool") +ADD_TEST(test_option_bool_autohiera2 "scripts/test_option" "good/autohiera2.ept" "-bool") +ADD_TEST(test_option_bool_autohiera "scripts/test_option" "good/autohiera.ept" "-bool") +ADD_TEST(test_option_bool_bad_updown "scripts/test_option" "good/bad_updown.ept" "-bool") +ADD_TEST(test_option_bool_ckannot "scripts/test_option" "good/ckannot.ept" "-bool") +ADD_TEST(test_option_bool_clock_causality "scripts/test_option" "good/clock_causality.ept" "-bool") +ADD_TEST(test_option_bool_clocks "scripts/test_option" "good/clocks.ept" "-bool") +ADD_TEST(test_option_bool_counter "scripts/test_option" "good/counter.ept" "-bool") +ADD_TEST(test_option_bool_current "scripts/test_option" "good/current.ept" "-bool") +ADD_TEST(test_option_bool_fbyfby2 "scripts/test_option" "good/fbyfby2.ept" "-bool") +ADD_TEST(test_option_bool_foldi "scripts/test_option" "good/foldi.ept" "-bool") +ADD_TEST(test_option_bool_format "scripts/test_option" "good/format.ept" "-bool") +ADD_TEST(test_option_bool_grosauto_clock "scripts/test_option" "good/grosauto_clock.ept" "-bool") +ADD_TEST(test_option_bool_hierarchie "scripts/test_option" "good/hierarchie.ept" "-bool") +ADD_TEST(test_option_bool_itfusion "scripts/test_option" "good/itfusion.ept" "-bool") +ADD_TEST(test_option_bool_linear_automata "scripts/test_option" "good/linear_automata.ept" "-bool") +ADD_TEST(test_option_bool_linear "scripts/test_option" "good/linear.ept" "-bool") +ADD_TEST(test_option_bool_linear_init "scripts/test_option" "good/linear_init.ept" "-bool") +ADD_TEST(test_option_bool_linear_split "scripts/test_option" "good/linear_split.ept" "-bool") +ADD_TEST(test_option_bool_linear_vars "scripts/test_option" "good/linear_vars.ept" "-bool") +ADD_TEST(test_option_bool_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-bool") +ADD_TEST(test_option_bool_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-bool") +ADD_TEST(test_option_bool_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-bool") +ADD_TEST(test_option_bool_name_clash "scripts/test_option" "good/name_clash.ept" "-bool") +ADD_TEST(test_option_bool_norm "scripts/test_option" "good/norm.ept" "-bool") +ADD_TEST(test_option_bool_or_keep "scripts/test_option" "good/or_keep.ept" "-bool") +ADD_TEST(test_option_bool_parametrize "scripts/test_option" "good/parametrize.ept" "-bool") +ADD_TEST(test_option_bool_pre_tuple "scripts/test_option" "good/pre_tuple.ept" "-bool") +ADD_TEST(test_option_bool_reinit "scripts/test_option" "good/reinit.ept" "-bool") +ADD_TEST(test_option_bool_sampling_stateful_output2 "scripts/test_option" "good/sampling_stateful_output2.ept" "-bool") +ADD_TEST(test_option_bool_sampling_stateful_output "scripts/test_option" "good/sampling_stateful_output.ept" "-bool") +ADD_TEST(test_option_bool_side_effet "scripts/test_option" "good/side_effet.ept" "-bool") +ADD_TEST(test_option_bool_statics1 "scripts/test_option" "good/statics1.ept" "-bool") +ADD_TEST(test_option_bool_statics2 "scripts/test_option" "good/statics2.ept" "-bool") +ADD_TEST(test_option_bool_statics "scripts/test_option" "good/statics.ept" "-bool") +ADD_TEST(test_option_bool_t10 "scripts/test_option" "good/t10.ept" "-bool") +ADD_TEST(test_option_bool_t11 "scripts/test_option" "good/t11.ept" "-bool") +ADD_TEST(test_option_bool_t12 "scripts/test_option" "good/t12.ept" "-bool") +ADD_TEST(test_option_bool_t13 "scripts/test_option" "good/t13.ept" "-bool") +ADD_TEST(test_option_bool_t14 "scripts/test_option" "good/t14.ept" "-bool") +ADD_TEST(test_option_bool_t15 "scripts/test_option" "good/t15.ept" "-bool") +ADD_TEST(test_option_bool_t16 "scripts/test_option" "good/t16.ept" "-bool") +ADD_TEST(test_option_bool_t17 "scripts/test_option" "good/t17.ept" "-bool") +ADD_TEST(test_option_bool_t18 "scripts/test_option" "good/t18.ept" "-bool") +ADD_TEST(test_option_bool_t19 "scripts/test_option" "good/t19.ept" "-bool") +ADD_TEST(test_option_bool_t1 "scripts/test_option" "good/t1.ept" "-bool") +ADD_TEST(test_option_bool_t2 "scripts/test_option" "good/t2.ept" "-bool") +ADD_TEST(test_option_bool_t2open "scripts/test_option" "good/t2open.ept" "-bool") +ADD_TEST(test_option_bool_t3 "scripts/test_option" "good/t3.ept" "-bool") +ADD_TEST(test_option_bool_t4 "scripts/test_option" "good/t4.ept" "-bool") +ADD_TEST(test_option_bool_t5 "scripts/test_option" "good/t5.ept" "-bool") +ADD_TEST(test_option_bool_t6 "scripts/test_option" "good/t6.ept" "-bool") +ADD_TEST(test_option_bool_t7 "scripts/test_option" "good/t7.ept" "-bool") +ADD_TEST(test_option_bool_t8 "scripts/test_option" "good/t8.ept" "-bool") +ADD_TEST(test_option_bool_t9 "scripts/test_option" "good/t9.ept" "-bool") +ADD_TEST(test_option_bool_t "scripts/test_option" "good/t.ept" "-bool") +ADD_TEST(test_option_bool_test "scripts/test_option" "good/test.ept" "-bool") +ADD_TEST(test_option_bool_threestates "scripts/test_option" "good/threestates.ept" "-bool") +ADD_TEST(test_option_bool_tt "scripts/test_option" "good/tt.ept" "-bool") +ADD_TEST(test_option_bool_tttt "scripts/test_option" "good/tttt.ept" "-bool") +ADD_TEST(test_option_bool_tuple_args "scripts/test_option" "good/tuple_args.ept" "-bool") +ADD_TEST(test_option_bool_type_alias "scripts/test_option" "good/type_alias.ept" "-bool") +ADD_TEST(test_option_bool_updown "scripts/test_option" "good/updown.ept" "-bool") +ADD_TEST(test_option_bool_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-bool") +ADD_TEST(test_option_deadcode_alloc "scripts/test_option" "good/alloc.ept" "-deadcode") +ADD_TEST(test_option_deadcode_array1 "scripts/test_option" "good/array1.ept" "-deadcode") +ADD_TEST(test_option_deadcode_array2 "scripts/test_option" "good/array2.ept" "-deadcode") +ADD_TEST(test_option_deadcode_array_fill "scripts/test_option" "good/array_fill.ept" "-deadcode") +ADD_TEST(test_option_deadcode_array_iterators2 "scripts/test_option" "good/array_iterators2.ept" "-deadcode") +ADD_TEST(test_option_deadcode_array_iterators "scripts/test_option" "good/array_iterators.ept" "-deadcode") +ADD_TEST(test_option_deadcode_array_power "scripts/test_option" "good/array_power.ept" "-deadcode") +ADD_TEST(test_option_deadcode_auto2 "scripts/test_option" "good/auto2.ept" "-deadcode") +ADD_TEST(test_option_deadcode_auto "scripts/test_option" "good/auto.ept" "-deadcode") +ADD_TEST(test_option_deadcode_autohiera2 "scripts/test_option" "good/autohiera2.ept" "-deadcode") +ADD_TEST(test_option_deadcode_autohiera "scripts/test_option" "good/autohiera.ept" "-deadcode") +ADD_TEST(test_option_deadcode_bad_updown "scripts/test_option" "good/bad_updown.ept" "-deadcode") +ADD_TEST(test_option_deadcode_ckannot "scripts/test_option" "good/ckannot.ept" "-deadcode") +ADD_TEST(test_option_deadcode_clock_causality "scripts/test_option" "good/clock_causality.ept" "-deadcode") +ADD_TEST(test_option_deadcode_clocks "scripts/test_option" "good/clocks.ept" "-deadcode") +ADD_TEST(test_option_deadcode_counter "scripts/test_option" "good/counter.ept" "-deadcode") +ADD_TEST(test_option_deadcode_current "scripts/test_option" "good/current.ept" "-deadcode") +ADD_TEST(test_option_deadcode_fbyfby2 "scripts/test_option" "good/fbyfby2.ept" "-deadcode") +ADD_TEST(test_option_deadcode_foldi "scripts/test_option" "good/foldi.ept" "-deadcode") +ADD_TEST(test_option_deadcode_format "scripts/test_option" "good/format.ept" "-deadcode") +ADD_TEST(test_option_deadcode_grosauto_clock "scripts/test_option" "good/grosauto_clock.ept" "-deadcode") +ADD_TEST(test_option_deadcode_hierarchie "scripts/test_option" "good/hierarchie.ept" "-deadcode") +ADD_TEST(test_option_deadcode_itfusion "scripts/test_option" "good/itfusion.ept" "-deadcode") +ADD_TEST(test_option_deadcode_linear_automata "scripts/test_option" "good/linear_automata.ept" "-deadcode") +ADD_TEST(test_option_deadcode_linear "scripts/test_option" "good/linear.ept" "-deadcode") +ADD_TEST(test_option_deadcode_linear_init "scripts/test_option" "good/linear_init.ept" "-deadcode") +ADD_TEST(test_option_deadcode_linear_split "scripts/test_option" "good/linear_split.ept" "-deadcode") +ADD_TEST(test_option_deadcode_linear_vars "scripts/test_option" "good/linear_vars.ept" "-deadcode") +ADD_TEST(test_option_deadcode_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-deadcode") +ADD_TEST(test_option_deadcode_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-deadcode") +ADD_TEST(test_option_deadcode_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-deadcode") +ADD_TEST(test_option_deadcode_name_clash "scripts/test_option" "good/name_clash.ept" "-deadcode") +ADD_TEST(test_option_deadcode_norm "scripts/test_option" "good/norm.ept" "-deadcode") +ADD_TEST(test_option_deadcode_or_keep "scripts/test_option" "good/or_keep.ept" "-deadcode") +ADD_TEST(test_option_deadcode_parametrize "scripts/test_option" "good/parametrize.ept" "-deadcode") +ADD_TEST(test_option_deadcode_pre_tuple "scripts/test_option" "good/pre_tuple.ept" "-deadcode") +ADD_TEST(test_option_deadcode_reinit "scripts/test_option" "good/reinit.ept" "-deadcode") +ADD_TEST(test_option_deadcode_sampling_stateful_output2 "scripts/test_option" "good/sampling_stateful_output2.ept" "-deadcode") +ADD_TEST(test_option_deadcode_sampling_stateful_output "scripts/test_option" "good/sampling_stateful_output.ept" "-deadcode") +ADD_TEST(test_option_deadcode_side_effet "scripts/test_option" "good/side_effet.ept" "-deadcode") +ADD_TEST(test_option_deadcode_statics1 "scripts/test_option" "good/statics1.ept" "-deadcode") +ADD_TEST(test_option_deadcode_statics2 "scripts/test_option" "good/statics2.ept" "-deadcode") +ADD_TEST(test_option_deadcode_statics "scripts/test_option" "good/statics.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t10 "scripts/test_option" "good/t10.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t11 "scripts/test_option" "good/t11.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t12 "scripts/test_option" "good/t12.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t13 "scripts/test_option" "good/t13.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t14 "scripts/test_option" "good/t14.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t15 "scripts/test_option" "good/t15.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t16 "scripts/test_option" "good/t16.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t17 "scripts/test_option" "good/t17.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t18 "scripts/test_option" "good/t18.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t19 "scripts/test_option" "good/t19.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t1 "scripts/test_option" "good/t1.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t2 "scripts/test_option" "good/t2.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t2open "scripts/test_option" "good/t2open.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t3 "scripts/test_option" "good/t3.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t4 "scripts/test_option" "good/t4.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t5 "scripts/test_option" "good/t5.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t6 "scripts/test_option" "good/t6.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t7 "scripts/test_option" "good/t7.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t8 "scripts/test_option" "good/t8.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t9 "scripts/test_option" "good/t9.ept" "-deadcode") +ADD_TEST(test_option_deadcode_t "scripts/test_option" "good/t.ept" "-deadcode") +ADD_TEST(test_option_deadcode_test "scripts/test_option" "good/test.ept" "-deadcode") +ADD_TEST(test_option_deadcode_threestates "scripts/test_option" "good/threestates.ept" "-deadcode") +ADD_TEST(test_option_deadcode_tt "scripts/test_option" "good/tt.ept" "-deadcode") +ADD_TEST(test_option_deadcode_tttt "scripts/test_option" "good/tttt.ept" "-deadcode") +ADD_TEST(test_option_deadcode_tuple_args "scripts/test_option" "good/tuple_args.ept" "-deadcode") +ADD_TEST(test_option_deadcode_type_alias "scripts/test_option" "good/type_alias.ept" "-deadcode") +ADD_TEST(test_option_deadcode_updown "scripts/test_option" "good/updown.ept" "-deadcode") +ADD_TEST(test_option_deadcode_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-deadcode") +ADD_TEST(test_option_tomato_alloc "scripts/test_option" "good/alloc.ept" "-tomato") +ADD_TEST(test_option_tomato_array1 "scripts/test_option" "good/array1.ept" "-tomato") +ADD_TEST(test_option_tomato_array2 "scripts/test_option" "good/array2.ept" "-tomato") +ADD_TEST(test_option_tomato_array_fill "scripts/test_option" "good/array_fill.ept" "-tomato") +ADD_TEST(test_option_tomato_array_iterators2 "scripts/test_option" "good/array_iterators2.ept" "-tomato") +ADD_TEST(test_option_tomato_array_iterators "scripts/test_option" "good/array_iterators.ept" "-tomato") +ADD_TEST(test_option_tomato_array_power "scripts/test_option" "good/array_power.ept" "-tomato") +ADD_TEST(test_option_tomato_auto2 "scripts/test_option" "good/auto2.ept" "-tomato") +ADD_TEST(test_option_tomato_auto "scripts/test_option" "good/auto.ept" "-tomato") +ADD_TEST(test_option_tomato_autohiera2 "scripts/test_option" "good/autohiera2.ept" "-tomato") +ADD_TEST(test_option_tomato_autohiera "scripts/test_option" "good/autohiera.ept" "-tomato") +ADD_TEST(test_option_tomato_bad_updown "scripts/test_option" "good/bad_updown.ept" "-tomato") +ADD_TEST(test_option_tomato_ckannot "scripts/test_option" "good/ckannot.ept" "-tomato") +ADD_TEST(test_option_tomato_clock_causality "scripts/test_option" "good/clock_causality.ept" "-tomato") +ADD_TEST(test_option_tomato_clocks "scripts/test_option" "good/clocks.ept" "-tomato") +ADD_TEST(test_option_tomato_counter "scripts/test_option" "good/counter.ept" "-tomato") +ADD_TEST(test_option_tomato_current "scripts/test_option" "good/current.ept" "-tomato") +ADD_TEST(test_option_tomato_fbyfby2 "scripts/test_option" "good/fbyfby2.ept" "-tomato") +ADD_TEST(test_option_tomato_foldi "scripts/test_option" "good/foldi.ept" "-tomato") +ADD_TEST(test_option_tomato_format "scripts/test_option" "good/format.ept" "-tomato") +ADD_TEST(test_option_tomato_grosauto_clock "scripts/test_option" "good/grosauto_clock.ept" "-tomato") +ADD_TEST(test_option_tomato_hierarchie "scripts/test_option" "good/hierarchie.ept" "-tomato") +ADD_TEST(test_option_tomato_itfusion "scripts/test_option" "good/itfusion.ept" "-tomato") +ADD_TEST(test_option_tomato_linear_automata "scripts/test_option" "good/linear_automata.ept" "-tomato") +ADD_TEST(test_option_tomato_linear "scripts/test_option" "good/linear.ept" "-tomato") +ADD_TEST(test_option_tomato_linear_init "scripts/test_option" "good/linear_init.ept" "-tomato") +ADD_TEST(test_option_tomato_linear_split "scripts/test_option" "good/linear_split.ept" "-tomato") +ADD_TEST(test_option_tomato_linear_vars "scripts/test_option" "good/linear_vars.ept" "-tomato") +ADD_TEST(test_option_tomato_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-tomato") +ADD_TEST(test_option_tomato_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-tomato") +ADD_TEST(test_option_tomato_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-tomato") +ADD_TEST(test_option_tomato_name_clash "scripts/test_option" "good/name_clash.ept" "-tomato") +ADD_TEST(test_option_tomato_norm "scripts/test_option" "good/norm.ept" "-tomato") +ADD_TEST(test_option_tomato_or_keep "scripts/test_option" "good/or_keep.ept" "-tomato") +ADD_TEST(test_option_tomato_parametrize "scripts/test_option" "good/parametrize.ept" "-tomato") +ADD_TEST(test_option_tomato_pre_tuple "scripts/test_option" "good/pre_tuple.ept" "-tomato") +ADD_TEST(test_option_tomato_reinit "scripts/test_option" "good/reinit.ept" "-tomato") +ADD_TEST(test_option_tomato_sampling_stateful_output2 "scripts/test_option" "good/sampling_stateful_output2.ept" "-tomato") +ADD_TEST(test_option_tomato_sampling_stateful_output "scripts/test_option" "good/sampling_stateful_output.ept" "-tomato") +ADD_TEST(test_option_tomato_side_effet "scripts/test_option" "good/side_effet.ept" "-tomato") +ADD_TEST(test_option_tomato_statics1 "scripts/test_option" "good/statics1.ept" "-tomato") +ADD_TEST(test_option_tomato_statics2 "scripts/test_option" "good/statics2.ept" "-tomato") +ADD_TEST(test_option_tomato_statics "scripts/test_option" "good/statics.ept" "-tomato") +ADD_TEST(test_option_tomato_t10 "scripts/test_option" "good/t10.ept" "-tomato") +ADD_TEST(test_option_tomato_t11 "scripts/test_option" "good/t11.ept" "-tomato") +ADD_TEST(test_option_tomato_t12 "scripts/test_option" "good/t12.ept" "-tomato") +ADD_TEST(test_option_tomato_t13 "scripts/test_option" "good/t13.ept" "-tomato") +ADD_TEST(test_option_tomato_t14 "scripts/test_option" "good/t14.ept" "-tomato") +ADD_TEST(test_option_tomato_t15 "scripts/test_option" "good/t15.ept" "-tomato") +ADD_TEST(test_option_tomato_t16 "scripts/test_option" "good/t16.ept" "-tomato") +ADD_TEST(test_option_tomato_t17 "scripts/test_option" "good/t17.ept" "-tomato") +ADD_TEST(test_option_tomato_t18 "scripts/test_option" "good/t18.ept" "-tomato") +ADD_TEST(test_option_tomato_t19 "scripts/test_option" "good/t19.ept" "-tomato") +ADD_TEST(test_option_tomato_t1 "scripts/test_option" "good/t1.ept" "-tomato") +ADD_TEST(test_option_tomato_t2 "scripts/test_option" "good/t2.ept" "-tomato") +ADD_TEST(test_option_tomato_t2open "scripts/test_option" "good/t2open.ept" "-tomato") +ADD_TEST(test_option_tomato_t3 "scripts/test_option" "good/t3.ept" "-tomato") +ADD_TEST(test_option_tomato_t4 "scripts/test_option" "good/t4.ept" "-tomato") +ADD_TEST(test_option_tomato_t5 "scripts/test_option" "good/t5.ept" "-tomato") +ADD_TEST(test_option_tomato_t6 "scripts/test_option" "good/t6.ept" "-tomato") +ADD_TEST(test_option_tomato_t7 "scripts/test_option" "good/t7.ept" "-tomato") +ADD_TEST(test_option_tomato_t8 "scripts/test_option" "good/t8.ept" "-tomato") +ADD_TEST(test_option_tomato_t9 "scripts/test_option" "good/t9.ept" "-tomato") +ADD_TEST(test_option_tomato_t "scripts/test_option" "good/t.ept" "-tomato") +ADD_TEST(test_option_tomato_test "scripts/test_option" "good/test.ept" "-tomato") +ADD_TEST(test_option_tomato_threestates "scripts/test_option" "good/threestates.ept" "-tomato") +ADD_TEST(test_option_tomato_tt "scripts/test_option" "good/tt.ept" "-tomato") +ADD_TEST(test_option_tomato_tttt "scripts/test_option" "good/tttt.ept" "-tomato") +ADD_TEST(test_option_tomato_tuple_args "scripts/test_option" "good/tuple_args.ept" "-tomato") +ADD_TEST(test_option_tomato_type_alias "scripts/test_option" "good/type_alias.ept" "-tomato") +ADD_TEST(test_option_tomato_updown "scripts/test_option" "good/updown.ept" "-tomato") +ADD_TEST(test_option_tomato_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-tomato") +ADD_TEST(test_option_flatten_alloc "scripts/test_option" "good/alloc.ept" "-flatten") +ADD_TEST(test_option_flatten_array1 "scripts/test_option" "good/array1.ept" "-flatten") +ADD_TEST(test_option_flatten_array2 "scripts/test_option" "good/array2.ept" "-flatten") +ADD_TEST(test_option_flatten_array_fill "scripts/test_option" "good/array_fill.ept" "-flatten") +ADD_TEST(test_option_flatten_array_iterators2 "scripts/test_option" "good/array_iterators2.ept" "-flatten") +ADD_TEST(test_option_flatten_array_iterators "scripts/test_option" "good/array_iterators.ept" "-flatten") +ADD_TEST(test_option_flatten_array_power "scripts/test_option" "good/array_power.ept" "-flatten") +ADD_TEST(test_option_flatten_auto2 "scripts/test_option" "good/auto2.ept" "-flatten") +ADD_TEST(test_option_flatten_auto "scripts/test_option" "good/auto.ept" "-flatten") +ADD_TEST(test_option_flatten_autohiera2 "scripts/test_option" "good/autohiera2.ept" "-flatten") +ADD_TEST(test_option_flatten_autohiera "scripts/test_option" "good/autohiera.ept" "-flatten") +ADD_TEST(test_option_flatten_bad_updown "scripts/test_option" "good/bad_updown.ept" "-flatten") +ADD_TEST(test_option_flatten_ckannot "scripts/test_option" "good/ckannot.ept" "-flatten") +ADD_TEST(test_option_flatten_clock_causality "scripts/test_option" "good/clock_causality.ept" "-flatten") +ADD_TEST(test_option_flatten_clocks "scripts/test_option" "good/clocks.ept" "-flatten") +ADD_TEST(test_option_flatten_counter "scripts/test_option" "good/counter.ept" "-flatten") +ADD_TEST(test_option_flatten_current "scripts/test_option" "good/current.ept" "-flatten") +ADD_TEST(test_option_flatten_fbyfby2 "scripts/test_option" "good/fbyfby2.ept" "-flatten") +ADD_TEST(test_option_flatten_foldi "scripts/test_option" "good/foldi.ept" "-flatten") +ADD_TEST(test_option_flatten_format "scripts/test_option" "good/format.ept" "-flatten") +ADD_TEST(test_option_flatten_grosauto_clock "scripts/test_option" "good/grosauto_clock.ept" "-flatten") +ADD_TEST(test_option_flatten_hierarchie "scripts/test_option" "good/hierarchie.ept" "-flatten") +ADD_TEST(test_option_flatten_itfusion "scripts/test_option" "good/itfusion.ept" "-flatten") +ADD_TEST(test_option_flatten_linear_automata "scripts/test_option" "good/linear_automata.ept" "-flatten") +ADD_TEST(test_option_flatten_linear "scripts/test_option" "good/linear.ept" "-flatten") +ADD_TEST(test_option_flatten_linear_init "scripts/test_option" "good/linear_init.ept" "-flatten") +ADD_TEST(test_option_flatten_linear_split "scripts/test_option" "good/linear_split.ept" "-flatten") +ADD_TEST(test_option_flatten_linear_vars "scripts/test_option" "good/linear_vars.ept" "-flatten") +ADD_TEST(test_option_flatten_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-flatten") +ADD_TEST(test_option_flatten_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-flatten") +ADD_TEST(test_option_flatten_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-flatten") +ADD_TEST(test_option_flatten_name_clash "scripts/test_option" "good/name_clash.ept" "-flatten") +ADD_TEST(test_option_flatten_norm "scripts/test_option" "good/norm.ept" "-flatten") +ADD_TEST(test_option_flatten_or_keep "scripts/test_option" "good/or_keep.ept" "-flatten") +ADD_TEST(test_option_flatten_parametrize "scripts/test_option" "good/parametrize.ept" "-flatten") +ADD_TEST(test_option_flatten_pre_tuple "scripts/test_option" "good/pre_tuple.ept" "-flatten") +ADD_TEST(test_option_flatten_reinit "scripts/test_option" "good/reinit.ept" "-flatten") +ADD_TEST(test_option_flatten_sampling_stateful_output2 "scripts/test_option" "good/sampling_stateful_output2.ept" "-flatten") +ADD_TEST(test_option_flatten_sampling_stateful_output "scripts/test_option" "good/sampling_stateful_output.ept" "-flatten") +ADD_TEST(test_option_flatten_side_effet "scripts/test_option" "good/side_effet.ept" "-flatten") +ADD_TEST(test_option_flatten_statics1 "scripts/test_option" "good/statics1.ept" "-flatten") +ADD_TEST(test_option_flatten_statics2 "scripts/test_option" "good/statics2.ept" "-flatten") +ADD_TEST(test_option_flatten_statics "scripts/test_option" "good/statics.ept" "-flatten") +ADD_TEST(test_option_flatten_t10 "scripts/test_option" "good/t10.ept" "-flatten") +ADD_TEST(test_option_flatten_t11 "scripts/test_option" "good/t11.ept" "-flatten") +ADD_TEST(test_option_flatten_t12 "scripts/test_option" "good/t12.ept" "-flatten") +ADD_TEST(test_option_flatten_t13 "scripts/test_option" "good/t13.ept" "-flatten") +ADD_TEST(test_option_flatten_t14 "scripts/test_option" "good/t14.ept" "-flatten") +ADD_TEST(test_option_flatten_t15 "scripts/test_option" "good/t15.ept" "-flatten") +ADD_TEST(test_option_flatten_t16 "scripts/test_option" "good/t16.ept" "-flatten") +ADD_TEST(test_option_flatten_t17 "scripts/test_option" "good/t17.ept" "-flatten") +ADD_TEST(test_option_flatten_t18 "scripts/test_option" "good/t18.ept" "-flatten") +ADD_TEST(test_option_flatten_t19 "scripts/test_option" "good/t19.ept" "-flatten") +ADD_TEST(test_option_flatten_t1 "scripts/test_option" "good/t1.ept" "-flatten") +ADD_TEST(test_option_flatten_t2 "scripts/test_option" "good/t2.ept" "-flatten") +ADD_TEST(test_option_flatten_t2open "scripts/test_option" "good/t2open.ept" "-flatten") +ADD_TEST(test_option_flatten_t3 "scripts/test_option" "good/t3.ept" "-flatten") +ADD_TEST(test_option_flatten_t4 "scripts/test_option" "good/t4.ept" "-flatten") +ADD_TEST(test_option_flatten_t5 "scripts/test_option" "good/t5.ept" "-flatten") +ADD_TEST(test_option_flatten_t6 "scripts/test_option" "good/t6.ept" "-flatten") +ADD_TEST(test_option_flatten_t7 "scripts/test_option" "good/t7.ept" "-flatten") +ADD_TEST(test_option_flatten_t8 "scripts/test_option" "good/t8.ept" "-flatten") +ADD_TEST(test_option_flatten_t9 "scripts/test_option" "good/t9.ept" "-flatten") +ADD_TEST(test_option_flatten_t "scripts/test_option" "good/t.ept" "-flatten") +ADD_TEST(test_option_flatten_test "scripts/test_option" "good/test.ept" "-flatten") +ADD_TEST(test_option_flatten_threestates "scripts/test_option" "good/threestates.ept" "-flatten") +ADD_TEST(test_option_flatten_tt "scripts/test_option" "good/tt.ept" "-flatten") +ADD_TEST(test_option_flatten_tttt "scripts/test_option" "good/tttt.ept" "-flatten") +ADD_TEST(test_option_flatten_tuple_args "scripts/test_option" "good/tuple_args.ept" "-flatten") +ADD_TEST(test_option_flatten_type_alias "scripts/test_option" "good/type_alias.ept" "-flatten") +ADD_TEST(test_option_flatten_updown "scripts/test_option" "good/updown.ept" "-flatten") +ADD_TEST(test_option_flatten_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-flatten") +ADD_TEST(test_option_itfusion_alloc "scripts/test_option" "good/alloc.ept" "-itfusion") +ADD_TEST(test_option_itfusion_array1 "scripts/test_option" "good/array1.ept" "-itfusion") +ADD_TEST(test_option_itfusion_array2 "scripts/test_option" "good/array2.ept" "-itfusion") +ADD_TEST(test_option_itfusion_array_fill "scripts/test_option" "good/array_fill.ept" "-itfusion") +ADD_TEST(test_option_itfusion_array_iterators2 "scripts/test_option" "good/array_iterators2.ept" "-itfusion") +ADD_TEST(test_option_itfusion_array_iterators "scripts/test_option" "good/array_iterators.ept" "-itfusion") +ADD_TEST(test_option_itfusion_array_power "scripts/test_option" "good/array_power.ept" "-itfusion") +ADD_TEST(test_option_itfusion_auto2 "scripts/test_option" "good/auto2.ept" "-itfusion") +ADD_TEST(test_option_itfusion_auto "scripts/test_option" "good/auto.ept" "-itfusion") +ADD_TEST(test_option_itfusion_autohiera2 "scripts/test_option" "good/autohiera2.ept" "-itfusion") +ADD_TEST(test_option_itfusion_autohiera "scripts/test_option" "good/autohiera.ept" "-itfusion") +ADD_TEST(test_option_itfusion_bad_updown "scripts/test_option" "good/bad_updown.ept" "-itfusion") +ADD_TEST(test_option_itfusion_ckannot "scripts/test_option" "good/ckannot.ept" "-itfusion") +ADD_TEST(test_option_itfusion_clock_causality "scripts/test_option" "good/clock_causality.ept" "-itfusion") +ADD_TEST(test_option_itfusion_clocks "scripts/test_option" "good/clocks.ept" "-itfusion") +ADD_TEST(test_option_itfusion_counter "scripts/test_option" "good/counter.ept" "-itfusion") +ADD_TEST(test_option_itfusion_current "scripts/test_option" "good/current.ept" "-itfusion") +ADD_TEST(test_option_itfusion_fbyfby2 "scripts/test_option" "good/fbyfby2.ept" "-itfusion") +ADD_TEST(test_option_itfusion_foldi "scripts/test_option" "good/foldi.ept" "-itfusion") +ADD_TEST(test_option_itfusion_format "scripts/test_option" "good/format.ept" "-itfusion") +ADD_TEST(test_option_itfusion_grosauto_clock "scripts/test_option" "good/grosauto_clock.ept" "-itfusion") +ADD_TEST(test_option_itfusion_hierarchie "scripts/test_option" "good/hierarchie.ept" "-itfusion") +ADD_TEST(test_option_itfusion_itfusion "scripts/test_option" "good/itfusion.ept" "-itfusion") +ADD_TEST(test_option_itfusion_linear_automata "scripts/test_option" "good/linear_automata.ept" "-itfusion") +ADD_TEST(test_option_itfusion_linear "scripts/test_option" "good/linear.ept" "-itfusion") +ADD_TEST(test_option_itfusion_linear_init "scripts/test_option" "good/linear_init.ept" "-itfusion") +ADD_TEST(test_option_itfusion_linear_split "scripts/test_option" "good/linear_split.ept" "-itfusion") +ADD_TEST(test_option_itfusion_linear_vars "scripts/test_option" "good/linear_vars.ept" "-itfusion") +ADD_TEST(test_option_itfusion_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-itfusion") +ADD_TEST(test_option_itfusion_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-itfusion") +ADD_TEST(test_option_itfusion_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-itfusion") +ADD_TEST(test_option_itfusion_name_clash "scripts/test_option" "good/name_clash.ept" "-itfusion") +ADD_TEST(test_option_itfusion_norm "scripts/test_option" "good/norm.ept" "-itfusion") +ADD_TEST(test_option_itfusion_or_keep "scripts/test_option" "good/or_keep.ept" "-itfusion") +ADD_TEST(test_option_itfusion_parametrize "scripts/test_option" "good/parametrize.ept" "-itfusion") +ADD_TEST(test_option_itfusion_pre_tuple "scripts/test_option" "good/pre_tuple.ept" "-itfusion") +ADD_TEST(test_option_itfusion_reinit "scripts/test_option" "good/reinit.ept" "-itfusion") +ADD_TEST(test_option_itfusion_sampling_stateful_output2 "scripts/test_option" "good/sampling_stateful_output2.ept" "-itfusion") +ADD_TEST(test_option_itfusion_sampling_stateful_output "scripts/test_option" "good/sampling_stateful_output.ept" "-itfusion") +ADD_TEST(test_option_itfusion_side_effet "scripts/test_option" "good/side_effet.ept" "-itfusion") +ADD_TEST(test_option_itfusion_statics1 "scripts/test_option" "good/statics1.ept" "-itfusion") +ADD_TEST(test_option_itfusion_statics2 "scripts/test_option" "good/statics2.ept" "-itfusion") +ADD_TEST(test_option_itfusion_statics "scripts/test_option" "good/statics.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t10 "scripts/test_option" "good/t10.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t11 "scripts/test_option" "good/t11.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t12 "scripts/test_option" "good/t12.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t13 "scripts/test_option" "good/t13.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t14 "scripts/test_option" "good/t14.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t15 "scripts/test_option" "good/t15.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t16 "scripts/test_option" "good/t16.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t17 "scripts/test_option" "good/t17.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t18 "scripts/test_option" "good/t18.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t19 "scripts/test_option" "good/t19.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t1 "scripts/test_option" "good/t1.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t2 "scripts/test_option" "good/t2.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t2open "scripts/test_option" "good/t2open.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t3 "scripts/test_option" "good/t3.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t4 "scripts/test_option" "good/t4.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t5 "scripts/test_option" "good/t5.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t6 "scripts/test_option" "good/t6.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t7 "scripts/test_option" "good/t7.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t8 "scripts/test_option" "good/t8.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t9 "scripts/test_option" "good/t9.ept" "-itfusion") +ADD_TEST(test_option_itfusion_t "scripts/test_option" "good/t.ept" "-itfusion") +ADD_TEST(test_option_itfusion_test "scripts/test_option" "good/test.ept" "-itfusion") +ADD_TEST(test_option_itfusion_threestates "scripts/test_option" "good/threestates.ept" "-itfusion") +ADD_TEST(test_option_itfusion_tt "scripts/test_option" "good/tt.ept" "-itfusion") +ADD_TEST(test_option_itfusion_tttt "scripts/test_option" "good/tttt.ept" "-itfusion") +ADD_TEST(test_option_itfusion_tuple_args "scripts/test_option" "good/tuple_args.ept" "-itfusion") +ADD_TEST(test_option_itfusion_type_alias "scripts/test_option" "good/type_alias.ept" "-itfusion") +ADD_TEST(test_option_itfusion_updown "scripts/test_option" "good/updown.ept" "-itfusion") +ADD_TEST(test_option_itfusion_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-itfusion") +ADD_TEST(test_option_memalloc_alloc "scripts/test_option" "good/alloc.ept" "-memalloc") +ADD_TEST(test_option_memalloc_array1 "scripts/test_option" "good/array1.ept" "-memalloc") +ADD_TEST(test_option_memalloc_array2 "scripts/test_option" "good/array2.ept" "-memalloc") +ADD_TEST(test_option_memalloc_array_fill "scripts/test_option" "good/array_fill.ept" "-memalloc") +ADD_TEST(test_option_memalloc_array_iterators2 "scripts/test_option" "good/array_iterators2.ept" "-memalloc") +ADD_TEST(test_option_memalloc_array_iterators "scripts/test_option" "good/array_iterators.ept" "-memalloc") +ADD_TEST(test_option_memalloc_array_power "scripts/test_option" "good/array_power.ept" "-memalloc") +ADD_TEST(test_option_memalloc_auto2 "scripts/test_option" "good/auto2.ept" "-memalloc") +ADD_TEST(test_option_memalloc_auto "scripts/test_option" "good/auto.ept" "-memalloc") +ADD_TEST(test_option_memalloc_autohiera2 "scripts/test_option" "good/autohiera2.ept" "-memalloc") +ADD_TEST(test_option_memalloc_autohiera "scripts/test_option" "good/autohiera.ept" "-memalloc") +ADD_TEST(test_option_memalloc_bad_updown "scripts/test_option" "good/bad_updown.ept" "-memalloc") +ADD_TEST(test_option_memalloc_ckannot "scripts/test_option" "good/ckannot.ept" "-memalloc") +ADD_TEST(test_option_memalloc_clock_causality "scripts/test_option" "good/clock_causality.ept" "-memalloc") +ADD_TEST(test_option_memalloc_clocks "scripts/test_option" "good/clocks.ept" "-memalloc") +ADD_TEST(test_option_memalloc_counter "scripts/test_option" "good/counter.ept" "-memalloc") +ADD_TEST(test_option_memalloc_current "scripts/test_option" "good/current.ept" "-memalloc") +ADD_TEST(test_option_memalloc_fbyfby2 "scripts/test_option" "good/fbyfby2.ept" "-memalloc") +ADD_TEST(test_option_memalloc_foldi "scripts/test_option" "good/foldi.ept" "-memalloc") +ADD_TEST(test_option_memalloc_format "scripts/test_option" "good/format.ept" "-memalloc") +ADD_TEST(test_option_memalloc_grosauto_clock "scripts/test_option" "good/grosauto_clock.ept" "-memalloc") +ADD_TEST(test_option_memalloc_hierarchie "scripts/test_option" "good/hierarchie.ept" "-memalloc") +ADD_TEST(test_option_memalloc_itfusion "scripts/test_option" "good/itfusion.ept" "-memalloc") +ADD_TEST(test_option_memalloc_linear_automata "scripts/test_option" "good/linear_automata.ept" "-memalloc") +ADD_TEST(test_option_memalloc_linear "scripts/test_option" "good/linear.ept" "-memalloc") +ADD_TEST(test_option_memalloc_linear_init "scripts/test_option" "good/linear_init.ept" "-memalloc") +ADD_TEST(test_option_memalloc_linear_split "scripts/test_option" "good/linear_split.ept" "-memalloc") +ADD_TEST(test_option_memalloc_linear_vars "scripts/test_option" "good/linear_vars.ept" "-memalloc") +ADD_TEST(test_option_memalloc_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-memalloc") +ADD_TEST(test_option_memalloc_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-memalloc") +ADD_TEST(test_option_memalloc_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-memalloc") +ADD_TEST(test_option_memalloc_name_clash "scripts/test_option" "good/name_clash.ept" "-memalloc") +ADD_TEST(test_option_memalloc_norm "scripts/test_option" "good/norm.ept" "-memalloc") +ADD_TEST(test_option_memalloc_or_keep "scripts/test_option" "good/or_keep.ept" "-memalloc") +ADD_TEST(test_option_memalloc_parametrize "scripts/test_option" "good/parametrize.ept" "-memalloc") +ADD_TEST(test_option_memalloc_pre_tuple "scripts/test_option" "good/pre_tuple.ept" "-memalloc") +ADD_TEST(test_option_memalloc_reinit "scripts/test_option" "good/reinit.ept" "-memalloc") +ADD_TEST(test_option_memalloc_sampling_stateful_output2 "scripts/test_option" "good/sampling_stateful_output2.ept" "-memalloc") +ADD_TEST(test_option_memalloc_sampling_stateful_output "scripts/test_option" "good/sampling_stateful_output.ept" "-memalloc") +ADD_TEST(test_option_memalloc_side_effet "scripts/test_option" "good/side_effet.ept" "-memalloc") +ADD_TEST(test_option_memalloc_statics1 "scripts/test_option" "good/statics1.ept" "-memalloc") +ADD_TEST(test_option_memalloc_statics2 "scripts/test_option" "good/statics2.ept" "-memalloc") +ADD_TEST(test_option_memalloc_statics "scripts/test_option" "good/statics.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t10 "scripts/test_option" "good/t10.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t11 "scripts/test_option" "good/t11.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t12 "scripts/test_option" "good/t12.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t13 "scripts/test_option" "good/t13.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t14 "scripts/test_option" "good/t14.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t15 "scripts/test_option" "good/t15.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t16 "scripts/test_option" "good/t16.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t17 "scripts/test_option" "good/t17.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t18 "scripts/test_option" "good/t18.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t19 "scripts/test_option" "good/t19.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t1 "scripts/test_option" "good/t1.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t2 "scripts/test_option" "good/t2.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t2open "scripts/test_option" "good/t2open.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t3 "scripts/test_option" "good/t3.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t4 "scripts/test_option" "good/t4.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t5 "scripts/test_option" "good/t5.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t6 "scripts/test_option" "good/t6.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t7 "scripts/test_option" "good/t7.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t8 "scripts/test_option" "good/t8.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t9 "scripts/test_option" "good/t9.ept" "-memalloc") +ADD_TEST(test_option_memalloc_t "scripts/test_option" "good/t.ept" "-memalloc") +ADD_TEST(test_option_memalloc_test "scripts/test_option" "good/test.ept" "-memalloc") +ADD_TEST(test_option_memalloc_threestates "scripts/test_option" "good/threestates.ept" "-memalloc") +ADD_TEST(test_option_memalloc_tt "scripts/test_option" "good/tt.ept" "-memalloc") +ADD_TEST(test_option_memalloc_tttt "scripts/test_option" "good/tttt.ept" "-memalloc") +ADD_TEST(test_option_memalloc_tuple_args "scripts/test_option" "good/tuple_args.ept" "-memalloc") +ADD_TEST(test_option_memalloc_type_alias "scripts/test_option" "good/type_alias.ept" "-memalloc") +ADD_TEST(test_option_memalloc_updown "scripts/test_option" "good/updown.ept" "-memalloc") +ADD_TEST(test_option_memalloc_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-memalloc") +ADD_TEST(test_option_unroll_alloc "scripts/test_option" "good/alloc.ept" "-unroll") +ADD_TEST(test_option_unroll_array1 "scripts/test_option" "good/array1.ept" "-unroll") +ADD_TEST(test_option_unroll_array2 "scripts/test_option" "good/array2.ept" "-unroll") +ADD_TEST(test_option_unroll_array_fill "scripts/test_option" "good/array_fill.ept" "-unroll") +ADD_TEST(test_option_unroll_array_iterators2 "scripts/test_option" "good/array_iterators2.ept" "-unroll") +ADD_TEST(test_option_unroll_array_iterators "scripts/test_option" "good/array_iterators.ept" "-unroll") +ADD_TEST(test_option_unroll_array_power "scripts/test_option" "good/array_power.ept" "-unroll") +ADD_TEST(test_option_unroll_auto2 "scripts/test_option" "good/auto2.ept" "-unroll") +ADD_TEST(test_option_unroll_auto "scripts/test_option" "good/auto.ept" "-unroll") +ADD_TEST(test_option_unroll_autohiera2 "scripts/test_option" "good/autohiera2.ept" "-unroll") +ADD_TEST(test_option_unroll_autohiera "scripts/test_option" "good/autohiera.ept" "-unroll") +ADD_TEST(test_option_unroll_bad_updown "scripts/test_option" "good/bad_updown.ept" "-unroll") +ADD_TEST(test_option_unroll_ckannot "scripts/test_option" "good/ckannot.ept" "-unroll") +ADD_TEST(test_option_unroll_clock_causality "scripts/test_option" "good/clock_causality.ept" "-unroll") +ADD_TEST(test_option_unroll_clocks "scripts/test_option" "good/clocks.ept" "-unroll") +ADD_TEST(test_option_unroll_counter "scripts/test_option" "good/counter.ept" "-unroll") +ADD_TEST(test_option_unroll_current "scripts/test_option" "good/current.ept" "-unroll") +ADD_TEST(test_option_unroll_fbyfby2 "scripts/test_option" "good/fbyfby2.ept" "-unroll") +ADD_TEST(test_option_unroll_foldi "scripts/test_option" "good/foldi.ept" "-unroll") +ADD_TEST(test_option_unroll_format "scripts/test_option" "good/format.ept" "-unroll") +ADD_TEST(test_option_unroll_grosauto_clock "scripts/test_option" "good/grosauto_clock.ept" "-unroll") +ADD_TEST(test_option_unroll_hierarchie "scripts/test_option" "good/hierarchie.ept" "-unroll") +ADD_TEST(test_option_unroll_itfusion "scripts/test_option" "good/itfusion.ept" "-unroll") +ADD_TEST(test_option_unroll_linear_automata "scripts/test_option" "good/linear_automata.ept" "-unroll") +ADD_TEST(test_option_unroll_linear "scripts/test_option" "good/linear.ept" "-unroll") +ADD_TEST(test_option_unroll_linear_init "scripts/test_option" "good/linear_init.ept" "-unroll") +ADD_TEST(test_option_unroll_linear_split "scripts/test_option" "good/linear_split.ept" "-unroll") +ADD_TEST(test_option_unroll_linear_vars "scripts/test_option" "good/linear_vars.ept" "-unroll") +ADD_TEST(test_option_unroll_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-unroll") +ADD_TEST(test_option_unroll_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-unroll") +ADD_TEST(test_option_unroll_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-unroll") +ADD_TEST(test_option_unroll_name_clash "scripts/test_option" "good/name_clash.ept" "-unroll") +ADD_TEST(test_option_unroll_norm "scripts/test_option" "good/norm.ept" "-unroll") +ADD_TEST(test_option_unroll_or_keep "scripts/test_option" "good/or_keep.ept" "-unroll") +ADD_TEST(test_option_unroll_parametrize "scripts/test_option" "good/parametrize.ept" "-unroll") +ADD_TEST(test_option_unroll_pre_tuple "scripts/test_option" "good/pre_tuple.ept" "-unroll") +ADD_TEST(test_option_unroll_reinit "scripts/test_option" "good/reinit.ept" "-unroll") +ADD_TEST(test_option_unroll_sampling_stateful_output2 "scripts/test_option" "good/sampling_stateful_output2.ept" "-unroll") +ADD_TEST(test_option_unroll_sampling_stateful_output "scripts/test_option" "good/sampling_stateful_output.ept" "-unroll") +ADD_TEST(test_option_unroll_side_effet "scripts/test_option" "good/side_effet.ept" "-unroll") +ADD_TEST(test_option_unroll_statics1 "scripts/test_option" "good/statics1.ept" "-unroll") +ADD_TEST(test_option_unroll_statics2 "scripts/test_option" "good/statics2.ept" "-unroll") +ADD_TEST(test_option_unroll_statics "scripts/test_option" "good/statics.ept" "-unroll") +ADD_TEST(test_option_unroll_t10 "scripts/test_option" "good/t10.ept" "-unroll") +ADD_TEST(test_option_unroll_t11 "scripts/test_option" "good/t11.ept" "-unroll") +ADD_TEST(test_option_unroll_t12 "scripts/test_option" "good/t12.ept" "-unroll") +ADD_TEST(test_option_unroll_t13 "scripts/test_option" "good/t13.ept" "-unroll") +ADD_TEST(test_option_unroll_t14 "scripts/test_option" "good/t14.ept" "-unroll") +ADD_TEST(test_option_unroll_t15 "scripts/test_option" "good/t15.ept" "-unroll") +ADD_TEST(test_option_unroll_t16 "scripts/test_option" "good/t16.ept" "-unroll") +ADD_TEST(test_option_unroll_t17 "scripts/test_option" "good/t17.ept" "-unroll") +ADD_TEST(test_option_unroll_t18 "scripts/test_option" "good/t18.ept" "-unroll") +ADD_TEST(test_option_unroll_t19 "scripts/test_option" "good/t19.ept" "-unroll") +ADD_TEST(test_option_unroll_t1 "scripts/test_option" "good/t1.ept" "-unroll") +ADD_TEST(test_option_unroll_t2 "scripts/test_option" "good/t2.ept" "-unroll") +ADD_TEST(test_option_unroll_t2open "scripts/test_option" "good/t2open.ept" "-unroll") +ADD_TEST(test_option_unroll_t3 "scripts/test_option" "good/t3.ept" "-unroll") +ADD_TEST(test_option_unroll_t4 "scripts/test_option" "good/t4.ept" "-unroll") +ADD_TEST(test_option_unroll_t5 "scripts/test_option" "good/t5.ept" "-unroll") +ADD_TEST(test_option_unroll_t6 "scripts/test_option" "good/t6.ept" "-unroll") +ADD_TEST(test_option_unroll_t7 "scripts/test_option" "good/t7.ept" "-unroll") +ADD_TEST(test_option_unroll_t8 "scripts/test_option" "good/t8.ept" "-unroll") +ADD_TEST(test_option_unroll_t9 "scripts/test_option" "good/t9.ept" "-unroll") +ADD_TEST(test_option_unroll_t "scripts/test_option" "good/t.ept" "-unroll") +ADD_TEST(test_option_unroll_test "scripts/test_option" "good/test.ept" "-unroll") +ADD_TEST(test_option_unroll_threestates "scripts/test_option" "good/threestates.ept" "-unroll") +ADD_TEST(test_option_unroll_tt "scripts/test_option" "good/tt.ept" "-unroll") +ADD_TEST(test_option_unroll_tttt "scripts/test_option" "good/tttt.ept" "-unroll") +ADD_TEST(test_option_unroll_tuple_args "scripts/test_option" "good/tuple_args.ept" "-unroll") +ADD_TEST(test_option_unroll_type_alias "scripts/test_option" "good/type_alias.ept" "-unroll") +ADD_TEST(test_option_unroll_updown "scripts/test_option" "good/updown.ept" "-unroll") +ADD_TEST(test_option_unroll_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-unroll") +ADD_TEST(test_option_O_alloc "scripts/test_option" "good/alloc.ept" "-O") +ADD_TEST(test_option_O_array1 "scripts/test_option" "good/array1.ept" "-O") +ADD_TEST(test_option_O_array2 "scripts/test_option" "good/array2.ept" "-O") +ADD_TEST(test_option_O_array_fill "scripts/test_option" "good/array_fill.ept" "-O") +ADD_TEST(test_option_O_array_iterators2 "scripts/test_option" "good/array_iterators2.ept" "-O") +ADD_TEST(test_option_O_array_iterators "scripts/test_option" "good/array_iterators.ept" "-O") +ADD_TEST(test_option_O_array_power "scripts/test_option" "good/array_power.ept" "-O") +ADD_TEST(test_option_O_auto2 "scripts/test_option" "good/auto2.ept" "-O") +ADD_TEST(test_option_O_auto "scripts/test_option" "good/auto.ept" "-O") +ADD_TEST(test_option_O_autohiera2 "scripts/test_option" "good/autohiera2.ept" "-O") +ADD_TEST(test_option_O_autohiera "scripts/test_option" "good/autohiera.ept" "-O") +ADD_TEST(test_option_O_bad_updown "scripts/test_option" "good/bad_updown.ept" "-O") +ADD_TEST(test_option_O_ckannot "scripts/test_option" "good/ckannot.ept" "-O") +ADD_TEST(test_option_O_clock_causality "scripts/test_option" "good/clock_causality.ept" "-O") +ADD_TEST(test_option_O_clocks "scripts/test_option" "good/clocks.ept" "-O") +ADD_TEST(test_option_O_counter "scripts/test_option" "good/counter.ept" "-O") +ADD_TEST(test_option_O_current "scripts/test_option" "good/current.ept" "-O") +ADD_TEST(test_option_O_fbyfby2 "scripts/test_option" "good/fbyfby2.ept" "-O") +ADD_TEST(test_option_O_foldi "scripts/test_option" "good/foldi.ept" "-O") +ADD_TEST(test_option_O_format "scripts/test_option" "good/format.ept" "-O") +ADD_TEST(test_option_O_grosauto_clock "scripts/test_option" "good/grosauto_clock.ept" "-O") +ADD_TEST(test_option_O_hierarchie "scripts/test_option" "good/hierarchie.ept" "-O") +ADD_TEST(test_option_O_itfusion "scripts/test_option" "good/itfusion.ept" "-O") +ADD_TEST(test_option_O_linear_automata "scripts/test_option" "good/linear_automata.ept" "-O") +ADD_TEST(test_option_O_linear "scripts/test_option" "good/linear.ept" "-O") +ADD_TEST(test_option_O_linear_init "scripts/test_option" "good/linear_init.ept" "-O") +ADD_TEST(test_option_O_linear_split "scripts/test_option" "good/linear_split.ept" "-O") +ADD_TEST(test_option_O_linear_vars "scripts/test_option" "good/linear_vars.ept" "-O") +ADD_TEST(test_option_O_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-O") +ADD_TEST(test_option_O_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-O") +ADD_TEST(test_option_O_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-O") +ADD_TEST(test_option_O_name_clash "scripts/test_option" "good/name_clash.ept" "-O") +ADD_TEST(test_option_O_norm "scripts/test_option" "good/norm.ept" "-O") +ADD_TEST(test_option_O_or_keep "scripts/test_option" "good/or_keep.ept" "-O") +ADD_TEST(test_option_O_parametrize "scripts/test_option" "good/parametrize.ept" "-O") +ADD_TEST(test_option_O_pre_tuple "scripts/test_option" "good/pre_tuple.ept" "-O") +ADD_TEST(test_option_O_reinit "scripts/test_option" "good/reinit.ept" "-O") +ADD_TEST(test_option_O_sampling_stateful_output2 "scripts/test_option" "good/sampling_stateful_output2.ept" "-O") +ADD_TEST(test_option_O_sampling_stateful_output "scripts/test_option" "good/sampling_stateful_output.ept" "-O") +ADD_TEST(test_option_O_side_effet "scripts/test_option" "good/side_effet.ept" "-O") +ADD_TEST(test_option_O_statics1 "scripts/test_option" "good/statics1.ept" "-O") +ADD_TEST(test_option_O_statics2 "scripts/test_option" "good/statics2.ept" "-O") +ADD_TEST(test_option_O_statics "scripts/test_option" "good/statics.ept" "-O") +ADD_TEST(test_option_O_t10 "scripts/test_option" "good/t10.ept" "-O") +ADD_TEST(test_option_O_t11 "scripts/test_option" "good/t11.ept" "-O") +ADD_TEST(test_option_O_t12 "scripts/test_option" "good/t12.ept" "-O") +ADD_TEST(test_option_O_t13 "scripts/test_option" "good/t13.ept" "-O") +ADD_TEST(test_option_O_t14 "scripts/test_option" "good/t14.ept" "-O") +ADD_TEST(test_option_O_t15 "scripts/test_option" "good/t15.ept" "-O") +ADD_TEST(test_option_O_t16 "scripts/test_option" "good/t16.ept" "-O") +ADD_TEST(test_option_O_t17 "scripts/test_option" "good/t17.ept" "-O") +ADD_TEST(test_option_O_t18 "scripts/test_option" "good/t18.ept" "-O") +ADD_TEST(test_option_O_t19 "scripts/test_option" "good/t19.ept" "-O") +ADD_TEST(test_option_O_t1 "scripts/test_option" "good/t1.ept" "-O") +ADD_TEST(test_option_O_t2 "scripts/test_option" "good/t2.ept" "-O") +ADD_TEST(test_option_O_t2open "scripts/test_option" "good/t2open.ept" "-O") +ADD_TEST(test_option_O_t3 "scripts/test_option" "good/t3.ept" "-O") +ADD_TEST(test_option_O_t4 "scripts/test_option" "good/t4.ept" "-O") +ADD_TEST(test_option_O_t5 "scripts/test_option" "good/t5.ept" "-O") +ADD_TEST(test_option_O_t6 "scripts/test_option" "good/t6.ept" "-O") +ADD_TEST(test_option_O_t7 "scripts/test_option" "good/t7.ept" "-O") +ADD_TEST(test_option_O_t8 "scripts/test_option" "good/t8.ept" "-O") +ADD_TEST(test_option_O_t9 "scripts/test_option" "good/t9.ept" "-O") +ADD_TEST(test_option_O_t "scripts/test_option" "good/t.ept" "-O") +ADD_TEST(test_option_O_test "scripts/test_option" "good/test.ept" "-O") +ADD_TEST(test_option_O_threestates "scripts/test_option" "good/threestates.ept" "-O") +ADD_TEST(test_option_O_tt "scripts/test_option" "good/tt.ept" "-O") +ADD_TEST(test_option_O_tttt "scripts/test_option" "good/tttt.ept" "-O") +ADD_TEST(test_option_O_tuple_args "scripts/test_option" "good/tuple_args.ept" "-O") +ADD_TEST(test_option_O_type_alias "scripts/test_option" "good/type_alias.ept" "-O") +ADD_TEST(test_option_O_updown "scripts/test_option" "good/updown.ept" "-O") +ADD_TEST(test_option_O_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-O") diff --git a/test/bad/side_effect.ept b/test/bad/side_effect.ept new file mode 100644 index 0000000..55ff050 --- /dev/null +++ b/test/bad/side_effect.ept @@ -0,0 +1,16 @@ +(* This fails: the nodes should be declared as "unsafe" (because of side effect) *) +node hello() returns (b:bool) +let + () = Iostream.printf("hello\n"); + automaton + state A do + b = true; + () = Iostream.printf("hello\n"); + end; +tel + +node main() returns () +var b:bool; +let + b = hello(); +tel diff --git a/test/gen_ctests b/test/gen_ctests index 62191d8..a4202e1 100755 --- a/test/gen_ctests +++ b/test/gen_ctests @@ -13,3 +13,21 @@ for i in good/*.ept; do 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" diff --git a/test/good/statics1.ept b/test/good/statics1.ept new file mode 100644 index 0000000..8b2c137 --- /dev/null +++ b/test/good/statics1.ept @@ -0,0 +1,35 @@ +(* Check manually *) +(* This test should only create two instances of f. *) +const c:int = 3 +const k:int = 1 + +fun f<>() returns (y:int) +let + y = n + 3 + c; +tel + +fun g<>() returns (y:int) +var x:int; +let + x = m + f<<2>>(); + y = f<>(); +tel + +fun i<>() returns (o : int) +var x, y, z: int; +let + x = f<<2>>(); + y = f<<1 + m>>(); + z = f<>(); + o = f<>(); +tel + +fun h() returns (y:int) +let + y = c + g<>() + i<>(); +tel + +node main() returns (y:int) +let + y = h() +tel diff --git a/test/good/statics2.ept b/test/good/statics2.ept index 36967d5..7ffd3b8 100644 --- a/test/good/statics2.ept +++ b/test/good/statics2.ept @@ -27,7 +27,7 @@ tel fun h() returns (y,y2:int) let y = c2 + g<>() + i<>(); - y2 = c2 + Statics.g<>() + Statics.i<>(); + y2 = c2 + Statics1.g<>() + Statics1.i<>(); tel node main() returns (y,y2:int) diff --git a/test/scripts/compile_gcc_run b/test/scripts/compile_gcc_run index e01ab01..b3d07f3 100755 --- a/test/scripts/compile_gcc_run +++ b/test/scripts/compile_gcc_run @@ -36,15 +36,15 @@ if [[ ($heptroot == "t2") || ($heptroot == "t2open") ]]; then LD="$LD ../t1_c/[^_]*.o" fi -# Special case: statics2 needs statics +# Special case: statics2 needs statics1 -if [[ ($heptroot == "statics") ]]; then +if [[ ($heptroot == "statics1") ]]; then coption="$coption -c" fi if [[ ($heptroot == "statics2") ]]; then - CC="$CC -I ../statics_c" - LD="$LD ../statics_c/[^_]*.o" + CC="$CC -I ../statics1_c" + LD="$LD ../statics1_c/[^_]*.o" fi diff --git a/test/scripts/config b/test/scripts/config index d8a4746..7f4d6a7 100644 --- a/test/scripts/config +++ b/test/scripts/config @@ -10,7 +10,13 @@ if [ -x $COMPILER_DIR/heptc.native ]; then COMPILER=heptc.native else - COMPILER=heptc.byte + if [ -x $COMPILER_DIR/heptc.byte ]; + then + COMPILER=heptc.byte + else + echo "Error: no compiler found." + exit 2 + fi fi HEPTC="../$COMPILER_DIR/$COMPILER -stdlib ../../lib" diff --git a/test/scripts/test_option b/test/scripts/test_option new file mode 100755 index 0000000..ba9a68b --- /dev/null +++ b/test/scripts/test_option @@ -0,0 +1,129 @@ +#!/bin/bash + +# Test script: compile and run program $1 with option $2, and compare +# output with the run without option + +source scripts/config + +progpath=$1 +testingoption=$2 +shift +shift +coption="-target c $*" + +# run the program: no by default +run=0 + +cp $progpath $checkdir + + +pushd $checkdir > /dev/null + +heptprog=`basename $progpath` +heptroot=`basename $heptprog .ept` + +assert_node=$(eval grep CHECK $heptprog | awk '{ print $3 }') + +if [ -n "$assert_node" ]; then + coption="$coption -assert $assert_node" + run=1 +fi + +if grep "node main()" $heptprog >/dev/null; then + coption="$coption -hepts -s main" + run=1 +fi + +# Special case: t2 and t2open needs t1 + +if [[ ($heptroot == "t2") || ($heptroot == "t2open") ]]; then + CC="$CC -I ../t1_c" + LD="$LD ../t1_c/[^_]*.o" +fi + +# Special case: statics2 needs statics1 + +if [[ ($heptroot == "statics1") ]]; then + coption="$coption -c" +fi + +if [[ ($heptroot == "statics2") ]]; then + CC="$CC -I ../statics1_c" + LD="$LD ../statics1_c/[^_]*.o" +fi + +# Usage: compile "option" "comment" "output_file_name" +function compile () { + + option=$1 + comment=$2 + outputfilename=$3 + + echo $HEPTC $coption $option $heptprog + if $HEPTC $coption $option $heptprog; then + pushd ${heptroot}_c > /dev/null + echo $CC -c *.c + if $CC -c *.c; then + if [[ $run == 1 ]]; then + echo $LD *.o -o main + if $LD *.o -o main; then + echo ./main $NBSTEP | tee ../${outputfilename} + if ./main $NBSTEP | tee ../${outputfilename}; then + echo "Run (${comment}) successful." + res=0 + else + echo "Run (${comment}) failed." + res=1 + fi + else + echo "Link edition (${comment}) failed." + res=1 + fi + else + res=0 + fi + else + echo "Compilation of C target code (${comment}) failed" + res=1 + fi + popd >/dev/null + else + echo "Compilation of $heptprog (${comment}) failed" + res=1 + fi + +} + +# Compile and run without option + +output_without_option="${heptroot}_output_without_option" + +compile "" "without option" "$output_without_option" + +# Compile and run with option + +output_with_option="${heptroot}_output_with_option" + +compile "$testingoption" "with option $testingoption" "$output_with_option" + + +if [[ $res == 0 ]]; then + if [[ $run == 1 ]]; then + # Compare the outputs + echo diff -b $output_without_option $output_with_option + if diff -b $output_without_option $output_with_option; then + # No difference + echo "Test successful." + res=0 + else + echo "Test failed: outputs are different." + res=1 + fi + else + echo "Test successful (compilation only)." + fi +fi + +popd > /dev/null + +exit $res