Skip to contentSkip to conversation

check: skip parsing if the file is not shell script.

PATCH In review Masayoshi Mizuma 2 participants 3 messages Oct 24, 2018 – Oct 29, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 check: skip parsing if the file is not shell script.

From: Masayoshi Mizuma <[email protected]>

If we run tests using '*', for example './check xfs/*', we will get following error messages. This patch introduces to avoid the messages.

./check xfs/*
xfs/001.out - unknown test, ignored
xfs/002.out - unknown test, ignored
xfs/003.out - unknown test, ignored
xfs/004.out - unknown test, ignored
...

---
 check | 4 ++++
 1 file changed, 4 insertions(+)
check +4 -0
index f3c8021d..96cb222f 100755
@@ -339,6 +339,10 @@ if $have_test_arg; then
 				test_dir=`dirname $t`
 				test_dir=${test_dir#$SRC_DIR/*}
 				test_name=`basename $t`
+				if ! file -bi $SRC_DIR/$test_dir/$test_name | \
+					egrep -q 'text/x-shellscript'; then
+					continue
+				fi
 				group_file=$SRC_DIR/$test_dir/group
 
 				if egrep -q "^$test_name" $group_file; then
Signature · 1 line
2.18.0
#1 lore raw
Quoted 6 lines · Masayoshi Mizuma

From: Masayoshi Mizuma <[email protected]>

If we run tests using '*', for example './check xfs/*', we will get following error messages. This patch introduces to avoid the messages.

Quoted 6 lines

./check xfs/*
xfs/001.out - unknown test, ignored
xfs/002.out - unknown test, ignored
xfs/003.out - unknown test, ignored
xfs/004.out - unknown test, ignored
...

Hmm, that's just not the recommended way to run tests. Not all tests are valid (yes, there're broken tests) and sometimes we may forget to add x permission on a test (though I have a local script to catch that, but it did happen before).

Please either use a more precise pattern to match the tests you want to run, or even better, run tests by specifying the groups, e.g.

./check -g xfs/log

to run all tests in 'log' group in 'xfs' directory.

Thanks,
Eryu

Quoted 24 lines
---
 check | 4 ++++
 1 file changed, 4 insertions(+)
check +4 -0
index f3c8021d..96cb222f 100755
@@ -339,6 +339,10 @@ if $have_test_arg; then
 				test_dir=`dirname $t`
 				test_dir=${test_dir#$SRC_DIR/*}
 				test_name=`basename $t`
+				if ! file -bi $SRC_DIR/$test_dir/$test_name | \
+					egrep -q 'text/x-shellscript'; then
+					continue
+				fi
 				group_file=$SRC_DIR/$test_dir/group
 
 				if egrep -q "^$test_name" $group_file; then
Signature · 1 line
2.18.0
#2 lore raw
Quoted 14 lines · Eryu Guan
Quoted 6 lines · Masayoshi Mizuma

From: Masayoshi Mizuma <[email protected]>

If we run tests using '*', for example './check xfs/*', we will get following error messages. This patch introduces to avoid the messages.

Quoted 6 lines

./check xfs/*
xfs/001.out - unknown test, ignored
xfs/002.out - unknown test, ignored
xfs/003.out - unknown test, ignored
xfs/004.out - unknown test, ignored
...

Quoted 4 lines

Hmm, that's just not the recommended way to run tests. Not all tests are valid (yes, there're broken tests) and sometimes we may forget to add x permission on a test (though I have a local script to catch that, but it did happen before).

Got it, thanks!

Quoted 6 lines

Please either use a more precise pattern to match the tests you want to run, or even better, run tests by specifying the groups, e.g.

./check -g xfs/log

to run all tests in 'log' group in 'xfs' directory.

What is the better way to run all the tests?
Should I set the all groups? look like check -g xfs/auto,xfs/ioctl,...?

Thanks,
Masa