Tcl Source Code

Check-in [0108bf4c0e]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:RFE [61fa4879ed] implementation - use system temp-folder as default temporary directory in the test-suite
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | rfe-61fa4879ed
Files: files | file ages | folders
SHA3-256: 0108bf4c0edf17824b5a866cb488a1e1327ac739fafe6416a77a7f1aa12b49a2
User & Date: sebres 2018-07-16 14:32:01
References
2018-07-16
14:35 Pending ticket [61fa4879ed]: RFE: use system temp-folder as default temporary directory in test-suite plus 3 other changes artifact: 247de65d4a user: sebres
Context
2018-07-16
14:32
RFE [61fa4879ed] implementation - use system temp-folder as default temporary directory in the test-... Closed-Leaf check-in: 0108bf4c0e user: sebres tags: rfe-61fa4879ed
2018-07-12
14:17
win: closes [3f7af0e21e13f1f5] - avoid "permissions denied" by `file delete`, if file stat (TclpObjS... check-in: 4af9ff473e user: sebres tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to library/tcltest/tcltest.tcl.

727
728
729
730
731
732
733









734
735
736
737
738
739
740
...
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
    # Default is to run each test file in a separate process
    Option -singleproc 0 {
	whether to run all tests in one process
    } AcceptBoolean singleProcess 

    proc AcceptTemporaryDirectory { directory } {









	set directory [AcceptAbsolutePath $directory]
	if {![file exists $directory]} {
	    file mkdir $directory
	}
	set directory [AcceptDirectory $directory]
	if {![file writable $directory]} {
	    if {[workingDirectory] eq $directory} {
................................................................................
	    }
	    return -code error "\"$directory\" is not writeable"
	}
	return $directory
    }

    # Directory where files should be created
    Option -tmpdir [workingDirectory] {
	Save temporary files in the specified directory.
    } AcceptTemporaryDirectory temporaryDirectory
    trace add variable Option(-tmpdir) write \
	    [namespace code {normalizePath Option(-tmpdir) ;#}]

    # Tests should not rely on the current working directory.
    # Files that are part of the test suite should be accessed relative






>
>
>
>
>
>
>
>
>







 







|







727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
...
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
    # Default is to run each test file in a separate process
    Option -singleproc 0 {
	whether to run all tests in one process
    } AcceptBoolean singleProcess 

    proc AcceptTemporaryDirectory { directory } {
	if {$directory eq ""} {
	    if {[info exists ::env(TEMP)] && [file exists $::env(TEMP)]} {
		return $::env(TEMP)
	    } elseif {[file exists /tmp] && [file writable /tmp]} {
		return /tmp
	    } else {
		set directory [workingDirectory]
	    }
	}
	set directory [AcceptAbsolutePath $directory]
	if {![file exists $directory]} {
	    file mkdir $directory
	}
	set directory [AcceptDirectory $directory]
	if {![file writable $directory]} {
	    if {[workingDirectory] eq $directory} {
................................................................................
	    }
	    return -code error "\"$directory\" is not writeable"
	}
	return $directory
    }

    # Directory where files should be created
    Option -tmpdir [AcceptTemporaryDirectory ""] {
	Save temporary files in the specified directory.
    } AcceptTemporaryDirectory temporaryDirectory
    trace add variable Option(-tmpdir) write \
	    [namespace code {normalizePath Option(-tmpdir) ;#}]

    # Tests should not rely on the current working directory.
    # Files that are part of the test suite should be accessed relative