Skip to content

Commit

Permalink
Made a number of improvements to the test scripts.
Browse files Browse the repository at this point in the history
Added a hack to the build_all script for the case of
building with Clang on Ubuntu.
  • Loading branch information
mdadams committed Nov 5, 2022
1 parent e54c638 commit ec4d022
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 34 deletions.
20 changes: 10 additions & 10 deletions build/build_all
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ if [ -n "$RUNNER_OS" ]; then
esac
fi
fi
ubuntu_clang_hack=0
#ubuntu_clang_hack=0

################################################################################

Expand Down Expand Up @@ -400,18 +400,18 @@ if [ "${#tests[@]}" -eq 0 ]; then
tests=()

# debug builds
if [ "$ubuntu_clang_hack" -eq 0 ]; then
tests+=(static_debug_mt0)
tests+=(static_debug_mt1)
tests+=(static_debug_ji_mt0)
tests+=(static_debug_ji_mt1)
tests+=(tsan)
fi
#if [ "$ubuntu_clang_hack" -eq 0 ]; then
#fi
tests+=(static_debug_mt0)
tests+=(static_debug_mt1)
tests+=(static_debug_ji_mt0)
tests+=(static_debug_ji_mt1)
tests+=(tsan)

# release builds
tests+=(shared_release_mt0)
tests+=(shared_release_mt1)
if [ "$ubuntu_clang_hack" -eq 0 ]; then
tests+=(shared_release_mt0)
tests+=(shared_release_mt1)
tests+=(static_release_mt0)
tests+=(static_release_mt1)
fi
Expand Down
6 changes: 4 additions & 2 deletions test/bin/run_test_1
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ fi

################################################################################

has_jpg="$(is_supported_format jpg)" || panic
has_mif="$(is_supported_format mif)" || panic
has_jpg="$(is_supported_format jpg)" || \
panic "cannot determine if JPG is supported format"
has_mif="$(is_supported_format mif)" || \
panic "cannot determine if MIF is supported format"

if [ "$internal_testing_mode" -ne 0 -a "$has_mif" -eq 0 ]; then
echo "warning: MIF support is missing"
Expand Down
6 changes: 4 additions & 2 deletions test/bin/run_test_2
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ debug=0

image_path="$data_dir/images"

has_jpg=$(is_supported_format jpg) || panic
has_mif=$(is_supported_format mif) || panic
has_jpg=$(is_supported_format jpg) || \
panic "cannot determine if JPG is supported format"
has_mif=$(is_supported_format mif) || \
panic "cannot determine if MIF is supported format"

in_files=()
#in_files+=(feep2.pnm)
Expand Down
15 changes: 8 additions & 7 deletions test/bin/run_test_5
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ tmp_dir=$(make_tmp_dir)

log_file=$tmp_dir/log

# TODO: replace this with is_supported_format
"$jasper_program" --list-enabled-formats | grep -q jpg
if [ $? -eq 0 ]; then
has_jpg_codec=1
else
has_jpg_codec=0
fi
has_jpg_codec="$(is_supported_format jpg)" || \
panic "cannot determine if JPG is supported format"
#"$jasper_program" --list-enabled-formats | grep -q jpg
#if [ $? -eq 0 ]; then
# has_jpg_codec=1
#else
# has_jpg_codec=0
#fi

echo "supports JPEG codec: $has_jpg_codec"

Expand Down
22 changes: 9 additions & 13 deletions test/bin/run_test_imginfo
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,24 @@ fi

################################################################################

is_supported_format()
{
local format="$1"
local supported=0
"$jasper" --list-enabled-formats | grep -q '^'"$format"'$' && supported=1
echo "$supported"
}

formats=($("$jasper" --list-enabled-formats)) || \
formats=($("$jasper" --enable-all-formats --list-enabled-formats)) || \
panic "cannot get supported formats"
if [ "$verbose" -ge 2 ]; then
echo "The following formats are supported:"
for format in "${formats[@]}"; do
echo " $format"
done
fi
has_jpg=$(is_supported_format jpg) || panic "cannot check if JPG supported"
has_mif=$(is_supported_format mif) || panic "cannot check if MIF supported"
#has_png=$(is_supported_format png) || panic "cannot check if PNG supported"
has_jpg=$(is_supported_format jpg) || \
panic "cannot determine if JPG is supported format"
has_mif=$(is_supported_format mif) || \
panic "cannot determine if MIF is supported format"
has_png=$(is_supported_format png) || \
panic "cannot determine if PNG is supported format"
if [ "$verbose" -ge 1 ]; then
echo "JPG: $has_jpg"
echo "MIF: $has_mif"
#echo "PNG: $has_png"
echo "PNG: $has_png"
fi

failed_tests=()
Expand Down Expand Up @@ -100,6 +95,7 @@ while IFS= read -r line; do
fi

imginfo_options=()
imginfo_options+=(--enable-all-formats)
if [ -n "$imginfo_debug_level" ]; then
imginfo_options+=(--debug-level "$imginfo_debug_level")
fi
Expand Down

0 comments on commit ec4d022

Please sign in to comment.