Skip to content

Commit 11b2b65

Browse files
yuhaothgowthamsk-arm
authored andcommitted
Replace components detect with declare -F
That's prepare for sharing component between `all.sh` and faketime nightly build tests Signed-off-by: Jerry Yu <[email protected]>
1 parent 186731b commit 11b2b65

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/scripts/all.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,12 @@ pre_initialize_variables () {
191191

192192
# Gather the list of available components. These are the functions
193193
# defined in this script whose name starts with "component_".
194-
# Parse the script with sed. This way we get the functions in the order
195-
# they are defined.
196-
ALL_COMPONENTS=$(sed -n 's/^ *component_\([0-9A-Z_a-z]*\) *().*/\1/p' <"$0")
194+
# Parse the script with sed.
195+
#
196+
# This script is interpreted by `bash` and `declare -F` is supported,
197+
# functions defined in other files can be detected with `declare -F`
198+
ALL_COMPONENTS=$(declare -F | \
199+
sed -n 's/^declare\ -f\ component_\([0-9A-Z_a-z]*\)$/\1/p')
197200

198201
# For Linux platforms we run latest/earliest versions of clang and the
199202
# test_clang_opt function is only for FreeBSD. This condition removes

0 commit comments

Comments
 (0)