| | @@ -199,11 +199,11 @@ |
| 199 | 199 | regexp -line -- {^project-name: (.*)$} $res dummy projectName |
| 200 | 200 | set projectName [string trim $projectName] |
| 201 | 201 | regexp -line -- {^local-root: (.*)$} $res dummy localRoot |
| 202 | 202 | set localRoot [string trim $localRoot] |
| 203 | 203 | error "Detected an open checkout of project \"$projectName\",\ |
| 204 | | -rooted at \"$localRoot\", testing halted" |
| 204 | +rooted at \"$localRoot\", testing halted." |
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | proc get_script_or_fail {} { |
| 209 | 209 | set fileName [file normalize [info script]] |
| | @@ -225,11 +225,11 @@ |
| 225 | 225 | return |
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | after [expr {$try * 100}] |
| 229 | 229 | } |
| 230 | | - error "cannot delete \"$path\": $error" |
| 230 | + error "Could not delete \"$path\", error: $error" |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | proc test_cleanup {} { |
| 234 | 234 | if {![info exists ::tempRepoPath]} {return} |
| 235 | 235 | if {![file exists $::tempRepoPath]} {return} |
| | @@ -250,11 +250,16 @@ |
| 250 | 250 | robust_delete $seedPath; # NO FORCE. |
| 251 | 251 | } |
| 252 | 252 | # Next, attempt to gracefully delete the temporary repository directory |
| 253 | 253 | # for this process. |
| 254 | 254 | robust_delete $::tempRepoPath |
| 255 | | - # Finally, attempt to gracefully delete the temporary home directory. |
| 255 | + # Finally, attempt to gracefully delete the temporary home directory, |
| 256 | + # unless forbidden by external forces. |
| 257 | + if {![info exists ::tempKeepHome]} {delete_temporary_home} |
| 258 | +} |
| 259 | + |
| 260 | +proc delete_temporary_home {} { |
| 256 | 261 | if {$::tcl_platform(platform) eq "windows"} { |
| 257 | 262 | robust_delete [file join $::tempHomePath _fossil] |
| 258 | 263 | } else { |
| 259 | 264 | robust_delete [file join $::tempHomePath .fossil] |
| 260 | 265 | } |
| | @@ -278,25 +283,29 @@ |
| 278 | 283 | # |
| 279 | 284 | # Create and open a new Fossil repository and clean the checkout |
| 280 | 285 | # |
| 281 | 286 | proc repo_init {{filename ".rep.fossil"}} { |
| 282 | 287 | set_home_to_elsewhere |
| 283 | | - set ::tempRepoPath [file join $::tempPath repo_[pid]] |
| 288 | + if {![info exists ::tempRepoPath]} { |
| 289 | + set ::tempRepoPath [file join $::tempPath repo_[pid]] |
| 290 | + } |
| 284 | 291 | set repoSeed [appendArgs [string trim [clock seconds] -] _ [getSeqNo]] |
| 285 | 292 | lappend ::tempRepoSeeds $repoSeed |
| 286 | 293 | set repoPath [file join \ |
| 287 | 294 | $::tempRepoPath $repoSeed [file tail [get_script_or_fail]]] |
| 288 | 295 | if {[catch { |
| 289 | 296 | file mkdir $repoPath |
| 290 | 297 | } error] != 0} { |
| 291 | | - error "could not make directory \"$repoPath\",\ |
| 292 | | -please set TEMP variable in environment: $error" |
| 298 | + error "Could not make directory \"$repoPath\",\ |
| 299 | +please set TEMP variable in environment, error: $error" |
| 293 | 300 | } |
| 294 | 301 | if {![info exists ::tempSavedPwd]} {set ::tempSavedPwd [pwd]}; cd $repoPath |
| 295 | | - exec $::fossilexe new $filename |
| 296 | | - exec $::fossilexe open $filename |
| 297 | | - exec $::fossilexe set mtime-changes off |
| 302 | + if {[string length $filename] > 0} { |
| 303 | + exec $::fossilexe new $filename |
| 304 | + exec $::fossilexe open $filename |
| 305 | + exec $::fossilexe set mtime-changes off |
| 306 | + } |
| 298 | 307 | } |
| 299 | 308 | |
| 300 | 309 | # This procedure only returns non-zero if the Tcl integration feature was |
| 301 | 310 | # enabled at compile-time and is now enabled at runtime. |
| 302 | 311 | proc is_tcl_usable_by_fossil {} { |
| | @@ -595,35 +604,31 @@ |
| 595 | 604 | |
| 596 | 605 | if {[catch { |
| 597 | 606 | set tempFile [file join $tempPath temporary.txt] |
| 598 | 607 | write_file $tempFile [clock seconds]; file delete $tempFile |
| 599 | 608 | } error] != 0} { |
| 600 | | - error "could not write file \"$tempFile\" in directory \"$tempPath\",\ |
| 601 | | -please set TEMP variable in environment: $error" |
| 609 | + error "Could not write file \"$tempFile\" in directory \"$tempPath\",\ |
| 610 | +please set TEMP variable in environment, error: $error" |
| 602 | 611 | } |
| 603 | 612 | |
| 604 | 613 | set tempHomePath [file join $tempPath home_[pid]] |
| 605 | 614 | |
| 606 | 615 | if {[catch { |
| 607 | 616 | file mkdir $tempHomePath |
| 608 | 617 | } error] != 0} { |
| 609 | | - error "could not make directory \"$tempHomePath\",\ |
| 610 | | -please set TEMP variable in environment: $error" |
| 618 | + error "Could not make directory \"$tempHomePath\",\ |
| 619 | +please set TEMP variable in environment, error: $error" |
| 611 | 620 | } |
| 612 | 621 | |
| 613 | 622 | protInit $fossilexe |
| 623 | +set ::tempKeepHome 1 |
| 614 | 624 | foreach testfile $argv { |
| 615 | | - set dir [file root [file tail $testfile]] |
| 616 | | - file delete -force $dir |
| 617 | | - file mkdir $dir |
| 618 | | - set origwd [pwd] |
| 619 | | - cd $dir |
| 620 | 625 | protOut "***** $testfile ******" |
| 621 | 626 | source $testdir/$testfile.test |
| 622 | 627 | protOut "***** End of $testfile: [llength $bad_test] errors so far ******" |
| 623 | | - cd $origwd |
| 624 | 628 | } |
| 629 | +unset ::tempKeepHome; delete_temporary_home |
| 625 | 630 | set nErr [llength $bad_test] |
| 626 | 631 | if {$nErr>0 || !$::QUIET} { |
| 627 | 632 | protOut "***** Final results: $nErr errors out of $test_count tests" 1 |
| 628 | 633 | } |
| 629 | 634 | if {$nErr>0} { |
| 630 | 635 | |