Reduced some code duplicity.
This commit is contained in:
parent
2a31033738
commit
a1b35c44ac
|
@ -265,6 +265,12 @@ do_compare () {
|
||||||
DEBUG printf "do_compare()\n"
|
DEBUG printf "do_compare()\n"
|
||||||
DEBUG echo orig dir: "$_orig_dir"
|
DEBUG echo orig dir: "$_orig_dir"
|
||||||
DEBUG echo dest dir: "$_dest_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
|
# This will compare files in 'orig' folder with files in _dest_dir
|
||||||
if [ $comp_unavail -ne 0 ]
|
if [ $comp_unavail -ne 0 ]
|
||||||
then
|
then
|
||||||
|
@ -288,7 +294,7 @@ do_compare () {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local files_list=
|
local files_list=
|
||||||
for test_name in $*
|
for test_name in $_test_name
|
||||||
do
|
do
|
||||||
rm "$_dest_dir"/comp_"$test_name"_[0-9]*.png &> /dev/null
|
rm "$_dest_dir"/comp_"$test_name"_[0-9]*.png &> /dev/null
|
||||||
files_list=( `ls "$_dest_dir"/"$test_name"_[0-9]*.png` )
|
files_list=( `ls "$_dest_dir"/"$test_name"_[0-9]*.png` )
|
||||||
|
@ -343,6 +349,22 @@ name_in_args () {
|
||||||
return 0
|
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
|
# Script Entry Point
|
||||||
OUR_LIBPATH="@libdir@/exactness"
|
OUR_LIBPATH="@libdir@/exactness"
|
||||||
|
|
||||||
|
@ -508,53 +530,17 @@ fi
|
||||||
|
|
||||||
if [ "$_record" ]
|
if [ "$_record" ]
|
||||||
then
|
then
|
||||||
while read curline;
|
for_test_in_test_file_do do_record
|
||||||
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"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$_play" ]
|
if [ "$_play" ]
|
||||||
then
|
then
|
||||||
while read curline;
|
for_test_in_test_file_do do_play
|
||||||
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"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$_compare" ]
|
if [ "$_compare" ]
|
||||||
then
|
then
|
||||||
while read curline;
|
for_test_in_test_file_do do_compare
|
||||||
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"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_n_tests_failed=0
|
_n_tests_failed=0
|
||||||
|
|
Loading…
Reference in New Issue