diff --git a/src/scripts/exactness.in b/src/scripts/exactness.in index 85ef78a..fa37e5c 100755 --- a/src/scripts/exactness.in +++ b/src/scripts/exactness.in @@ -265,6 +265,12 @@ do_compare () { DEBUG printf "do_compare()\n" DEBUG echo orig dir: "$_orig_dir" DEBUG echo dest dir: "$_dest_dir" + + get_test_params "$1" + if [ $? -ne 0 ]; then + return 0; + fi + # This will compare files in 'orig' folder with files in _dest_dir if [ $comp_unavail -ne 0 ] then @@ -288,7 +294,7 @@ do_compare () { fi local files_list= - for test_name in $* + for test_name in $_test_name do rm "$_dest_dir"/comp_"$test_name"_[0-9]*.png &> /dev/null files_list=( `ls "$_dest_dir"/"$test_name"_[0-9]*.png` ) @@ -343,6 +349,22 @@ name_in_args () { return 0 } +for_test_in_test_file_do () { + while read curline; + do + name_in_args "$curline" $* + _run_test=$(( $? + $_test_all )) + if [ $_run_test -ne 0 ] + then + $1 "$curline" + if [ $? -ne 0 ] + then + (( _n_exe_err++ )) + fi + fi + done < "$_test_file_name" +} + # Script Entry Point OUR_LIBPATH="@libdir@/exactness" @@ -508,53 +530,17 @@ fi if [ "$_record" ] then - while read curline; - do - name_in_args "$curline" $* - _run_test=$(( $? + $_test_all )) - if [ $_run_test -ne 0 ] - then - do_record "$curline" - if [ $? -ne 0 ] - then - (( _n_exe_err++ )) - fi - fi - done < "$_test_file_name" + for_test_in_test_file_do do_record fi if [ "$_play" ] then - while read curline; - do - name_in_args "$curline" $* - _run_test=$(( $? + $_test_all )) - if [ $_run_test -ne 0 ] - then - do_play "$curline" - if [ $? -ne 0 ] - then - (( _n_exe_err++ )) - fi - fi - done < "$_test_file_name" + for_test_in_test_file_do do_play fi if [ "$_compare" ] then - while read curline; - do - name_in_args "$curline" $* - _run_test=$(( $? + $_test_all )) - if [ $_run_test -ne 0 ] - then - get_test_params "$curline" - if [ $? -eq 0 ] - then - do_compare "$_test_name" - fi - fi - done < "$_test_file_name" + for_test_in_test_file_do do_compare fi _n_tests_failed=0