diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2025-04-25 21:48:22 +0100 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2025-04-25 21:48:22 +0100 |
commit | 0ad8ddc8b49d8312cfea2b663a7bf86a20a006fd (patch) | |
tree | 3cfd457a297a49be01bf7a1fe36d52832b1141e3 | |
parent | 61d4ada564f8b7e10e731f28abda6c4192b63cd2 (diff) | |
download | binutils-0ad8ddc8b49d8312cfea2b663a7bf86a20a006fd.zip binutils-0ad8ddc8b49d8312cfea2b663a7bf86a20a006fd.tar.gz binutils-0ad8ddc8b49d8312cfea2b663a7bf86a20a006fd.tar.bz2 |
libctf: run_lookup_test: support per-test options
This lets you say e.g.
run_lookup_test [file rootname $ctf_test ] {link: on}
to turn on the {link: on} option for all tests, as if specified in every
test file.
-rw-r--r-- | libctf/testsuite/lib/ctf-lib.exp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libctf/testsuite/lib/ctf-lib.exp b/libctf/testsuite/lib/ctf-lib.exp index 64d2a40..6adfd78 100644 --- a/libctf/testsuite/lib/ctf-lib.exp +++ b/libctf/testsuite/lib/ctf-lib.exp @@ -118,11 +118,14 @@ proc compile_link_one_host_cc { src output additional_args } { # # Each option may occur at most once unless otherwise mentioned. # +# Boolean options may also be passed as arguments to run_lookup_test: +# one option per word: options with a trailing colon are turned off. +# # After the option lines come regexp lines. run_lookup_test calls # regexp_diff to compare the output of the lookup program against the # regexps in FILE.d. # -proc run_lookup_test { name } { +proc run_lookup_test { name args } { global CC_FOR_TARGET CFLAGS_FOR_TARGET LIBS TEST_CROSS global copyfile env runtests srcdir subdir verbose @@ -175,6 +178,13 @@ proc run_lookup_test { name } { set opts($opt_name) [concat $opts($opt_name) $opt_val] } + foreach arg $args { + set opt_name [lindex [split $arg ":"] 0] + set opt_value [lindex [split $arg ":"] 1] + + set opts($opt_name) [concat $opts($opt_name) $opt_val] + } + if { [llength $opts(no_cross)] != 0 && "$TEST_CROSS" eq "yes" } { untested "$file4log not tested when cross-compiling" @@ -217,7 +227,7 @@ proc run_lookup_test { name } { return 0 } - # Compile the inputs and posibly link them together. + # Compile the inputs and possibly link them together. set lookup_output "" if { [llength $opts(source)] > 0 } { |