config: Add -s option to run only specified sections

This commit adds -s option which allows you to specify only certain
sections from the config file to be run. The '-s' argument can be
specified multiple times to allow multiple sections to be run.

The options are still carried between section, that includes the
sections which are not going to be run.

Update README.config-sections as well.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Lukas Czerner
2014-04-11 10:19:29 +10:00
committed by Dave Chinner
parent ed6d09656a
commit a0e2d8ecc0
2 changed files with 45 additions and 1 deletions
+15 -1
View File
@@ -75,6 +75,7 @@ check options
-T output timestamps
-r randomize test order
--large-fs optimise scratch device for large filesystems
-s section run only specified section from config file
testlist options
-g group[,group...] include tests from these groups
@@ -221,7 +222,7 @@ while [ $# -gt 0 ]; do
done
done
;;
-s) RUN_SECTION="$RUN_SECTION $2"; shift ;;
-l) diff="diff" ;;
-udiff) diff="$diff -u" ;;
@@ -389,6 +390,19 @@ for section in $HOST_OPTIONS_SECTIONS; do
OLD_MOUNT_OPTIONS=$MOUNT_OPTIONS
get_next_config $section
# Do we need to run only some sections ?
if [ ! -z "$RUN_SECTION" ]; then
skip=true
for s in $RUN_SECTION; do
if [ $section == $s ]; then
skip=false
fi
done
if $skip; then
continue
fi
fi
mkdir -p $RESULT_BASE
if [ ! -d $RESULT_BASE ]; then
echo "failed to create results directory $RESULT_BASE"