Skip to content
Tcl Source Code View Ticket
Login

View Ticket

consolidate [make*] and [remove*]

Open577034ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-07-03 16:08:52
[makeFile] and [makeDirectory] create files and
directories.
[removeFile] and [removeDirectory] remove them, and
if [cleanupTests] discovers they have not been removed,
it removes them anyway.

This kind of fail-safe cleanup is useful for more than
files and directories.   The existence of the
cleanupTestsHook command testifies that people
have a need to add more cleanup operations to
[cleanupTests].

Instead new commands [make] and [remove] should
be introduced (maybe as subcommands of one
command, [resource] ?) that is extensible to control
the fail-safe cleanup of any resource needed by a
test.
andreas_kupriesplain2002-07-04 22:57:01
Logged In: YES 
user_id=75003

Proposal: Have the make command remember full paths, etc. 
and provide a retrieve command which returns it, use the 
filename as key.

Example using the old functions:

Instead of 
   set path(foo) [makeFile {...} foo]
and later
   $path(foo)

use
   makeFile {..} foo
and later
  [pathOf foo]

Much nicer than to provide the framework for remembering 
stuff in each test file.
dgp Ticket [577034ffff]: 1 change [History diff]2002-07-07 01:01:58
andreas_kupriesplain2003-04-04 03:47:32
Logged In: YES 
user_id=75003

Note tcllib bug "[ 714214 ] test failures: fileutils module" for an 
instance where [makeFile] was used for the creation of binary 
data, and failing. The problem is currently being worked 
around, but it should be kept in mind as a place to change 
when this FR is implemented.

https://sourceforge.net/tracker/index.php?
func=detail&aid=714214&group_id=12883&atid=112883
Log in (anonymous is fine) to add a comment.