tools: fix format of test_end function

This will make the function more flexible

Change-Id: I39acc83ca51ebd22d91166a47efa0d84f415669d
Signed-off-by: Seth Howell <seth.howell@intel.com>
This commit is contained in:
Seth Howell
2018-09-04 10:59:30 -07:00
parent 6e2013391a
commit 2065e638f2
3 changed files with 30 additions and 29 deletions

View File

@@ -48,25 +48,25 @@ time ./configure --prefix=$tmp_install_dir $opt_config_target
time $MAKE -j $cpus time $MAKE -j $cpus
test_start "check_tests" test_start "check_tests"
time $MAKE check -j $cpus D="-D TEST_SEED=$S" time $MAKE check -j $cpus D="-D TEST_SEED=$S"
test_end "check_tests" test_end "check_tests" $?
# Build other tests if deps found # Build other tests if deps found
if command -V ldconfig >/dev/null 2>&1; then if command -V ldconfig >/dev/null 2>&1; then
if ldconfig -p | grep -q libz.so; then if ldconfig -p | grep -q libz.so; then
test_start "other_check_tests" test_start "other_check_tests"
time $MAKE other -j $cpus time $MAKE other -j $cpus
test_end "other_check_tests" test_end "other_check_tests" $?
test_start "example_tests" test_start "example_tests"
time $MAKE ex -j $cpus time $MAKE ex -j $cpus
test_end "example_tests" test_end "example_tests" $?
test_start "unit_tests" test_start "unit_tests"
time $MAKE tests -j $cpus time $MAKE tests -j $cpus
test_end "unit_tests" test_end "unit_tests" $?
fi fi
fi fi
test_start "installation_test" test_start "installation_test"
time $MAKE install time $MAKE install
test_end "installation_test" test_end "installation_test" $?
# Check for gnu executable stack set # Check for gnu executable stack set
if command -V readelf >/dev/null 2>&1; then if command -V readelf >/dev/null 2>&1; then

View File

