aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb62281@gmail.com>2018-12-11 22:33:29 +1100
committerBen Elliston <bje@gnu.org>2018-12-11 22:33:29 +1100
commit48fbec72a052b82b14eb96716da6c249d0a673c0 (patch)
tree025d55f827a9a882a352649c19c43a2713aef942 /testsuite
parent0a5a8a9d3b55cf0bc64d2b5ff4d272a3302a283d (diff)
downloaddejagnu-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')
-rw-r--r--testsuite/runtest.all/options.exp87
-rw-r--r--testsuite/runtest.libs/clone_output.test (renamed from testsuite/runtest.all/clone_output.test)0
-rw-r--r--testsuite/runtest.libs/config.test (renamed from testsuite/runtest.all/config.test)0
-rw-r--r--testsuite/runtest.libs/default_procs.tcl (renamed from testsuite/runtest.all/default_procs.tcl)0
-rw-r--r--testsuite/runtest.libs/libs.exp (renamed from testsuite/runtest.all/libs.exp)19
-rw-r--r--testsuite/runtest.libs/load_lib.exp (renamed from testsuite/runtest.all/load_lib.exp)2
-rw-r--r--testsuite/runtest.libs/remote.test (renamed from testsuite/runtest.all/remote.test)0
-rw-r--r--testsuite/runtest.libs/target.test (renamed from testsuite/runtest.all/target.test)0
-rw-r--r--testsuite/runtest.libs/testsuite_file.test (renamed from testsuite/runtest.all/testsuite_file.test)0
-rw-r--r--testsuite/runtest.libs/topdir/subdir1/subfile1 (renamed from testsuite/runtest.all/topdir/subdir1/subfile1)0
-rw-r--r--testsuite/runtest.libs/topdir/subdir1/subfile2 (renamed from testsuite/runtest.all/topdir/subdir1/subfile2)0
-rw-r--r--testsuite/runtest.libs/topdir/subdir1/subsubdir1/subsubfile1 (renamed from testsuite/runtest.all/topdir/subdir1/subsubdir1/subsubfile1)0
-rw-r--r--testsuite/runtest.libs/topdir/subdir2/subfile2 (renamed from testsuite/runtest.all/topdir/subdir2/subfile2)0
-rw-r--r--testsuite/runtest.libs/utils.test (renamed from testsuite/runtest.all/utils.test)22
-rw-r--r--testsuite/runtest.main/options.exp128
-rw-r--r--testsuite/runtest.main/options/testsuite/null.test/null.exp1
-rw-r--r--testsuite/runtest.main/stats.exp (renamed from testsuite/runtest.all/stats.exp)17
-rw-r--r--testsuite/runtest.main/stats/testsuite/stat.test/stats-sub.exp (renamed from testsuite/runtest.all/stats-sub.exp)0
18 files changed, 166 insertions, 110 deletions
diff --git a/testsuite/runtest.all/options.exp b/testsuite/runtest.all/options.exp
deleted file mode 100644
index 7bd3e54..0000000
--- a/testsuite/runtest.all/options.exp
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (C) 1992-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.
-
-# This file was written by Rob Savoye <rob@welcomehome.org>.
-
-load_lib util-defs.exp
-
-# move the site.exp file so we have no default to confuse us.
-#if [file exists $objdir/site.exp] {
-# catch "exec mv -f $objdir/site.exp $objdir/site.ignore"
-#}
-set fd [open site.exp w]
-puts $fd "set host_triplet $host_triplet"
-puts $fd "set srcdir $srcdir/.."
-puts $fd "set objdir $objdir/.."
-puts $fd "set tmpdir $objdir/../tmpdir"
-close $fd
-
-#
-# 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 {
- { "-v --tool xXx" "Found.*site\..*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" }
- { "--help" "USAGE:*" "Display help" }
- { "-v -v -v" "Verbose level is 3" "Verbose set correctly" }
- { "-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" }
- { "-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] -srcdir $srcdir/runtest.all" "" "[lindex $t 1]"] {
- fail "[lindex $t 2]"
- } else {
- pass "[lindex $t 2]"
- }
-}
-
-
-set fd [open site.exp w]
-puts $fd "set host_triplet $host_triplet"
-puts $fd "set srcdir $srcdir"
-puts $fd "set objdir $objdir"
-puts $fd "set tmpdir $objdir/tmpdir"
-close $fd
-
-# clean up log files left by the child runtest
-foreach f [concat [glob $objdir/x.*] [glob $objdir/xXx.*]] {
- file delete $f
-}
-file delete dbg.log
diff --git a/testsuite/runtest.all/clone_output.test b/testsuite/runtest.libs/clone_output.test
index 656f308..656f308 100644
--- a/testsuite/runtest.all/clone_output.test
+++ b/testsuite/runtest.libs/clone_output.test
diff --git a/testsuite/runtest.all/config.test b/testsuite/runtest.libs/config.test
index 5e0ed82..5e0ed82 100644
--- a/testsuite/runtest.all/config.test
+++ b/testsuite/runtest.libs/config.test
diff --git a/testsuite/runtest.all/default_procs.tcl b/testsuite/runtest.libs/default_procs.tcl
index 6537496..6537496 100644
--- a/testsuite/runtest.all/default_procs.tcl
+++ b/testsuite/runtest.libs/default_procs.tcl
diff --git a/testsuite/runtest.all/libs.exp b/testsuite/runtest.libs/libs.exp
index 96b443d..7ce63a5 100644
--- a/testsuite/runtest.all/libs.exp
+++ b/testsuite/runtest.libs/libs.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2018 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
@@ -19,9 +19,6 @@
load_lib libsup.exp
proc process_test { test } {
- global srcdir
- global subdir
- global objdir
global EXPECT
verbose -log "Executing test case $test"
@@ -32,7 +29,13 @@ proc process_test { test } {
if [file exists $test] {
verbose "Processing test $test" 2
- spawn -open [open "|$EXPECT $test $srcdir $subdir [pwd]" r]
+ set command "$EXPECT $test\
+ [testsuite file -source -top]\
+ [relative_filename \
+ [testsuite file -source -top]\
+ [testsuite file -source -test]]\
+ [testsuite file -object -top]"
+ spawn -open [open "|$command" r]
expect {
"No such file or directory" {
perror "$test wouldn't run" 0
@@ -85,11 +88,11 @@ if {![info exists EXPECT]} {
verbose "EXPECT defaulting to $EXPECT" 2
}
-make_defaults_file [pwd]/setval.tmp
+make_defaults_file [testsuite file -object -top setval.tmp]
-foreach i [glob $srcdir/$subdir/*.test] {
+foreach i [glob [testsuite file -source -test *.test]] {
process_test $i
}
# Clean up behind ourselves.
-file delete .tmp [pwd]/setval.tmp
+file delete .tmp [testsuite file -object -top setval.tmp]
diff --git a/testsuite/runtest.all/load_lib.exp b/testsuite/runtest.libs/load_lib.exp
index f3c6ef0..21e2824 100644
--- a/testsuite/runtest.all/load_lib.exp
+++ b/testsuite/runtest.libs/load_lib.exp
@@ -24,7 +24,7 @@ if { [ load_lib "subfile1" ] != 1} {
rename send_error ""
rename saved_send_error send_error
-set extradir [file join $srcdir $subdir "topdir" "subdir1" ]
+set extradir [testsuite file -source -test "topdir" "subdir1"]
global libdirs
lappend libdirs $extradir
verbose "now added libdirs: $libdirs" 2
diff --git a/testsuite/runtest.all/remote.test b/testsuite/runtest.libs/remote.test
index 78804bd..78804bd 100644
--- a/testsuite/runtest.all/remote.test
+++ b/testsuite/runtest.libs/remote.test
diff --git a/testsuite/runtest.all/target.test b/testsuite/runtest.libs/target.test
index 2da4095..2da4095 100644
--- a/testsuite/runtest.all/target.test
+++ b/testsuite/runtest.libs/target.test
diff --git a/testsuite/runtest.all/testsuite_file.test b/testsuite/runtest.libs/testsuite_file.test
index fce65b8..fce65b8 100644
--- a/testsuite/runtest.all/testsuite_file.test
+++ b/testsuite/runtest.libs/testsuite_file.test
diff --git a/testsuite/runtest.all/topdir/subdir1/subfile1 b/testsuite/runtest.libs/topdir/subdir1/subfile1
index 8397fe3..8397fe3 100644
--- a/testsuite/runtest.all/topdir/subdir1/subfile1
+++ b/testsuite/runtest.libs/topdir/subdir1/subfile1
diff --git a/testsuite/runtest.all/topdir/subdir1/subfile2 b/testsuite/runtest.libs/topdir/subdir1/subfile2
index 7d1d836..7d1d836 100644
--- a/testsuite/runtest.all/topdir/subdir1/subfile2
+++ b/testsuite/runtest.libs/topdir/subdir1/subfile2
diff --git a/testsuite/runtest.all/topdir/subdir1/subsubdir1/subsubfile1 b/testsuite/runtest.libs/topdir/subdir1/subsubdir1/subsubfile1
index 7d1d836..7d1d836 100644
--- a/testsuite/runtest.all/topdir/subdir1/subsubdir1/subsubfile1
+++ b/testsuite/runtest.libs/topdir/subdir1/subsubdir1/subsubfile1
diff --git a/testsuite/runtest.all/topdir/subdir2/subfile2 b/testsuite/runtest.libs/topdir/subdir2/subfile2
index 7d1d836..7d1d836 100644
--- a/testsuite/runtest.all/topdir/subdir2/subfile2
+++ b/testsuite/runtest.libs/topdir/subdir2/subfile2
diff --git a/testsuite/runtest.all/utils.test b/testsuite/runtest.libs/utils.test
index 5051ec5..64cfc0a 100644
--- a/testsuite/runtest.all/utils.test
+++ b/testsuite/runtest.libs/utils.test
@@ -26,19 +26,19 @@ if [ file exists $file] {
#
run_tests [subst {
{ lib_pat_test getdirs
- {[file join $srcdir runtest.all]}
- [file join $srcdir runtest.all topdir]
+ {[file join $srcdir runtest.libs]}
+ [file join $srcdir runtest.libs topdir]
"getdirs toplevel, no arguments" }
{ lib_pat_test getdirs
- {[file join $srcdir runtest.all] "top*"}
- [file join $srcdir runtest.all topdir]
+ {[file join $srcdir runtest.libs] "top*"}
+ [file join $srcdir runtest.libs topdir]
"getdirs toplevel, one subdir" }
{ lib_pat_test getdirs
- {[file join $srcdir runtest.all topdir]}
+ {[file join $srcdir runtest.libs topdir]}
"*topdir*subdir\[12\]*topdir*subdir\[12\]"
"getdirs toplevel, two subdirs" }
{ lib_pat_test getdirs
- {[file join $srcdir runtest.all nothere]}
+ {[file join $srcdir runtest.libs nothere]}
""
"getdirs toplevel, non-existent subdir"}
}]
@@ -60,11 +60,11 @@ run_tests {
#
run_tests [subst {
{ lib_pat_test find
- {[file join $srcdir runtest.all topdir subdir2] "sub*"}
+ {[file join $srcdir runtest.libs topdir subdir2] "sub*"}
"*/subdir2/subfile2"
"find, only one level deep" }
{ lib_regexp_test find
- {[file join $srcdir runtest.all topdir subdir1] "sub*"}
+ {[file join $srcdir runtest.libs topdir subdir1] "sub*"}
".*/subdir1/subsubdir1/subsubfile1( |$)"
"find, two levels deep" }
}]
@@ -142,14 +142,14 @@ if {[which make] != 0} {
### depends on it.
# Test grep!
-if {[llength [grep $srcdir/runtest.all/utils.test "^# Test grep!"]] == 1} {
+if {[llength [grep $srcdir/runtest.libs/utils.test "^# Test grep!"]] == 1} {
pass "grep, no options"
} else {
fail "grep, no options"
}
# Test grep with line option.
-set result [grep $srcdir/runtest.all/utils.test "^# Test grep!" line]
+set result [grep $srcdir/runtest.libs/utils.test "^# Test grep!" line]
if {[llength $result] == 1 && [regexp {^\d+ # Test grep!} [lindex $result 0]]} {
pass "grep, line option"
} else {
@@ -157,7 +157,7 @@ if {[llength $result] == 1 && [regexp {^\d+ # Test grep!} [lindex $result 0]]} {
}
# Test grep with -n option.
-set result [grep -n $srcdir/runtest.all/utils.test "^# Test grep!"]
+set result [grep -n $srcdir/runtest.libs/utils.test "^# Test grep!"]
if {[llength $result] == 1 && [regexp {^\d+ # Test grep!} [lindex $result 0]]} {
pass "grep, -n option"
} else {
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.all/stats.exp b/testsuite/runtest.main/stats.exp
index dea5894..a81c8e6 100644
--- a/testsuite/runtest.all/stats.exp
+++ b/testsuite/runtest.main/stats.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1995-2016 Free Software Foundation, Inc.
+# Copyright (C) 1995-2016, 2018 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
@@ -23,13 +23,23 @@
load_lib util-defs.exp
if {![info exists tmpdir]} {
- set tmpdir $objdir/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" }
@@ -44,7 +54,8 @@ set tests {
foreach t $tests {
if [util_test $RUNTEST \
- "--outdir $tmpdir STATS_TEST=[lindex $t 0] stats-sub.exp" \
+ "--local_init stats-init.exp\
+ --outdir $tmpdir STATS_TEST=[lindex $t 0] stats-sub.exp" \
"" \
[lindex $t 1]] {
fail [lindex $t 0]
diff --git a/testsuite/runtest.all/stats-sub.exp b/testsuite/runtest.main/stats/testsuite/stat.test/stats-sub.exp
index c797ad1..c797ad1 100644
--- a/testsuite/runtest.all/stats-sub.exp
+++ b/testsuite/runtest.main/stats/testsuite/stat.test/stats-sub.exp