summaryrefslogtreecommitdiffstats
path: root/tests/include.rc
diff options
context:
space:
mode:
authorRaghavendra Talur <rtalur@redhat.com>2016-02-08 12:13:54 +0530
committerRaghavendra Talur <rtalur@redhat.com>2016-03-09 23:19:40 -0800
commitf6e5bc68d294cc67f1e7f4db043d2531d4cfec80 (patch)
treee500957fdf1d8e783c00f3fb2696f2f7f8e21daf /tests/include.rc
parent9e3a0791c0f1f336e55672b24721154bc862456b (diff)
tests: Add mechanism for disabled tests
Requirements: Should be able to skip tests from run-tests.sh run. Should be granular enough to disable on subset of OSes. Solution: Tests can have special comment lines with some comma separated values within them. Key names used to determine test status are G_TESTDEF_TEST_STATUS_CENTOS6 G_TESTDEF_TEST_STATUS_NETBSD7 Some examples: G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=123456 G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=4444444 G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=123456;555555 You can change status of test to enabled or delete the line only if all the bugs are closed or modified or if the patch fixes it. Change-Id: Idee21fecaa5837fd4bd06e613f5c07a024f7b0c2 BUG: 1295704 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/13393 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'tests/include.rc')
-rw-r--r--tests/include.rc37
1 files changed, 20 insertions, 17 deletions
diff --git a/tests/include.rc b/tests/include.rc
index 21a69465797..b46a7b2fde4 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -156,12 +156,13 @@ function test_header()
function test_footer()
{
RET=$?
- local err=$1
+ local lineno=$1
+ local err=$2
if [ $RET -eq 0 ]; then
- echo "ok $t";
+ echo "ok $t, LINENUM:$lineno";
else
- echo "not ok $t $err";
+ echo "not ok $t $err, LINENUM:$lineno";
# With DEBUG, this was already printed out, so skip it.
if [ x"$DEBUG" = x"0" ]; then
echo "FAILED COMMAND: $saved_cmd"
@@ -178,8 +179,9 @@ function test_footer()
function test_expect_footer()
{
- local e=$1
- local a=$2
+ local lineno=$1
+ local e=$2
+ local a=$3
local err=""
if ! [[ "$a" =~ $e ]]; then
@@ -187,7 +189,7 @@ function test_expect_footer()
fi
[[ "$a" =~ $e ]];
- test_footer "$err";
+ test_footer "$lineno" "$err";
}
function _EXPECT()
@@ -204,16 +206,17 @@ function _EXPECT()
a=$("$@" | tail -1)
if [ "x$e" = "x" ] ; then
- test_expect_footer "x$e" "x$a";
+ test_expect_footer "$TESTLINE" "x$e" "x$a";
else
- test_expect_footer "$e" "$a";
+ test_expect_footer "$TESTLINE" "$e" "$a";
fi
}
function test_expect_not_footer()
{
- local e=$1
- local a=$2
+ local lineno=$1
+ local e=$2
+ local a=$3
local err=""
if [[ "$a" =~ $e ]]; then
@@ -221,7 +224,7 @@ function test_expect_not_footer()
fi
! [[ "$a" =~ "$e" ]];
- test_footer "$err";
+ test_footer "$lineno" "$err";
}
function _EXPECT_NOT()
@@ -238,9 +241,9 @@ function _EXPECT_NOT()
a=$("$@" | tail -1)
if [ "x$e" = "x" ] ; then
- test_expect_not_footer "x$e" "x$a";
+ test_expect_not_footer "$TESTLINE" "x$e" "x$a";
else
- test_expect_not_footer "$e" "$a";
+ test_expect_not_footer "$TESTLINE" "$e" "$a";
fi
}
@@ -255,7 +258,7 @@ function _EXPECT_KEYWORD()
shift;
"$@" | tail -1 | grep -q "$e"
- test_footer;
+ test_footer "$TESTLINE";
}
function _TEST()
@@ -273,7 +276,7 @@ function _TEST()
eval "$@" >/dev/null $redirect
- test_footer;
+ test_footer "$TESTLINE";
}
function _EXPECT_WITHIN()
@@ -308,9 +311,9 @@ function _EXPECT_WITHIN()
done
if [ "x$e" = "x" ] ; then
- test_expect_footer "x$e" "x$a";
+ test_expect_footer "$TESTLINE" "x$e" "x$a";
else
- test_expect_footer "$e" "$a";
+ test_expect_footer "$TESTLINE" "$e" "$a";
fi
}