summaryrefslogtreecommitdiffstats
path: root/tests/env.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-07-05 10:38:42 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-07-05 10:38:42 (GMT)
commita407e1e0a4496d94823146e2bacf89ba0d5634f5 (patch)
treebaa4c102aff8ec62a52114ea6ce1cacb8237f8c7 /tests/env.test
parentc8b71f046baf06c64c0bb2e7c5c295b0fc742f5e (diff)
downloadtcl-a407e1e0a4496d94823146e2bacf89ba0d5634f5.zip
tcl-a407e1e0a4496d94823146e2bacf89ba0d5634f5.tar.gz
tcl-a407e1e0a4496d94823146e2bacf89ba0d5634f5.tar.bz2
Made many tests work properly when the current directory is not writable.
Added targets to unix/Makefile.in to facilitate testing of this situation.
Diffstat (limited to 'tests/env.test')
-rw-r--r--tests/env.test14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/env.test b/tests/env.test
index ce14fed..1fbec90 100644
--- a/tests/env.test
+++ b/tests/env.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: env.test,v 1.14 2002/06/22 04:19:47 dgp Exp $
+# RCS: @(#) $Id: env.test,v 1.15 2002/07/05 10:38:42 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -60,8 +60,7 @@ test env-1.3 {reflection of env by "array names"} {
# Skip them if exec is not defined.
::tcltest::testConstraint execCommandExists [expr {[info commands exec] != ""}]
-set f [open printenv w]
-puts $f {
+set printenvScript [makeFile {
proc lrem {listname name} {
upvar $listname list
set i [lsearch $list $name]
@@ -85,12 +84,11 @@ puts $f {
puts "$p=$env($p)"
}
exit
-}
-close $f
+} printenv]
proc getenv {} {
- global printenv tcltest
- catch {exec $::tcltest::tcltest printenv} out
+ global printenvScript tcltest
+ catch {exec $::tcltest::tcltest $printenvScript} out
if {$out == "child process exited abnormally"} {
set out {}
}
@@ -244,7 +242,7 @@ foreach name [array names env2] {
}
# cleanup
-file delete printenv
+removeFile $printenvScript
::tcltest::cleanupTests
return