[5/7] libctf: test: add host

Message ID 20240426202023.423064-6-nick.alcock@oracle.com
State New
Headers
Series libctf: leak-adjacent fixes |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Testing passed

Commit Message

Nick Alcock April 26, 2024, 8:20 p.m. UTC
  This .lk option lets you execute particular tests only on specific host
architectures.

libctf/
	* testsuite/lib/ctf-lib.exp (run_lookup_test): Add host.
---
 libctf/testsuite/lib/ctf-lib.exp | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Patch

diff --git a/libctf/testsuite/lib/ctf-lib.exp b/libctf/testsuite/lib/ctf-lib.exp
index 523a8c31e1e..1f76e0b1aba 100644
--- a/libctf/testsuite/lib/ctf-lib.exp
+++ b/libctf/testsuite/lib/ctf-lib.exp
@@ -109,6 +109,9 @@  proc compile_link_one_host_cc { src output additional_args } {
 #   no_cross:
 #       If set, do not run this test when host != target.
 #
+#   host:
+#       If set, only run this test on hosts matching the given glob.
+#
 # Each option may occur at most once unless otherwise mentioned.
 #
 # After the option lines come regexp lines.  run_lookup_test calls
@@ -147,6 +150,7 @@  proc run_lookup_test { name } {
     set opts(source) {}
     set opts(xfail) {}
     set opts(no_cross) {}
+    set opts(host) {}
 
     foreach i $opt_array {
 	set opt_name [lindex $i 0]
@@ -170,6 +174,11 @@  proc run_lookup_test { name } {
 	return
     }
 
+    if { [llength $opts(host)] != 0 && ![ishost $opts(host)] } {
+	untested "$subdiir/$name only runs on $opts(host)"
+	return
+    }
+
     if { [llength $opts(lookup)] == 0 } {
 	set opts(lookup) "$file.c"
     } else {