3 # Generate a group file from the _begin_fstest call in each test.
5 if [ "$1" = "--help" ]; then
6 echo "Usage: (cd tests/XXX/ ; ../../tools/mkgroupfile [output])"
13 if [ ! -x ../../check ]; then
14 echo "$0: Run this from tests/XXX/."
18 generate_groupfile() {
20 # QA groups control file, automatically generated.
21 # See _begin_fstest in each test for details.
25 export GENERATE_GROUPS=yes
26 grep -R -l "^_begin_fstest" "$test_dir/" 2>/dev/null | while read testfile; do
27 test -x "$testfile" && "$testfile"
32 if [ -z "$groupfile" ] || [ "$groupfile" = "-" ]; then
33 # Dump the group file to stdout and exit
38 # Otherwise, write the group file to disk somewhere.
39 ngroupfile="${groupfile}.new"
41 generate_groupfile >> "$ngroupfile"
42 mv "$ngroupfile" "$groupfile"