From 189d0a83d2df3b9f47e30232bdf377d4daeaba2b Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 25 Jan 2018 21:15:36 +0000 Subject: lifetime management of files generated by tests --- tests/chanio.test | 5 +++++ tests/exec.test | 1 - tests/io.test | 5 +++++ tests/ioCmd.test | 5 +---- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/chanio.test b/tests/chanio.test index 2f2540e..541c20d 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -5732,6 +5732,8 @@ test chan-io-47.6 {file events on shared files, deleting file events} {testfeven chan close $f set x } {{script 1} {}} +unset path(foo) +removeFile foo set path(bar) [makeFile {} bar] @@ -5834,6 +5836,9 @@ test chan-io-48.3 {testing readability conditions} {stdio unix nonBlockFiles ope chan close $f list $x $l } {done {0 1 0 1 0 1 0 1 0 1 0 1 0 0}} +unset path(bar) +removeFile bar + test chan-io-48.4 {lf write, testing readability, ^Z termination, auto read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] diff --git a/tests/exec.test b/tests/exec.test index 810dfa6..7bb8579 100644 --- a/tests/exec.test +++ b/tests/exec.test @@ -287,7 +287,6 @@ test exec-6.3 {redirecting stderr through a pipeline} {exec stdio} { # I/O redirection: combinations. set path(gorp.file2) [makeFile {} gorp.file2] -file delete $path(gorp.file2) test exec-7.1 {multiple I/O redirections} {exec} { exec << "command input" > $path(gorp.file2) [interpreter] $path(cat) < $path(gorp.file) diff --git a/tests/io.test b/tests/io.test index 7275b42..5529881 100644 --- a/tests/io.test +++ b/tests/io.test @@ -6130,6 +6130,8 @@ test io-47.6 {file events on shared files, deleting file events} {testfevent fil close $f set x } {{script 1} {}} +unset path(foo) +removeFile foo set path(bar) [makeFile {} bar] @@ -6232,6 +6234,9 @@ test io-48.3 {testing readability conditions} {stdio unix nonBlockFiles openpipe close $f list $x $l } {done {0 1 0 1 0 1 0 1 0 1 0 1 0 0}} +unset path(bar) +removeFile bar + test io-48.4 {lf write, testing readability, ^Z termination, auto read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 5a76d48..1cb7c74 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -366,7 +366,6 @@ test iocmd-10.5 {fblocked command} { set path(test4) [makeFile {} test4] set path(test5) [makeFile {} test5] -file delete $path(test5) test iocmd-11.1 {I/O to command pipelines} {unixOrPc unixExecs} { set f [open $path(test4) w] close $f @@ -3643,8 +3642,6 @@ foreach file [list test1 test2 test3 test4] { } # delay long enough for background processes to finish after 500 -foreach file [list test5] { - removeFile $file -} +removeFile test5 cleanupTests return -- cgit v0.12