From 1cd78285270dace76023d8a7e0d5694ce964f0b4 Mon Sep 17 00:00:00 2001 From: Evan Huus Date: Mon, 3 Feb 2014 19:56:49 -0500 Subject: Various fixes to the Lua int64 code - add casts to pacify certain buildbots - skip test if lua isn't available Change-Id: I614c05dca40cb848c87b361e4b3d3c4e94aafb9e Reviewed-on: https://code.wireshark.org/review/97 Reviewed-by: Evan Huus Tested-by: Evan Huus --- test/config.sh | 5 +++++ test/suite-unittests.sh | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/config.sh b/test/config.sh index 8fb5a66e3d..9f07f52da7 100755 --- a/test/config.sh +++ b/test/config.sh @@ -99,6 +99,11 @@ export WIRESHARK_QUIT_AFTER_CAPTURE="True" CAPTURE_DIR="$TESTS_DIR/captures/" +# Figure out if we were built with lua or not so we can skip the lua tests if we +# don't have it. Is there a better way to do this than grepping config.h? +grep -q "#define HAVE_LUA 1" $SOURCE_DIR/config.h +HAVE_LUA=$? + # Display our environment ##printf "\n ------- Info =-----------------\n" diff --git a/test/suite-unittests.sh b/test/suite-unittests.sh index f10c65a00a..f9e0c68561 100755 --- a/test/suite-unittests.sh +++ b/test/suite-unittests.sh @@ -70,8 +70,13 @@ unittests_step_exntest() { } unittests_step_lua_int64_test() { - $TSHARK -r $CAPTURE_DIR/dhcp.pcap -X lua_script:$TESTS_DIR/lua/int64.lua > testout.txt 2>&1 + if [ $HAVE_LUA -ne 0 ]; then + test_step_skipped + return + fi + # Tshark catches lua script failures, so we have to parse the output. + $TSHARK -r $CAPTURE_DIR/dhcp.pcap -X lua_script:$TESTS_DIR/lua/int64.lua > testout.txt 2>&1 if grep -q "All tests passed!" testout.txt; then test_step_ok else -- cgit v1.2.3