diff options
author | Jacob Bachmeyer <jcb62281@gmail.com> | 2018-12-11 22:33:29 +1100 |
---|---|---|
committer | Ben Elliston <bje@gnu.org> | 2018-12-11 22:33:29 +1100 |
commit | 48fbec72a052b82b14eb96716da6c249d0a673c0 (patch) | |
tree | 025d55f827a9a882a352649c19c43a2713aef942 /testsuite/runtest.main | |
parent | 0a5a8a9d3b55cf0bc64d2b5ff4d272a3302a283d (diff) | |
download | dejagnu-48fbec72a052b82b14eb96716da6c249d0a673c0.zip dejagnu-48fbec72a052b82b14eb96716da6c249d0a673c0.tar.gz dejagnu-48fbec72a052b82b14eb96716da6c249d0a673c0.tar.bz2 |
* testsuite/runtest.all/libs.exp: Use "testsuite file" command.
* testsuite/runtest.all/load_lib.exp: Likewise.
* testsuite/runtest.all/stats.exp: Likewise.
* testsuite/runtest.all/stats.exp: Write local init file as
"stats-init.exp" for status summary tests. Use --local_init
option to runtest to load that file instead of site.exp and move
the inner test module to a nested testsuite.
* testsuite/runtest.all/stats-sub.exp: Move file from here ..
* testsuite/runtest.all/stats/testsuite/stat.test/stats-sub.exp:
.. to here.
* testsuite/runtest.all/options.exp: Clean up whitespace in file.
Wrap lines in test list and move short items to beginning of list.
Write local init file as "options-init.exp" for options tests.
Use --local_init option with nested runtest to load that file
instead of site.exp; also create an empty nested testsuite. Local
init file arranges for inner runtest processes to run in a
subdirectory in the object tree to eliminate filename clashes.
Set tmpdir if not already set and remove entire temporary
directory after running options tests.
* testsuite/runtest.all/options/testsuite/null.test/null.exp: New.
* testsuite/runtest.all/clone_output.test: Move from here ..
* testsuite/runtest.libs/clone_output.test: .. to here.
* testsuite/runtest.all/config.test: Move from here ..
* testsuite/runtest.libs/config.test: .. to here.
* testsuite/runtest.all/default_procs.tcl: Move from here ..
* testsuite/runtest.libs/default_procs.tcl: .. to here.
* testsuite/runtest.all/libs.exp: Move from here ..
* testsuite/runtest.libs/libs.exp: .. to here.
* testsuite/runtest.all/load_lib.exp: Move from here ..
* testsuite/runtest.libs/load_lib.exp: .. to here.
* testsuite/runtest.all/remote.test: Move from here ..
* testsuite/runtest.libs/remote.test: .. to here.
* testsuite/runtest.all/target.test: Move from here ..
* testsuite/runtest.libs/target.test: .. to here.
* testsuite/runtest.all/testsuite_file.test: Move from here ..
* testsuite/runtest.libs/testsuite_file.test: .. to here.
* testsuite/runtest.all/topdir/subdir1/subfile1: Move from here ..
* testsuite/runtest.libs/topdir/subdir1/subfile1: .. to here.
* testsuite/runtest.all/topdir/subdir1/subfile2: Move from here ..
* testsuite/runtest.libs/topdir/subdir1/subfile2: .. to here.
* testsuite/runtest.all/topdir/subdir1/subsubdir1/subsubfile1:
Move from here ..
* testsuite/runtest.libs/topdir/subdir1/subsubdir1/subsubfile1:
.. to here.
* testsuite/runtest.all/topdir/subdir2/subfile2: Move from here ..
* testsuite/runtest.libs/topdir/subdir2/subfile2: .. to here.
* testsuite/runtest.all/utils.test: Move from here ..
* testsuite/runtest.libs/utils.test: .. to here.
* testsuite/runtest.libs/utils.test: Update references to
"runtest.all".
* testsuite/runtest.all/options.exp: Move from here ..
* testsuite/runtest.main/options.exp: .. to here.
* testsuite/runtest.all/options/testsuite/null.test/null.exp: Move
from here ..
* testsuite/runtest.main/options/testsuite/null.test/null.exp:
.. to here.
* testsuite/runtest.all/stats.exp: Move from here ..
* testsuite/runtest.main/stats.exp: .. to here.
* testsuite/runtest.all/stats/testsuite/stat.test/stats-sub.exp:
Move from here ..
* testsuite/runtest.main/stats/testsuite/stat.test/stats-sub.exp:
.. to here.
* Makefile.am (DISTCLEANFILES): Update for testsuite improvements.
(TESTSUITE_FILES): Update to reflect testsuite reorganization.
* Makefile.in: Regenerate.
Signed-off-by: Ben Elliston <bje@gnu.org>
Diffstat (limited to 'testsuite/runtest.main')
-rw-r--r-- | testsuite/runtest.main/options.exp | 128 | ||||
-rw-r--r-- | testsuite/runtest.main/options/testsuite/null.test/null.exp | 1 | ||||
-rw-r--r-- | testsuite/runtest.main/stats.exp | 67 | ||||
-rw-r--r-- | testsuite/runtest.main/stats/testsuite/stat.test/stats-sub.exp | 36 |
4 files changed, 232 insertions, 0 deletions
diff --git a/testsuite/runtest.main/options.exp b/testsuite/runtest.main/options.exp new file mode 100644 index 0000000..da28db1 --- /dev/null +++ b/testsuite/runtest.main/options.exp @@ -0,0 +1,128 @@ +# Copyright (C) 1992-2016, 2018 Free Software Foundation, Inc. +# +# This file is part of DejaGnu. +# +# DejaGnu is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# DejaGnu is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with DejaGnu; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +# This file was written by Rob Savoye <rob@welcomehome.org>. + +load_lib util-defs.exp + +if {![info exists tmpdir]} { + set tmpdir [testsuite file -object -top tmpdir] +} + +set fd [open options-init.exp w] +puts $fd "set host_triplet $host_triplet" +puts $fd "set srcdir [testsuite file -source -test options]" +puts $fd "set objdir [testsuite file -object -test options]" +puts $fd "set tmpdir $tmpdir" +puts $fd "cd [testsuite file -object -test options]" +close $fd + +if {![file isdirectory $tmpdir]} { + catch "file mkdir $tmpdir" +} + +if {![file isdirectory [testsuite file -object -test options]]} { + catch {file mkdir [testsuite file -object -test options]} +} + +# +# Set up the list. +# 1st field is the command line option. +# 2nd field is the pattern to match. +# NOTE - No variable substitutions can be used. +# 3rd field is an optional message to print with PASS/FAIL. +# + +set tests { + { "--help" "USAGE:*" "Display help" } + { "-v -v -v" "Verbose level is 3" "Verbose set correctly" } + { "-v --tool xXx" + "Found.*options-init\..*Loading.*utils\.exp" + "Loading library files" } + { "-v --tool xXx" + "Expect binary is.*Using.*main test driver" + "Loading basic packages" } + { "--F --tool x" + "Illegal Argument \"--F\"" + "Bad argument" } + { "--tool x" + "Couldn't find tool init file" + "Bad tool name" } + { "-v --target m68k-vxworks" + "Target is m68k-vxworks" + "--target option" } + { "-v --target_board flash" + "Running target flash" + "--target_board option" } + { "-v --host sparc-sun-sunos4.1.9" + "Native configuration is sparc-sun-sunos4.1.9" + "--host option" } + { "-v -a" + "Print all test output to screen" + "--all option (short form)" } + { "-v --all" + "Print all test output to screen" + "--all option" } + { "-v --ignore foo.exp" + "Ignoring test foo.exp" + "--ignore option" } + { "-v --objdir xXx" + "Using test binaries in xXx" + "--objdir option" } + { "-v --tool xXx" + "Testing xXx" + "--tool option" } + { "-v --debug" + "Expect Debugging is ON" + "--debug option" } + { "-v --reboot" + "Will reboot the target" + "--reboot option" } + { "-v --strace 1" + "Source Trace level is now 1.* 1 if" + "--strace option" } + { "-v --D0" + "Tcl debugger is ON" + "--D0 option" } + { "-V" + "DejaGnu version.*Expect version.*Tcl version.*" + "-V option" } + { "--version" + "DejaGnu version.*Expect version.*Tcl version.*" + "--version option" } + { "-v --xml" + "XML logging turned on" + "--xml option" } +} + +foreach t $tests { + if [util_test $RUNTEST \ + "[lindex $t 0] --local_init options-init.exp" \ + "" \ + "[lindex $t 1]"] { + fail "[lindex $t 2]" + } else { + pass "[lindex $t 2]" + } +} + +# clean up log files left by the child runtest +foreach f [glob [testsuite file -object -test options *]] { + file delete $f +} +file delete -force $tmpdir diff --git a/testsuite/runtest.main/options/testsuite/null.test/null.exp b/testsuite/runtest.main/options/testsuite/null.test/null.exp new file mode 100644 index 0000000..f6f11af --- /dev/null +++ b/testsuite/runtest.main/options/testsuite/null.test/null.exp @@ -0,0 +1 @@ +# empty file for empty testsuite diff --git a/testsuite/runtest.main/stats.exp b/testsuite/runtest.main/stats.exp new file mode 100644 index 0000000..a81c8e6 --- /dev/null +++ b/testsuite/runtest.main/stats.exp @@ -0,0 +1,67 @@ +# Copyright (C) 1995-2016, 2018 Free Software Foundation, Inc. +# +# This file is part of DejaGnu. +# +# DejaGnu is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# DejaGnu is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with DejaGnu; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +# This file tests pass/fail/etc. +# The way we do this is to recursively invoke ourselves on a small testsuite +# and analyze the results. + +load_lib util-defs.exp + +if {![info exists tmpdir]} { + set tmpdir [testsuite file -object -top tmpdir] +} + +set fd [open stats-init.exp w] +puts $fd "set srcdir [testsuite file -source -test stats]" +puts $fd "set objdir [testsuite file -object -test stats]" +puts $fd "set tmpdir $tmpdir" +close $fd + +if {![file isdirectory $tmpdir]} { + catch "file mkdir $tmpdir" +} + +if {![file isdirectory [testsuite file -object -test stats]]} { + catch {file mkdir [testsuite file -object -test stats]} +} + +set tests { + { pass "expected passes\[ \t\]+1\n" } + { fail "unexpected failures\[ \t\]+1\n" } + { xpass "unexpected successes\[ \t\]+1\n" } + { xfail "expected failures\[ \t\]+1\n" } + { kpass "unknown successes\[ \t\]+1\n" } + { kfail "known failures\[ \t\]+1\n" } + { untested "untested testcases\[ \t\]+1\n" } + { unresolved "unresolved testcases\[ \t\]+1\n" } + { unsupported "unsupported tests\[ \t\]+1\n" } +} + +foreach t $tests { + if [util_test $RUNTEST \ + "--local_init stats-init.exp\ + --outdir $tmpdir STATS_TEST=[lindex $t 0] stats-sub.exp" \ + "" \ + [lindex $t 1]] { + fail [lindex $t 0] + } else { + pass [lindex $t 0] + } +} + +file delete -force $tmpdir diff --git a/testsuite/runtest.main/stats/testsuite/stat.test/stats-sub.exp b/testsuite/runtest.main/stats/testsuite/stat.test/stats-sub.exp new file mode 100644 index 0000000..c797ad1 --- /dev/null +++ b/testsuite/runtest.main/stats/testsuite/stat.test/stats-sub.exp @@ -0,0 +1,36 @@ +# Copyright (C) 1997-2016 Free Software Foundation, Inc. +# +# This file is part of DejaGnu. +# +# DejaGnu is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# DejaGnu is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with DejaGnu; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +# Subordinate to stats.exp. + +# If not called by stats.exp, quit now. +if { ![info exists STATS_TEST] } { + return +} + +switch $STATS_TEST { + pass { pass "pass test" } + fail { fail "fail test" } + xpass { xpass "xpass test" } + xfail { xfail "xfail test" } + kpass { kpass "somebug" "kpass test" } + kfail { kfail "somebug" "kfail test" } + untested { untested "untested test" } + unresolved { unresolved "unresolved test" } + unsupported { unsupported "unsupported test" } +} |