aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb62281+dev@gmail.com>2020-07-06 21:04:07 -0500
committerJacob Bachmeyer <jcb62281+dev@gmail.com>2020-07-06 21:04:07 -0500
commit376dacc26259cbd61860d58a3ec16099d5b7581f (patch)
tree7a39a88df6cae6513a3592b55b164422c5aa6b00 /testsuite
parente572af7e43e26162a717408c2464cad24c936d07 (diff)
parent8c750f7449bd33cb8952e8ddbb3cc5cecaa05bb3 (diff)
Merge branch 'new-api-for-1.6.3'
Conflicts: ChangeLog NEWS doc/dejagnu.texi
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/runtest.libs/testcase_group.test61
-rw-r--r--testsuite/runtest.libs/testsuite_can.test29
2 files changed, 90 insertions, 0 deletions
diff --git a/testsuite/runtest.libs/testcase_group.test b/testsuite/runtest.libs/testcase_group.test
new file mode 100644
index 0000000..e524744
--- /dev/null
+++ b/testsuite/runtest.libs/testcase_group.test
@@ -0,0 +1,61 @@
+# test "testcase group" API call -*- Tcl -*-
+
+if [ file exists $srcdir/$subdir/default_procs.tcl ] {
+ source "$srcdir/$subdir/default_procs.tcl"
+} else {
+ puts "ERROR: $srcdir/$subdir/default_procs.tcl doesn't exist"
+}
+if [ file exists $srcdir/../lib/framework.exp] {
+ source $srcdir/../lib/framework.exp
+} else {
+ puts "ERROR: $srcdir/../lib/framework.exp doesn't exist"
+}
+
+# test group handling
+
+run_tests {
+ { lib_errpat_test testcase { group bogus-command }
+ "*unknown*bogus-command*"
+ "reject bogus group operation" }
+ { lib_errpat_test testcase { group begin "no spaces in group names" }
+ "*spaces in group names*is not valid*"
+ "reject entering group with spaces in name" }
+
+ { lib_ret_test testcase { group } ""
+ "initially in no group" }
+ { lib_ret_test testcase { group begin foo } "foo"
+ "enter group 'foo'" }
+ { lib_ret_test testcase { group } "foo"
+ "now in group 'foo'" }
+ { lib_ret_test testcase { group begin bar } "bar"
+ "enter group 'bar' (foo/bar)" }
+ { lib_ret_test testcase { group } "foo/bar"
+ "now in group 'foo/bar'" }
+ { lib_errpat_test testcase { group end foo }
+ "*expected to close group*foo*found group*bar*"
+ "error on mismatch leaving 'foo' in 'foo/bar'" }
+ { lib_errpat_test testcase { group end "foo/bar" }
+ "*expected to close group*foo/bar*found group*bar*"
+ "error on mismatch leaving 'foo/bar'" }
+ { lib_ret_test testcase { group end bar } "bar"
+ "leave group 'bar' (foo)" }
+ { lib_ret_test testcase { group } "foo"
+ "back in group 'foo'" }
+ { lib_ret_test testcase { group begin "baz/bar" } "baz/bar"
+ "enter group 'baz/bar' (foo/baz/bar)" }
+ { lib_ret_test testcase { group } "foo/baz/bar"
+ "now in group 'foo/baz/bar'" }
+ { lib_ret_test testcase { group eval "quux" {testcase group} }
+ "foo/baz/bar/quux"
+ "group 'foo/baz/bar/quux' entered for eval" }
+ { lib_ret_test testcase { group } "foo/baz/bar"
+ "still in group 'foo/baz/bar' after eval" }
+ { lib_ret_test testcase { group end "baz/bar" } "baz/bar"
+ "leave group 'baz/bar' (foo)" }
+ { lib_ret_test testcase { group end foo } "foo"
+ "leave group 'foo'" }
+ { lib_ret_test testcase { group } ""
+ "finally in no group" }
+}
+
+puts "END testcase_group.test"
diff --git a/testsuite/runtest.libs/testsuite_can.test b/testsuite/runtest.libs/testsuite_can.test
new file mode 100644
index 0000000..98d4e38
--- /dev/null
+++ b/testsuite/runtest.libs/testsuite_can.test
@@ -0,0 +1,29 @@
+# test "testsuite can" API call -*- Tcl -*-
+
+if [ file exists $srcdir/$subdir/default_procs.tcl ] {
+ source "$srcdir/$subdir/default_procs.tcl"
+} else {
+ puts "ERROR: $srcdir/$subdir/default_procs.tcl doesn't exist"
+}
+if [ file exists $srcdir/../lib/framework.exp] {
+ source $srcdir/../lib/framework.exp
+} else {
+ puts "ERROR: $srcdir/../lib/framework.exp doesn't exist"
+}
+
+# API availability check tests
+
+run_tests {
+ { lib_errpat_test testsuite { can }
+ "*unknown feature test*"
+ "testsuite can without arguments" }
+ { lib_errpat_test testsuite { can call }
+ "*unknown feature test*"
+ "testsuite can call without 'api'" }
+ { lib_bool_test testsuite { can call api } false
+ "testsuite can call api returns false for null API call name" }
+ { lib_bool_test testsuite { can call api testsuite can call api } true
+ "testsuite can call api reports its own existence" }
+}
+
+puts "END testsuite_can.test"