Tcl Source Code

View Ticket
Login
Ticket UUID: 577034
Title: consolidate [make*] and [remove*]
Type: RFE Created on: 2002-07-03 16:08:52
Submitter: dgp Assigned to: dgp
Subsystem: 34. tcltest Package Severity:
Priority: 5 Medium Last modified: 2003-04-04 03:47:32
Status: Open Closed by:
Resolution: None Closed on:
Version: None
Description:
[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.
User Comments:
andreas_kupries added on 2002-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.

andreas_kupries added on 2003-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