aboutsummaryrefslogtreecommitdiff
path: root/show-expected-fail-tests.sh
diff options
context:
space:
mode:
authorAlex Chen <Cnly@users.noreply.github.com>2019-06-25 18:50:19 +0800
committerAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2019-06-25 11:50:19 +0100
commit7792f12e6f6c0327d4a38cb1f6b879c3acf38f57 (patch)
treed3e38dac668346ecbd121c906d1f91a95c4d8eb0 /show-expected-fail-tests.sh
parentb88112b05db9da292d39b165f91b9af293c88500 (diff)
Fix testfile path hardcoded in show-expected-fail-tests.sh (#719)
Signed-off-by: Alex Chen <minecnly@gmail.com>
Diffstat (limited to 'show-expected-fail-tests.sh')
-rwxr-xr-xshow-expected-fail-tests.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/show-expected-fail-tests.sh b/show-expected-fail-tests.sh
index 277a2c8b..f58416b2 100755
--- a/show-expected-fail-tests.sh
+++ b/show-expected-fail-tests.sh
@@ -1,13 +1,28 @@
#! /bin/bash
results_file=$1
+testfile=$2
+
+fail_build=0
+
+if [ ! -f "$results_file" ]; then
+ echo "ERROR: Specified results file ${results_file} doesn't exist."
+ fail_build=1
+fi
+
+if [ ! -f "$testfile" ]; then
+ echo "ERROR: Specified testfile ${testfile} doesn't exist."
+ fail_build=1
+fi
+
+[ "$fail_build" = 0 ] || exit 1
+
passed_but_expected_fail=$(grep ' # TODO passed but expected fail' ${results_file} | sed -E 's/^ok [0-9]+ (\(expected fail\) )?//' | sed -E 's/( \([0-9]+ subtests\))? # TODO passed but expected fail$//')
tests_to_add=""
already_in_testfile=""
-fail_build=0
while read -r test_id; do
- grep "${test_id}" testfile > /dev/null 2>&1
+ grep "${test_id}" "${testfile}" > /dev/null 2>&1
if [ "$?" != "0" ]; then
tests_to_add="${tests_to_add}${test_id}\n"
fail_build=1