diff --git a/build/build b/build/build index 8f4131aa..023d185e 100755 --- a/build/build +++ b/build/build @@ -85,6 +85,7 @@ usage() program_dir=$(dirname "$0") || exit 1 jas_realpath="$program_dir/jas_realpath" abs_program_dir=$("$jas_realpath" "$program_dir") || panic +sysinfo_program="$program_dir/sysinfo" ################################################################################ # Process command line. @@ -395,6 +396,16 @@ if [ -z "$os" ]; then fi fi +sysinfo_data="$("$sysinfo_program" -a)" || \ + panic "cannot get system information" +cat <<- EOF +================================================================================ +System Information +$sysinfo_data +================================================================================ +EOF +[ $? -eq 0 ] || panic "cat failed" + ################################################################################ # Apply some platform-specific hacks. ################################################################################ diff --git a/build/build_all b/build/build_all index e7d5f68e..56031950 100755 --- a/build/build_all +++ b/build/build_all @@ -10,6 +10,7 @@ program_dir=$(dirname "$0") || exit 1 jas_realpath="$program_dir/jas_realpath" abs_program_dir=$("$jas_realpath" "$program_dir") || panic build_program="$program_dir/build" +sysinfo_program="$program_dir/sysinfo" list_directory() { @@ -284,6 +285,15 @@ if [ -n "$command_file" ]; then source "$command_file" || panic "source failed" fi +sysinfo_data="$("$sysinfo_program" -a)" || \ + panic "cannot get system information" +cat <<- EOF +================================================================================ +System Information +$sysinfo_data +================================================================================ +EOF + os=unknown if [ -n "$RUNNER_OS" ]; then case "$RUNNER_OS" in diff --git a/build/sysinfo b/build/sysinfo new file mode 100755 index 00000000..d758b333 --- /dev/null +++ b/build/sysinfo @@ -0,0 +1,79 @@ +#! /usr/bin/env bash + +panic() +{ + echo "ERROR: $@" 1>&2 + exit 1 +} + +eecho() +{ + echo "$@" 1>&2 +} + +all_keys=(os kernel release) +verbose=0 +keys=() + +while getopts avork option; do + case "$option" in + a) + keys=("${all_keys[@]}");; + v) + verbose=$((verbose + 1));; + o) + keys+=(os);; + k) + keys+=(kernel);; + r) + keys+=(release);; + \?) + panic "invalid option $option" + break;; + esac +done +shift $((OPTIND - 1)) + +if [ "${#keys[@]}" -eq 0 ]; then + exit 0 +fi + +release="$(uname -r)" || panic +kernel="$(uname)" || panic + +if [ "$verbose" -ge 1 ]; then + eecho "uname $name" + eecho "uname -r $release" +fi + +os= + +case "$release" in +*[Mm]icrosoft*) + os=windows;; +esac + +if [ -z "$os" ]; then + case "$kernel" in + *[Ll]inux*) + os=linux;; + esac +fi + +if [ -z "$os" ]; then + os=unknown +fi + +for key in "${keys[@]}"; do + case "$key" in + os) + value="$os";; + kernel) + value="$kernel";; + release) + value="$release";; + *) + panic;; + esac + echo "$value" || panic +done diff --git a/src/libjasper/jpc/jpc_enc.c b/src/libjasper/jpc/jpc_enc.c index 38659e2f..64f8aa51 100644 --- a/src/libjasper/jpc/jpc_enc.c +++ b/src/libjasper/jpc/jpc_enc.c @@ -1271,10 +1271,11 @@ assert(jas_image_numcmpts(enc->image) == 3); } #if 0 - jas_eprintf("mingbits %d\n", mingbits); + jas_eprintf("numgbits %d mingbits %d\n", cp->tccp.numgbits, + mingbits); #endif if (mingbits > cp->tccp.numgbits) { - jas_logerrorf("error: too few guard bits (%d not < %d)\n", + jas_logerrorf("error: too few guard bits (%d < %d)\n", cp->tccp.numgbits, mingbits); return -1; } diff --git a/test/bin/run_codec_test b/test/bin/run_codec_test index 8bf59773..826a9df4 100755 --- a/test/bin/run_codec_test +++ b/test/bin/run_codec_test @@ -61,8 +61,9 @@ tests=() enc=jasper dec=jasper skip_bugs=1 +exclude_tests=() -while getopts d:e:i:vBE: opt; do +while getopts d:e:i:vBE:I:X: opt; do case "$opt" in d) dec="$OPTARG";; @@ -90,6 +91,10 @@ while getopts d:e:i:vBE: opt; do ;; esac ;; + I) + tests+=("$OPTARG");; + X) + exclude_tests+=("$OPTARG");; \?) usage break;; @@ -98,7 +103,7 @@ done shift $((OPTIND - 1)) if [ $# -ge 1 ]; then - tests=("$@") + tests+=("$@") fi ################################################################################ @@ -110,6 +115,29 @@ if [ "${#tests[@]}" -eq 0 ]; then tcf_gettestids "$test_file" tests || panic "cannot get tests" fi +# Remove any excluded tests from the list of tests to be run. +tmp_tests=() +for test in "${tests[@]}"; do + exclude=0 + for exclude_test in "${exclude_tests[@]}"; do + if [ "$exclude_test" = "$test" ]; then + exclude=1 + break + fi + done + if [ "$exclude" -eq 0 ]; then + tmp_tests+=("$test") + fi +done +tests=("${tmp_tests[@]}") + +if [ "$verbose" -ge 1 ]; then + echo "The following tests have been selected:" + for test in "${tests[@]}"; do + echo " $test" + done +fi + [ -d $TMPDIR ] || mkdir -p $TMPDIR [ -d $DATADIR ] || mkdir -p $DATADIR diff --git a/test/bin/run_test_3 b/test/bin/run_test_3 index 433c4b27..fad80412 100755 --- a/test/bin/run_test_3 +++ b/test/bin/run_test_3 @@ -12,6 +12,8 @@ fi cmd_dir=$(dirname "$0") || exit 1 source "$cmd_dir"/utilities || exit 1 +top_dir="$cmd_dir/../.." +sysinfo_program="$top_dir/build/sysinfo" debug_level="${JAS_DEBUG_LEVEL:-0}" if [ "$debug_level" -ge 1 ]; then @@ -51,6 +53,22 @@ fi ###codec_selectors+=(jasper_vm) ###codec_selectors+=(vm_jasper) +exclude_tests=() + +os="$("$sysinfo_program" -o)" || \ + panic "cannot get OS information" +echo "OS: $os" + +if [ "$os" = windows ]; then + eecho "WARNING: some tests disabled" + exclude_tests+=(sgn_1) +fi + +base_opts=() +for test in "${exclude_tests[@]}"; do + base_opts+=(-X "$test") +done + echo "STARTING AT `date`" num_errors=0 @@ -67,6 +85,7 @@ for codec_selector in "${codec_selectors[@]}"; do opts+=(-e "$enc") opts+=(-d "$dec") opts+=(-E ignore) + opts+=("${base_opts[@]}") #opts+=(-B) opts+=("$@") "$run_test" "${opts[@]}"