mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 08:42:50 +00:00
Add --except mode: run all components except a list
Allow the list to use wildcards, e.g. you can run the sanity checks with all.sh --except "test_*" "build_*"
This commit is contained in:
parent
92525111dc
commit
81b96ed603
@ -105,6 +105,7 @@ pre_initialize_variables () {
|
|||||||
CONFIG_BAK="$CONFIG_H.bak"
|
CONFIG_BAK="$CONFIG_H.bak"
|
||||||
|
|
||||||
COMPONENTS=
|
COMPONENTS=
|
||||||
|
ALL_EXCEPT=0
|
||||||
MEMORY=0
|
MEMORY=0
|
||||||
FORCE=0
|
FORCE=0
|
||||||
INTROSPECTION_MODE=
|
INTROSPECTION_MODE=
|
||||||
@ -129,6 +130,19 @@ pre_initialize_variables () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Test whether $1 is excluded via $COMPONENTS (a space-separated list of
|
||||||
|
# wildcard patterns).
|
||||||
|
component_is_excluded()
|
||||||
|
{
|
||||||
|
set -f
|
||||||
|
for pattern in $COMPONENTS; do
|
||||||
|
set +f
|
||||||
|
case ${1#component_} in $pattern) return 0;; esac
|
||||||
|
done
|
||||||
|
set +f
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
@ -145,6 +159,11 @@ General options:
|
|||||||
-k|--keep-going Run all tests and report errors at the end.
|
-k|--keep-going Run all tests and report errors at the end.
|
||||||
-m|--memory Additional optional memory tests.
|
-m|--memory Additional optional memory tests.
|
||||||
--armcc Run ARM Compiler builds (on by default).
|
--armcc Run ARM Compiler builds (on by default).
|
||||||
|
--except If some components are passed on the command line,
|
||||||
|
run all the tests except for these components. In
|
||||||
|
this mode, you can pass shell wildcard patterns as
|
||||||
|
component names, e.g. "$0 --except 'test_*'" to
|
||||||
|
exclude all components that run tests.
|
||||||
--no-armcc Skip ARM Compiler builds.
|
--no-armcc Skip ARM Compiler builds.
|
||||||
--no-force Refuse to overwrite modified files (default).
|
--no-force Refuse to overwrite modified files (default).
|
||||||
--no-keep-going Stop at the first error (default).
|
--no-keep-going Stop at the first error (default).
|
||||||
@ -257,6 +276,7 @@ pre_parse_command_line () {
|
|||||||
--armcc) RUN_ARMCC=1;;
|
--armcc) RUN_ARMCC=1;;
|
||||||
--armc5-bin-dir) shift; ARMC5_BIN_DIR="$1";;
|
--armc5-bin-dir) shift; ARMC5_BIN_DIR="$1";;
|
||||||
--armc6-bin-dir) shift; ARMC6_BIN_DIR="$1";;
|
--armc6-bin-dir) shift; ARMC6_BIN_DIR="$1";;
|
||||||
|
--except) ALL_EXCEPT=1;;
|
||||||
--force|-f) FORCE=1;;
|
--force|-f) FORCE=1;;
|
||||||
--gnutls-cli) shift; GNUTLS_CLI="$1";;
|
--gnutls-cli) shift; GNUTLS_CLI="$1";;
|
||||||
--gnutls-legacy-cli) shift; GNUTLS_LEGACY_CLI="$1";;
|
--gnutls-legacy-cli) shift; GNUTLS_LEGACY_CLI="$1";;
|
||||||
@ -1215,6 +1235,9 @@ run_all_components () {
|
|||||||
|
|
||||||
# Run one component and clean up afterwards.
|
# Run one component and clean up afterwards.
|
||||||
run_component () {
|
run_component () {
|
||||||
|
if [ $ALL_EXCEPT -ne 0 ] && component_is_excluded "$1"; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
"$@"
|
"$@"
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
@ -1251,7 +1274,7 @@ case "$INTROSPECTION_MODE" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -n "$COMPONENTS" ]; then
|
if [ -n "$COMPONENTS" ] && [ $ALL_EXCEPT -eq 0 ]; then
|
||||||
for component in $COMPONENTS; do
|
for component in $COMPONENTS; do
|
||||||
run_component "component_$component"
|
run_component "component_$component"
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user