From cd8d9300213dcdeb5bdfbbb7a71ae4b82e042470 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 23 Feb 2016 11:04:51 +1300 Subject: [PATCH] talloc: Improve testsuite by avoiding path issues We now rely on waf to tell us where the helper binary is. Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam --- lib/talloc/test_magic_differs.sh | 10 ++++++---- lib/talloc/wscript | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/talloc/test_magic_differs.sh b/lib/talloc/test_magic_differs.sh index 0f765f0e032..1b6ba2e4d45 100755 --- a/lib/talloc/test_magic_differs.sh +++ b/lib/talloc/test_magic_differs.sh @@ -4,10 +4,12 @@ echo "test: magic differs" -if [ - "`./talloc_test_magic_differs_helper`" != "`./talloc_test_magic_differs_helper`" -]; then - echo "failure: magic remained the same between executions" +helper=$1 +m1=$($helper) +m2=$($helper) + +if [ $m1 -eq $m2 ]; then + echo "failure: magic remained the same between executions ($m1 vs $m2)" exit 1 fi diff --git a/lib/talloc/wscript b/lib/talloc/wscript index 1616791324d..bcce4c5d9ff 100644 --- a/lib/talloc/wscript +++ b/lib/talloc/wscript @@ -158,10 +158,11 @@ def test(ctx): cmd = os.path.join(Utils.g_module.blddir, 'talloc_testsuite') ret = samba_utils.RUN_COMMAND(cmd) print("testsuite returned %d" % ret) + magic_helper_cmd = os.path.join(Utils.g_module.blddir, 'talloc_test_magic_differs_helper') magic_cmd = os.path.join(srcdir, 'lib', 'talloc', 'test_magic_differs.sh') - magic_ret = samba_utils.RUN_COMMAND(magic_cmd) + magic_ret = samba_utils.RUN_COMMAND(magic_cmd + " " + magic_helper_cmd) print("magic differs test returned %d" % magic_ret) pyret = samba_utils.RUN_PYTHON_TESTS(['test_pytalloc.py']) print("python testsuite returned %d" % pyret) -- 2.45.1