From 11a4d37571253ce2cb18f36bb0ee18d1946be315 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Sat, 30 Aug 2014 06:59:29 +0200 Subject: Regression test portability: EXPECT Make sure test_expect_not_footer() and test_expect_footer() work on non empty strings, otherwise it may produce errors such as in pgfid_feat.t on NetBSD: not ok 12 Got "" instead of "" BUG: 1129939 Change-Id: I9cb76ba863897126534c3808fb0c9e564659835f Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/8568 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- tests/include.rc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/include.rc b/tests/include.rc index 7f4b377f644..26f3ee73789 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -172,7 +172,11 @@ function _EXPECT_NOT() shift; a=$("$@" | tail -1) - test_expect_not_footer "$e" "$a"; + if [ "x$e" = "x" ] ; then + test_expect_not_footer "x$e" "x$a"; + else + test_expect_not_footer "$e" "$a"; + fi } function _EXPECT_KEYWORD() @@ -237,7 +241,11 @@ function _EXPECT_WITHIN() sleep 1; done - test_expect_footer "$e" "$a"; + if [ "x$e" = "x" ] ; then + test_expect_footer "x$e" "x$a"; + else + test_expect_footer "$e" "$a"; + fi } -- cgit