all.sh: with non-option arguments, run only these components
diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh
index 2f891f7..d5c6ddc 100755
--- a/tests/scripts/all.sh
+++ b/tests/scripts/all.sh
@@ -94,6 +94,7 @@
CONFIG_H='include/mbedtls/config.h'
CONFIG_BAK="$CONFIG_H.bak"
+ COMPONENTS=
MEMORY=0
FORCE=0
KEEP_GOING=0
@@ -126,8 +127,12 @@
usage()
{
cat <<EOF
-Usage: $0 [OPTION]...
- -h|--help Print this help.
+Usage: $0 [OPTION]... [COMPONENT]...
+Run mbedtls release validation tests.
+By default, run all tests. With one or more COMPONENT, run only those.
+
+Special options:
+ -h|--help Print this help and exit.
General options:
-f|--force Force the tests to overwrite any modified files.
@@ -259,14 +264,20 @@
--release-test|-r) SEED=1;;
--seed|-s) shift; SEED="$1";;
--yotta) YOTTA=1;;
- *)
+ -*)
echo >&2 "Unknown option: $1"
echo >&2 "Run $0 --help for usage."
exit 120
;;
+ *)
+ COMPONENTS="$COMPONENTS $1";;
esac
shift
done
+
+ if [ -z "$COMPONENTS" ]; then
+ COMPONENTS="$ALL_COMPONENTS"
+ fi
}
pre_check_git () {
@@ -999,7 +1010,7 @@
cleanup
# Run all the test components.
-for component in $ALL_COMPONENTS; do
+for component in $COMPONENTS; do
run_component "component_$component"
done