diff --git a/test/bin/run_conformance_tests b/test/bin/run_conformance_tests index da84d8bd..c957e229 100755 --- a/test/bin/run_conformance_tests +++ b/test/bin/run_conformance_tests @@ -364,8 +364,8 @@ if [ "$enable_jasper_tests" -ne 0 ]; then fi if [ "$verbose" -ge 3 ]; then - python -c 'print("*" * 80)' cat <<- EOF + $(repeat_string 80 '*') test case ID: $testcase encoded file: $enc_file reference file: $orig_file @@ -373,8 +373,8 @@ if [ "$enable_jasper_tests" -ne 0 ]; then number of components: $num_comps size: $width $height precision: $prec + $(repeat_string 80 '*') EOF - python -c 'print("*" * 80)' fi buffer=$("$imginfo" -q < "$enc_file" 2> /dev/null) diff --git a/test/bin/utilities b/test/bin/utilities index c14cd456..1bbbed06 100644 --- a/test/bin/utilities +++ b/test/bin/utilities @@ -5,18 +5,18 @@ # ################################################################################ -function panic() +panic() { echo "ERROR: $@" 1>&2 exit 1 } -function eecho() +eecho() { echo "$@" 1>&2 } -function set_source_and_build_dirs() +set_source_and_build_dirs() { #eecho "JAS_ABS_TOP_BUILDDIR $JAS_ABS_TOP_BUILDDIR" #eecho "JAS_TOP_BUILDDIR $JAS_TOP_BUILDDIR" @@ -36,7 +36,7 @@ function set_source_and_build_dirs() #eecho "top_srcdir=$top_srcdir" } -function get_tmp_dir() +get_tmp_dir() { local package="jasper" if [ $# -ne 1 ]; then @@ -46,7 +46,7 @@ function get_tmp_dir() echo "/tmp/$package-$USER@$HOSTNAME/$name-$$" } -function make_tmp_dir() +make_tmp_dir() { local name if [ $# -ge 1 ]; then @@ -62,7 +62,7 @@ function make_tmp_dir() echo "$tmp_dir" } -function make_tmp_dir_2() +make_tmp_dir_2() { [ $# -eq 1 ] || return 1 local template="$1" @@ -75,7 +75,7 @@ function make_tmp_dir_2() # Image characteristics. ################################################################################ -function image_which() +image_which() { if [ $# -ne 2 ]; then return 2 @@ -94,7 +94,7 @@ function image_which() echo "$file" } -function image_info() +image_info() { #eecho "IMGINFO_COMMAND $IMGINFO_COMMAND" if [ $# -ne 2 ]; then @@ -234,7 +234,7 @@ tcf_gettestids() eval declare -g -a "$name"=\("$buffer"\) } -function evaluate_expression() +evaluate_expression() { [ $# -eq 1 ] || return 1 local expr="$1" @@ -252,3 +252,15 @@ is_supported_format() grep -q '^'"$format"'$' && supported=1 echo "$supported" } + +repeat_string() +{ + [ $# -eq 2 ] || return 1 + local n="$1" + local string="$2" + local buffer= + for((i = 0; i < $n; ++i)); do + buffer="$buffer$string" + done + echo "$buffer" +}