@@ -63,7 +63,7 @@ fi
$MAKE -f Makefile.unx clean $MAKE -f Makefile.unx clean
test_start "extended_build_test" test_start "extended_build_test"
time $MAKE -f Makefile.unx -j $cpus $build_opt time $MAKE -f Makefile.unx -j $cpus $build_opt
test_end "extended_build_test" test_end "extended_build_test" $?
msg+=$'Std makefile build: Pass\n' msg+=$'Std makefile build: Pass\n'
# Check for gnu executable stack set # Check for gnu executable stack set
@@ -71,9 +71,10 @@ if command -V readelf >/dev/null 2>&1; then
test_start "stack_nx_check" test_start "stack_nx_check"
if readelf -W -l bin/libisal.so | grep 'GNU_STACK' | grep -q 'RWE'; then if readelf -W -l bin/libisal.so | grep 'GNU_STACK' | grep -q 'RWE'; then
echo $0: Stack NX check bin/libisal.so: Fail echo $0: Stack NX check bin/libisal.so: Fail
test_end "stack_nx_check" 1
exit 1 exit 1
else else
test_end "stack_nx_check" test_end "stack_nx_check" 0
msg+=$'Stack NX check bin/lib/libisal.so: Pass\n' msg+=$'Stack NX check bin/lib/libisal.so: Pass\n'
fi fi
else else
@@ -83,19 +84,19 @@ fi
# Std makefile build perf tests # Std makefile build perf tests
test_start "extended_perf_test" test_start "extended_perf_test"
time $MAKE -f Makefile.unx -j $cpus perfs time $MAKE -f Makefile.unx -j $cpus perfs
test_end "extended_perf_test" test_end "extended_perf_test" $?
msg+=$'Std makefile build perf: Pass\n' msg+=$'Std makefile build perf: Pass\n'
# Std makefile run tests # Std makefile run tests
test_start "extended_makefile_tests" test_start "extended_makefile_tests"
time $MAKE -f Makefile.unx -j $cpus $build_opt D="TEST_SEED=$S" $test_level time $MAKE -f Makefile.unx -j $cpus $build_opt D="TEST_SEED=$S" $test_level
test_end "extended_makefile_tests" test_end "extended_makefile_tests" $?
msg+=$'Std makefile tests: Pass\n' msg+=$'Std makefile tests: Pass\n'
# Std makefile build other # Std makefile build other
test_start "extended_other_tests" test_start "extended_other_tests"
time $MAKE -f Makefile.unx -j $cpus $build_opt D="TEST_SEED=$S" other time $MAKE -f Makefile.unx -j $cpus $build_opt D="TEST_SEED=$S" other
test_end "extended_other_tests" test_end "extended_other_tests" $?
msg+=$'Other tests build: Pass\n' msg+=$'Other tests build: Pass\n'
# Try to pick a random src file # Try to pick a random src file
@@ -108,32 +109,32 @@ fi
echo Other tests using $in_file echo Other tests using $in_file
test_start "igzip_file_perf" test_start "igzip_file_perf"
./igzip_file_perf $in_file ./igzip_file_perf $in_file
test_end "igzip_file_perf" test_end "igzip_file_perf" $?
test_start "igzip_stateless_file_perf" test_start "igzip_stateless_file_perf"
./igzip_stateless_file_perf $in_file ./igzip_stateless_file_perf $in_file
test_end "igzip_stateless_file_perf" test_end "igzip_stateless_file_perf" $?
test_start "igzip_hist_perf" test_start "igzip_hist_perf"
./igzip_hist_perf $in_file ./igzip_hist_perf $in_file
test_end "igzip_hist_perf" test_end "igzip_hist_perf" $?
test_start "igzip_semi_dyn_file_perf" test_start "igzip_semi_dyn_file_perf"
./igzip_semi_dyn_file_perf $in_file ./igzip_semi_dyn_file_perf $in_file
test_end "igzip_semi_dyn_file_perf" test_end "igzip_semi_dyn_file_perf" $?
test_start "igzip_inflate_perf" test_start "igzip_inflate_perf"
./igzip_inflate_perf $in_file ./igzip_inflate_perf $in_file
test_end "igzip_inflate_perf" test_end "igzip_inflate_perf" $?
test_start "igzip_fuzz_inflate" test_start "igzip_fuzz_inflate"
./igzip_fuzz_inflate $in_file ./igzip_fuzz_inflate $in_file
test_end "igzip_fuzz_inflate" test_end "igzip_fuzz_inflate" $?
msg+=$'Other tests run: Pass\n' msg+=$'Other tests run: Pass\n'
if command -V shuf >/dev/null 2>&1; then if command -V shuf >/dev/null 2>&1; then
in_files=$(find $src -type f -size +0 -print 2>/dev/null | shuf | head -10 ); in_files=$(find $src -type f -size +0 -print 2>/dev/null | shuf | head -10 );
test_start "igzip_rand_test" test_start "igzip_rand_test"
./igzip_rand_test $in_files ./igzip_rand_test $in_files
test_end "igzip_rand_test" test_end "igzip_rand_test" $?
test_start "igzip_inflate_test" test_start "igzip_inflate_test"
./igzip_inflate_test $in_files ./igzip_inflate_test $in_files
test_end "igzip_inflate_test" test_end "igzip_inflate_test" $?
msg+=$'Compression file tests: Pass\n' msg+=$'Compression file tests: Pass\n'
else else
msg+=$'Compression file test: Skip\n' msg+=$'Compression file test: Skip\n'
@@ -144,19 +145,19 @@ msg+=$'Examples build: Pass\n'
test_start "ec_simple_example" test_start "ec_simple_example"
./ec_simple_example -r $S ./ec_simple_example -r $S
test_end "ec_simple_example" test_end "ec_simple_example" $?
test_start "crc_simple_test" test_start "crc_simple_test"
./crc_simple_test ./crc_simple_test
test_end "crc_simple_test" test_end "crc_simple_test" $?
test_start "crc64_example" test_start "crc64_example"
./crc64_example ./crc64_example
test_end "crc64_example" test_end "crc64_example" $?
test_start "xor_example" test_start "xor_example"
./xor_example ./xor_example
test_end "xor_example" test_end "xor_example" $?
test_start "igzip_example" test_start "igzip_example"
./igzip_example ${in_file} ${in_file}.cmp ./igzip_example ${in_file} ${in_file}.cmp
test_end "igzip_example" test_end "igzip_example" $?
rm -rf ${in_file}.cmp rm -rf ${in_file}.cmp
msg+=$'Examples run: Pass\n' msg+=$'Examples run: Pass\n'
@@ -169,7 +170,7 @@ $MAKE -f Makefile.unx -j $cpus D="NO_STATIC_INFLATE_H" checks
diff -q static_inflate.h igzip/static_inflate.h diff -q static_inflate.h igzip/static_inflate.h
rm -rf static_inflate.h rm -rf static_inflate.h
rm -rf hufftables_c.c rm -rf hufftables_c.c
test_end "generate_custom_hufftables" test_end "generate_custom_hufftables" $?
msg+=$'Custom hufftable build: Pass\n' msg+=$'Custom hufftable build: Pass\n'
@@ -178,10 +179,10 @@ $MAKE -f Makefile.unx clean
# noarch build # noarch build
test_start "noarch_build" test_start "noarch_build"
time $MAKE -f Makefile.unx -j $cpus arch=noarch $build_opt time $MAKE -f Makefile.unx -j $cpus arch=noarch $build_opt
test_end "noarch_build" test_end "noarch_build" $?
test_start "noarch_build_random" test_start "noarch_build_random"
time $MAKE -f Makefile.unx -j $cpus arch=noarch $build_opt D="TEST_SEED=$S" check time $MAKE -f Makefile.unx -j $cpus arch=noarch $build_opt D="TEST_SEED=$S" check
test_end "noarch_build_random" test_end "noarch_build_random" $?
$MAKE -f Makefile.unx arch=noarch clean $MAKE -f Makefile.unx arch=noarch clean
msg+=$'Noarch build: Pass\n' msg+=$'Noarch build: Pass\n'
@@ -189,13 +190,13 @@ msg+=$'Noarch build: Pass\n'
if command -V x86_64-w64-mingw32-gcc >/dev/null 2>&1; then if command -V x86_64-w64-mingw32-gcc >/dev/null 2>&1; then
test_start "mingw_build" test_start "mingw_build"
time $MAKE -f Makefile.unx -j $cpus arch=mingw time $MAKE -f Makefile.unx -j $cpus arch=mingw
test_end "mingw_build" test_end "mingw_build" $?
msg+=$'Mingw build: Pass\n' msg+=$'Mingw build: Pass\n'
if command -V wine >/dev/null 2>&1; then if command -V wine >/dev/null 2>&1; then
test_start "mingw_check_tests" test_start "mingw_check_tests"
time $MAKE -f Makefile.unx -j $cpus arch=mingw D="TEST_SEED=$S" check time $MAKE -f Makefile.unx -j $cpus arch=mingw D="TEST_SEED=$S" check
test_end "mingw_check_tests" test_end "mingw_check_tests" $?
msg+=$'Mingw check tests: Pass\n' msg+=$'Mingw check tests: Pass\n'
else else
msg+=$'No wine, mingw check: Skip\n' msg+=$'No wine, mingw check: Skip\n'

View File

@@ -7,5 +7,5 @@ function test_start()
function test_end() function test_end()
{ {
echo "leaving test: $1 status: $?" echo "leaving test: $1 status: $2"
} }