Skip to content

Commit 56e0833

Browse files
author
Shlomi Noach
committed
support for expect_failure on localtests
1 parent 8e5c9cd commit 56e0833

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

localtests/test.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,18 @@ test_single() {
9595
echo_dot
9696
bash $exec_command_file 1> $test_logfile 2>&1
9797

98-
if [ $? -ne 0 ] ; then
98+
execution_result=$?
99+
100+
if [ -f $tests_path/$test_name/expect_failure ] ; then
101+
if [ $execution_result -eq 0 ] ; then
102+
echo
103+
echo "ERROR $test_name execution was expected to exit on error but did not. cat $test_logfile"
104+
return 1
105+
fi
106+
return 0
107+
fi
108+
109+
if [ $execution_result -ne 0 ] ; then
99110
echo
100111
echo "ERROR $test_name execution failure. cat $test_logfile"
101112
return 1

0 commit comments

Comments
 (0)