aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb62281+dev@gmail.com>2020-06-05 16:05:45 -0500
committerJacob Bachmeyer <jcb62281+dev@gmail.com>2020-06-05 16:05:45 -0500
commit5096a3c6208a392ea601466bb874a59fd51d95d2 (patch)
tree44844206770aa93bfba9a49f210a3c4765955b88 /lib
parent5fafcd43b2d22b2227e62f7278584418c6449824 (diff)
downloaddejagnu-5096a3c6208a392ea601466bb874a59fd51d95d2.zip
dejagnu-5096a3c6208a392ea601466bb874a59fd51d95d2.tar.gz
dejagnu-5096a3c6208a392ea601466bb874a59fd51d95d2.tar.bz2
Add "testsuite can call api" feature test API
Diffstat (limited to 'lib')
-rw-r--r--lib/framework.exp21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/framework.exp b/lib/framework.exp
index e6ce197..e0f2ee6 100644
--- a/lib/framework.exp
+++ b/lib/framework.exp
@@ -1019,10 +1019,30 @@ proc incr_count { name args } {
proc testsuite { subcommand args } {
if { $subcommand eq "file" } {
testsuite_file $args
+ } elseif { $subcommand eq "can" } {
+ testsuite_can $args
} else {
error "unknown \"testsuite\" command: testsuite $subcommand $args"
}
}
+namespace eval ::dejagnu {}
+
+# Feature test
+#
+proc testsuite_can { argv } {
+ verbose "entering testsuite can $argv" 3
+
+ if { [lrange $argv 0 1] eq "call api" } {
+ set call [lrange $argv 2 end]
+ set result [info exists ::dejagnu::apilist($call)]
+ } else {
+ error "unknown feature test: testsuite can $argv"
+ }
+
+ verbose "leaving testsuite can: $result" 3
+ return $result
+}
+array set ::dejagnu::apilist { {testsuite can call api} 1 }
# Return a full file name in or near the testsuite
#
@@ -1075,3 +1095,4 @@ proc testsuite_file { argv } {
verbose "leaving testsuite file: $result" 3
return $result
}
+array set ::dejagnu::apilist { {testsuite file} 1 }