Skip to contentSkip to conversation

xfstests: honor comments in the test group file

PATCH Alex Elder 1 participant 2 messages Feb 26, 2010 – Apr 16, 2010

lore
Share & tools
lore

Alex Elder

author
#0 lore raw

There are some spots in the "group" file where test numbers have groups listed after a '#' character, clearly intending for those groups to be commented out. But the way the group list gets generated that commenting doesn't work, and in fact these tests explicitly *are* included in such commented-out groups.

This patch fixes that, stripping out all comments (which start with a '#' character and end with a newline) from the file before building the set of test numbers for a group.

---
 common |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
common +0 -1
Index: b/common
===================================================================
@@ -58,9 +58,10 @@ do
     if $group
     then
        # arg after -g
-       group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].*

$r /"'{
-s/ .*//p
-}'`
+ group_list=$(sed -n < group \

+                       -e 's/#.*//' \
+                       -e 's/$/ /' \
+                       -e "/^[0-9][0-9][0-9].* $r /"'{ s/ .*//p }')

if [ -z "$group_list" ]
then
echo "Group \"$r\" is empty or not defined?"

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

author
#1 lore raw

Will someone review this for me? -Alex

Quoted 37 lines · Alex Elder

There are some spots in the "group" file where test numbers have groups listed after a '#' character, clearly intending for those groups to be commented out. But the way the group list gets generated that commenting doesn't work, and in fact these tests explicitly *are* included in such commented-out groups.

This patch fixes that, stripping out all comments (which start with a '#' character and end with a newline) from the file before building the set of test numbers for a group.

---
 common |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: b/common
===================================================================

common +4 -3
@@ -58,9 +58,10 @@ do
     if $group
     then
        # arg after -g
-       group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].*
 $r /"'{
-s/ .*//p
-}'`
+       group_list=$(sed -n < group \
+                       -e 's/#.*//' \
+                       -e 's/$/ /' \
+                       -e "/^[0-9][0-9][0-9].* $r /"'{ s/ .*//p }')
        if [ -z "$group_list" ]
        then

echo "Group \"$r\" is empty or not defined?"

Quoted 4 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs