Fossil SCM
Work in progress on cleaning up home/repo handling in the test suite.
Commit
89f76a21dda7490449e722f41988f18ba22c54ed
Parent
b06cd631f180430…
11 files changed
+1
-9
+1
-5
+1
-5
+1
-6
+1
-6
+44
-10
+3
-3
+2
-2
+1
-5
+1
-1
+1
-1
+1
-9
| --- test/merge5.test | ||
| +++ test/merge5.test | ||
| @@ -36,19 +36,11 @@ | ||
| 36 | 36 | } else { |
| 37 | 37 | test merge5-$testid 1 |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | -catch {exec $::fossilexe info} res | |
| 42 | -if {![regexp {use --repository} $res]} { | |
| 43 | - puts stderr "Cannot run this test within an open checkout" | |
| 44 | - return | |
| 45 | -} | |
| 46 | -# | |
| 47 | -# Fossil will write data on $HOME, running 'fossil open' here. | |
| 48 | -# We need not to clutter the $HOME of the test caller. | |
| 49 | -set env(HOME) [pwd] | |
| 41 | +require_no_open_checkout; set_home_to_elsewhere | |
| 50 | 42 | |
| 51 | 43 | # Construct a test repository |
| 52 | 44 | # |
| 53 | 45 | exec $::fossilexe sqlite3 --no-repository m5.fossil <$testdir/${testfile}_repo.sql |
| 54 | 46 | fossil rebuild m5.fossil |
| 55 | 47 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -36,19 +36,11 @@ | |
| 36 | } else { |
| 37 | test merge5-$testid 1 |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | catch {exec $::fossilexe info} res |
| 42 | if {![regexp {use --repository} $res]} { |
| 43 | puts stderr "Cannot run this test within an open checkout" |
| 44 | return |
| 45 | } |
| 46 | # |
| 47 | # Fossil will write data on $HOME, running 'fossil open' here. |
| 48 | # We need not to clutter the $HOME of the test caller. |
| 49 | set env(HOME) [pwd] |
| 50 | |
| 51 | # Construct a test repository |
| 52 | # |
| 53 | exec $::fossilexe sqlite3 --no-repository m5.fossil <$testdir/${testfile}_repo.sql |
| 54 | fossil rebuild m5.fossil |
| 55 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -36,19 +36,11 @@ | |
| 36 | } else { |
| 37 | test merge5-$testid 1 |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | require_no_open_checkout; set_home_to_elsewhere |
| 42 | |
| 43 | # Construct a test repository |
| 44 | # |
| 45 | exec $::fossilexe sqlite3 --no-repository m5.fossil <$testdir/${testfile}_repo.sql |
| 46 | fossil rebuild m5.fossil |
| 47 |
+1
-5
| --- test/merge_renames.test | ||
| +++ test/merge_renames.test | ||
| @@ -1,15 +1,11 @@ | ||
| 1 | 1 | # |
| 2 | 2 | # Tests for merging with renames |
| 3 | 3 | # |
| 4 | 4 | # |
| 5 | 5 | |
| 6 | -catch {exec $::fossilexe info} res | |
| 7 | -if {![regexp {use --repository} $res]} { | |
| 8 | - puts stderr "Cannot run this test within an open checkout" | |
| 9 | - return | |
| 10 | -} | |
| 6 | +require_no_open_checkout | |
| 11 | 7 | |
| 12 | 8 | ###################################### |
| 13 | 9 | # Test 1 # |
| 14 | 10 | # Reported: Ticket [554f44ee74e3d] # |
| 15 | 11 | ###################################### |
| 16 | 12 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -1,15 +1,11 @@ | |
| 1 | # |
| 2 | # Tests for merging with renames |
| 3 | # |
| 4 | # |
| 5 | |
| 6 | catch {exec $::fossilexe info} res |
| 7 | if {![regexp {use --repository} $res]} { |
| 8 | puts stderr "Cannot run this test within an open checkout" |
| 9 | return |
| 10 | } |
| 11 | |
| 12 | ###################################### |
| 13 | # Test 1 # |
| 14 | # Reported: Ticket [554f44ee74e3d] # |
| 15 | ###################################### |
| 16 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -1,15 +1,11 @@ | |
| 1 | # |
| 2 | # Tests for merging with renames |
| 3 | # |
| 4 | # |
| 5 | |
| 6 | require_no_open_checkout |
| 7 | |
| 8 | ###################################### |
| 9 | # Test 1 # |
| 10 | # Reported: Ticket [554f44ee74e3d] # |
| 11 | ###################################### |
| 12 |
+1
-5
| --- test/mv-rm.test | ||
| +++ test/mv-rm.test | ||
| @@ -16,15 +16,11 @@ | ||
| 16 | 16 | ############################################################################ |
| 17 | 17 | # |
| 18 | 18 | # MV / RM Commands |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | -catch {exec $::fossilexe info} res | |
| 22 | -if {![regexp {use --repository} $res]} { | |
| 23 | - puts stderr "Cannot run this test within an open checkout" | |
| 24 | - return | |
| 25 | -} | |
| 21 | +require_no_open_checkout | |
| 26 | 22 | |
| 27 | 23 | ######################################## |
| 28 | 24 | # Setup: Add Files and Commit # |
| 29 | 25 | ######################################## |
| 30 | 26 | |
| 31 | 27 |
| --- test/mv-rm.test | |
| +++ test/mv-rm.test | |
| @@ -16,15 +16,11 @@ | |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # MV / RM Commands |
| 19 | # |
| 20 | |
| 21 | catch {exec $::fossilexe info} res |
| 22 | if {![regexp {use --repository} $res]} { |
| 23 | puts stderr "Cannot run this test within an open checkout" |
| 24 | return |
| 25 | } |
| 26 | |
| 27 | ######################################## |
| 28 | # Setup: Add Files and Commit # |
| 29 | ######################################## |
| 30 | |
| 31 |
| --- test/mv-rm.test | |
| +++ test/mv-rm.test | |
| @@ -16,15 +16,11 @@ | |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # MV / RM Commands |
| 19 | # |
| 20 | |
| 21 | require_no_open_checkout |
| 22 | |
| 23 | ######################################## |
| 24 | # Setup: Add Files and Commit # |
| 25 | ######################################## |
| 26 | |
| 27 |
+1
-6
| --- test/revert.test | ||
| +++ test/revert.test | ||
| @@ -54,16 +54,11 @@ | ||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | fossil undo |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | -catch {exec $::fossilexe info} res | |
| 60 | -if {![regexp {use --repository} $res]} { | |
| 61 | - puts stderr "Cannot run this test within an open checkout" | |
| 62 | - return | |
| 63 | -} | |
| 64 | - | |
| 59 | +require_no_open_checkout | |
| 65 | 60 | repo_init |
| 66 | 61 | |
| 67 | 62 | # Prepare first commit |
| 68 | 63 | # |
| 69 | 64 | write_file f1 "f1" |
| 70 | 65 |
| --- test/revert.test | |
| +++ test/revert.test | |
| @@ -54,16 +54,11 @@ | |
| 54 | } |
| 55 | |
| 56 | fossil undo |
| 57 | } |
| 58 | |
| 59 | catch {exec $::fossilexe info} res |
| 60 | if {![regexp {use --repository} $res]} { |
| 61 | puts stderr "Cannot run this test within an open checkout" |
| 62 | return |
| 63 | } |
| 64 | |
| 65 | repo_init |
| 66 | |
| 67 | # Prepare first commit |
| 68 | # |
| 69 | write_file f1 "f1" |
| 70 |
| --- test/revert.test | |
| +++ test/revert.test | |
| @@ -54,16 +54,11 @@ | |
| 54 | } |
| 55 | |
| 56 | fossil undo |
| 57 | } |
| 58 | |
| 59 | require_no_open_checkout |
| 60 | repo_init |
| 61 | |
| 62 | # Prepare first commit |
| 63 | # |
| 64 | write_file f1 "f1" |
| 65 |
+1
-6
| --- test/stash.test | ||
| +++ test/stash.test | ||
| @@ -90,16 +90,11 @@ | ||
| 90 | 90 | proc stash-test {testid stashArgs expectedStashOutput args} { |
| 91 | 91 | fossil stash {*}$stashArgs |
| 92 | 92 | return [test_result_state stash-$testid "stash $stashArgs" $expectedStashOutput {*}$args] |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | -catch {exec $::fossilexe info} res | |
| 96 | -if {![regexp {use --repository} $res]} { | |
| 97 | - puts stderr "Cannot run this test within an open checkout" | |
| 98 | - return | |
| 99 | -} | |
| 100 | - | |
| 95 | +require_no_open_checkout | |
| 101 | 96 | repo_init |
| 102 | 97 | |
| 103 | 98 | # Prepare first commit |
| 104 | 99 | # |
| 105 | 100 | write_file f1 "f1" |
| 106 | 101 |
| --- test/stash.test | |
| +++ test/stash.test | |
| @@ -90,16 +90,11 @@ | |
| 90 | proc stash-test {testid stashArgs expectedStashOutput args} { |
| 91 | fossil stash {*}$stashArgs |
| 92 | return [test_result_state stash-$testid "stash $stashArgs" $expectedStashOutput {*}$args] |
| 93 | } |
| 94 | |
| 95 | catch {exec $::fossilexe info} res |
| 96 | if {![regexp {use --repository} $res]} { |
| 97 | puts stderr "Cannot run this test within an open checkout" |
| 98 | return |
| 99 | } |
| 100 | |
| 101 | repo_init |
| 102 | |
| 103 | # Prepare first commit |
| 104 | # |
| 105 | write_file f1 "f1" |
| 106 |
| --- test/stash.test | |
| +++ test/stash.test | |
| @@ -90,16 +90,11 @@ | |
| 90 | proc stash-test {testid stashArgs expectedStashOutput args} { |
| 91 | fossil stash {*}$stashArgs |
| 92 | return [test_result_state stash-$testid "stash $stashArgs" $expectedStashOutput {*}$args] |
| 93 | } |
| 94 | |
| 95 | require_no_open_checkout |
| 96 | repo_init |
| 97 | |
| 98 | # Prepare first commit |
| 99 | # |
| 100 | write_file f1 "f1" |
| 101 |
+44
-10
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -189,23 +189,48 @@ | ||
| 189 | 189 | set y [read_file $b] |
| 190 | 190 | regsub -all { +\n} $y \n y |
| 191 | 191 | return [expr {$x==$y}] |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | +proc require_no_open_checkout {} { | |
| 195 | + catch {exec $::fossilexe info} res | |
| 196 | + if {![regexp {use --repository} $res]} { | |
| 197 | + set projectName <unknown> | |
| 198 | + set localRoot <unknown> | |
| 199 | + regexp -line -- {^project-name: (.*)$} $res dummy projectName | |
| 200 | + set projectName [string trim $projectName] | |
| 201 | + regexp -line -- {^local-root: (.*)$} $res dummy localRoot | |
| 202 | + set localRoot [string trim $localRoot] | |
| 203 | + error "Detected an open checkout of project \"$projectName\",\ | |
| 204 | +rooted at \"$localRoot\", testing halted" | |
| 205 | + } | |
| 206 | +} | |
| 207 | + | |
| 208 | +proc is_home_elsewhere {} { | |
| 209 | + return [expr {[info exists ::env(FOSSIL_HOME)] && \ | |
| 210 | + $::env(FOSSIL_HOME) eq $::tempHomePath}] | |
| 211 | +} | |
| 212 | + | |
| 213 | +proc set_home_to_elsewhere {} { | |
| 214 | + # | |
| 215 | + # Fossil will write data on $HOME (or $FOSSIL_HOME). We need not | |
| 216 | + # to clutter the real $HOME (or $FOSSIL_HOME) of the test caller. | |
| 217 | + # | |
| 218 | + if {[is_home_elsewhere]} { | |
| 219 | + protOut "***** FOSSIL_HOME is already elsewhere" | |
| 220 | + return | |
| 221 | + } | |
| 222 | + set ::env(FOSSIL_HOME) $::tempHomePath | |
| 223 | +} | |
| 224 | + | |
| 225 | +# | |
| 194 | 226 | # Create and open a new Fossil repository and clean the checkout |
| 195 | 227 | # |
| 196 | 228 | proc repo_init {{filename ".rep.fossil"}} { |
| 197 | - if {$::env(HOME) ne [pwd]} { | |
| 198 | - catch {exec $::fossilexe info} res | |
| 199 | - if {![regexp {use --repository} $res]} { | |
| 200 | - error "In an open checkout: cannot initialize a new repository here." | |
| 201 | - } | |
| 202 | - # Fossil will write data on $FOSSIL_HOME, running 'fossil new' here. | |
| 203 | - # We need not to clutter the $HOME of the test caller. | |
| 204 | - # | |
| 205 | - set ::env(FOSSIL_HOME) [pwd] | |
| 206 | - set ::env(HOME) [pwd] | |
| 229 | + if {![is_home_elsewhere]} { | |
| 230 | + require_no_open_checkout | |
| 231 | + set_home_to_elsewhere | |
| 207 | 232 | } |
| 208 | 233 | catch {exec $::fossilexe close -f} |
| 209 | 234 | file delete $filename |
| 210 | 235 | exec $::fossilexe new $filename |
| 211 | 236 | exec $::fossilexe open $filename |
| @@ -513,10 +538,19 @@ | ||
| 513 | 538 | write_file [file join $tempPath temporary.txt] [clock seconds] |
| 514 | 539 | } error] != 0} { |
| 515 | 540 | error "could not write file to directory \"$tempPath\",\ |
| 516 | 541 | please set TEMP variable in environment: $error" |
| 517 | 542 | } |
| 543 | + | |
| 544 | +set tempHomePath [file join $tempPath home_[pid]] | |
| 545 | + | |
| 546 | +if {[catch { | |
| 547 | + file mkdir $tempHomePath | |
| 548 | +} error] != 0} { | |
| 549 | + error "could not make directory \"$tempHomePath\",\ | |
| 550 | +please set TEMP variable in environment: $error" | |
| 551 | +} | |
| 518 | 552 | |
| 519 | 553 | protInit $fossilexe |
| 520 | 554 | foreach testfile $argv { |
| 521 | 555 | set dir [file root [file tail $testfile]] |
| 522 | 556 | file delete -force $dir |
| 523 | 557 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -189,23 +189,48 @@ | |
| 189 | set y [read_file $b] |
| 190 | regsub -all { +\n} $y \n y |
| 191 | return [expr {$x==$y}] |
| 192 | } |
| 193 | |
| 194 | # Create and open a new Fossil repository and clean the checkout |
| 195 | # |
| 196 | proc repo_init {{filename ".rep.fossil"}} { |
| 197 | if {$::env(HOME) ne [pwd]} { |
| 198 | catch {exec $::fossilexe info} res |
| 199 | if {![regexp {use --repository} $res]} { |
| 200 | error "In an open checkout: cannot initialize a new repository here." |
| 201 | } |
| 202 | # Fossil will write data on $FOSSIL_HOME, running 'fossil new' here. |
| 203 | # We need not to clutter the $HOME of the test caller. |
| 204 | # |
| 205 | set ::env(FOSSIL_HOME) [pwd] |
| 206 | set ::env(HOME) [pwd] |
| 207 | } |
| 208 | catch {exec $::fossilexe close -f} |
| 209 | file delete $filename |
| 210 | exec $::fossilexe new $filename |
| 211 | exec $::fossilexe open $filename |
| @@ -513,10 +538,19 @@ | |
| 513 | write_file [file join $tempPath temporary.txt] [clock seconds] |
| 514 | } error] != 0} { |
| 515 | error "could not write file to directory \"$tempPath\",\ |
| 516 | please set TEMP variable in environment: $error" |
| 517 | } |
| 518 | |
| 519 | protInit $fossilexe |
| 520 | foreach testfile $argv { |
| 521 | set dir [file root [file tail $testfile]] |
| 522 | file delete -force $dir |
| 523 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -189,23 +189,48 @@ | |
| 189 | set y [read_file $b] |
| 190 | regsub -all { +\n} $y \n y |
| 191 | return [expr {$x==$y}] |
| 192 | } |
| 193 | |
| 194 | proc require_no_open_checkout {} { |
| 195 | catch {exec $::fossilexe info} res |
| 196 | if {![regexp {use --repository} $res]} { |
| 197 | set projectName <unknown> |
| 198 | set localRoot <unknown> |
| 199 | regexp -line -- {^project-name: (.*)$} $res dummy projectName |
| 200 | set projectName [string trim $projectName] |
| 201 | regexp -line -- {^local-root: (.*)$} $res dummy localRoot |
| 202 | set localRoot [string trim $localRoot] |
| 203 | error "Detected an open checkout of project \"$projectName\",\ |
| 204 | rooted at \"$localRoot\", testing halted" |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | proc is_home_elsewhere {} { |
| 209 | return [expr {[info exists ::env(FOSSIL_HOME)] && \ |
| 210 | $::env(FOSSIL_HOME) eq $::tempHomePath}] |
| 211 | } |
| 212 | |
| 213 | proc set_home_to_elsewhere {} { |
| 214 | # |
| 215 | # Fossil will write data on $HOME (or $FOSSIL_HOME). We need not |
| 216 | # to clutter the real $HOME (or $FOSSIL_HOME) of the test caller. |
| 217 | # |
| 218 | if {[is_home_elsewhere]} { |
| 219 | protOut "***** FOSSIL_HOME is already elsewhere" |
| 220 | return |
| 221 | } |
| 222 | set ::env(FOSSIL_HOME) $::tempHomePath |
| 223 | } |
| 224 | |
| 225 | # |
| 226 | # Create and open a new Fossil repository and clean the checkout |
| 227 | # |
| 228 | proc repo_init {{filename ".rep.fossil"}} { |
| 229 | if {![is_home_elsewhere]} { |
| 230 | require_no_open_checkout |
| 231 | set_home_to_elsewhere |
| 232 | } |
| 233 | catch {exec $::fossilexe close -f} |
| 234 | file delete $filename |
| 235 | exec $::fossilexe new $filename |
| 236 | exec $::fossilexe open $filename |
| @@ -513,10 +538,19 @@ | |
| 538 | write_file [file join $tempPath temporary.txt] [clock seconds] |
| 539 | } error] != 0} { |
| 540 | error "could not write file to directory \"$tempPath\",\ |
| 541 | please set TEMP variable in environment: $error" |
| 542 | } |
| 543 | |
| 544 | set tempHomePath [file join $tempPath home_[pid]] |
| 545 | |
| 546 | if {[catch { |
| 547 | file mkdir $tempHomePath |
| 548 | } error] != 0} { |
| 549 | error "could not make directory \"$tempHomePath\",\ |
| 550 | please set TEMP variable in environment: $error" |
| 551 | } |
| 552 | |
| 553 | protInit $fossilexe |
| 554 | foreach testfile $argv { |
| 555 | set dir [file root [file tail $testfile]] |
| 556 | file delete -force $dir |
| 557 |
+3
-3
| --- test/th1-docs.test | ||
| +++ test/th1-docs.test | ||
| @@ -18,17 +18,17 @@ | ||
| 18 | 18 | # TH1 Docs |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | fossil test-th-eval "hasfeature th1Docs" |
| 22 | 22 | |
| 23 | -if {$::RESULT ne "1"} then { | |
| 23 | +if {$::RESULT ne "1"} { | |
| 24 | 24 | puts "Fossil was not compiled with TH1 docs support."; return |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | fossil test-th-eval "hasfeature tcl" |
| 28 | 28 | |
| 29 | -if {$::RESULT ne "1"} then { | |
| 29 | +if {$::RESULT ne "1"} { | |
| 30 | 30 | puts "Fossil was not compiled with Tcl support."; return |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | ############################################################################### |
| 34 | 34 | |
| @@ -41,11 +41,11 @@ | ||
| 41 | 41 | set data [fossil info] |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 45 | 45 | |
| 46 | -if {[string length $repository] == 0 || ![file exists $repository]} then { | |
| 46 | +if {[string length $repository] == 0 || ![file exists $repository]} { | |
| 47 | 47 | error "unable to locate repository" |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | set dataFileName [file join $::testdir th1-docs-input.txt] |
| 51 | 51 | |
| 52 | 52 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -18,17 +18,17 @@ | |
| 18 | # TH1 Docs |
| 19 | # |
| 20 | |
| 21 | fossil test-th-eval "hasfeature th1Docs" |
| 22 | |
| 23 | if {$::RESULT ne "1"} then { |
| 24 | puts "Fossil was not compiled with TH1 docs support."; return |
| 25 | } |
| 26 | |
| 27 | fossil test-th-eval "hasfeature tcl" |
| 28 | |
| 29 | if {$::RESULT ne "1"} then { |
| 30 | puts "Fossil was not compiled with Tcl support."; return |
| 31 | } |
| 32 | |
| 33 | ############################################################################### |
| 34 | |
| @@ -41,11 +41,11 @@ | |
| 41 | set data [fossil info] |
| 42 | } |
| 43 | |
| 44 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 45 | |
| 46 | if {[string length $repository] == 0 || ![file exists $repository]} then { |
| 47 | error "unable to locate repository" |
| 48 | } |
| 49 | |
| 50 | set dataFileName [file join $::testdir th1-docs-input.txt] |
| 51 | |
| 52 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -18,17 +18,17 @@ | |
| 18 | # TH1 Docs |
| 19 | # |
| 20 | |
| 21 | fossil test-th-eval "hasfeature th1Docs" |
| 22 | |
| 23 | if {$::RESULT ne "1"} { |
| 24 | puts "Fossil was not compiled with TH1 docs support."; return |
| 25 | } |
| 26 | |
| 27 | fossil test-th-eval "hasfeature tcl" |
| 28 | |
| 29 | if {$::RESULT ne "1"} { |
| 30 | puts "Fossil was not compiled with Tcl support."; return |
| 31 | } |
| 32 | |
| 33 | ############################################################################### |
| 34 | |
| @@ -41,11 +41,11 @@ | |
| 41 | set data [fossil info] |
| 42 | } |
| 43 | |
| 44 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 45 | |
| 46 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 47 | error "unable to locate repository" |
| 48 | } |
| 49 | |
| 50 | set dataFileName [file join $::testdir th1-docs-input.txt] |
| 51 | |
| 52 |
+2
-2
| --- test/th1-hooks.test | ||
| +++ test/th1-hooks.test | ||
| @@ -18,11 +18,11 @@ | ||
| 18 | 18 | # TH1 Hooks |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | fossil test-th-eval "hasfeature th1Hooks" |
| 22 | 22 | |
| 23 | -if {$::RESULT ne "1"} then { | |
| 23 | +if {$::RESULT ne "1"} { | |
| 24 | 24 | puts "Fossil was not compiled with TH1 hooks support."; return |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | ############################################################################### |
| 28 | 28 | |
| @@ -106,11 +106,11 @@ | ||
| 106 | 106 | ############################################################################### |
| 107 | 107 | |
| 108 | 108 | set data [fossil info] |
| 109 | 109 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 110 | 110 | |
| 111 | -if {[string length $repository] == 0 || ![file exists $repository]} then { | |
| 111 | +if {[string length $repository] == 0 || ![file exists $repository]} { | |
| 112 | 112 | error "unable to locate repository" |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | set dataFileName [file join $::testdir th1-hooks-input.txt] |
| 116 | 116 | |
| 117 | 117 |
| --- test/th1-hooks.test | |
| +++ test/th1-hooks.test | |
| @@ -18,11 +18,11 @@ | |
| 18 | # TH1 Hooks |
| 19 | # |
| 20 | |
| 21 | fossil test-th-eval "hasfeature th1Hooks" |
| 22 | |
| 23 | if {$::RESULT ne "1"} then { |
| 24 | puts "Fossil was not compiled with TH1 hooks support."; return |
| 25 | } |
| 26 | |
| 27 | ############################################################################### |
| 28 | |
| @@ -106,11 +106,11 @@ | |
| 106 | ############################################################################### |
| 107 | |
| 108 | set data [fossil info] |
| 109 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 110 | |
| 111 | if {[string length $repository] == 0 || ![file exists $repository]} then { |
| 112 | error "unable to locate repository" |
| 113 | } |
| 114 | |
| 115 | set dataFileName [file join $::testdir th1-hooks-input.txt] |
| 116 | |
| 117 |
| --- test/th1-hooks.test | |
| +++ test/th1-hooks.test | |
| @@ -18,11 +18,11 @@ | |
| 18 | # TH1 Hooks |
| 19 | # |
| 20 | |
| 21 | fossil test-th-eval "hasfeature th1Hooks" |
| 22 | |
| 23 | if {$::RESULT ne "1"} { |
| 24 | puts "Fossil was not compiled with TH1 hooks support."; return |
| 25 | } |
| 26 | |
| 27 | ############################################################################### |
| 28 | |
| @@ -106,11 +106,11 @@ | |
| 106 | ############################################################################### |
| 107 | |
| 108 | set data [fossil info] |
| 109 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 110 | |
| 111 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 112 | error "unable to locate repository" |
| 113 | } |
| 114 | |
| 115 | set dataFileName [file join $::testdir th1-hooks-input.txt] |
| 116 | |
| 117 |
+1
-5
| --- test/th1-repo.test | ||
| +++ test/th1-repo.test | ||
| @@ -19,15 +19,11 @@ | ||
| 19 | 19 | ############################################################################ |
| 20 | 20 | # |
| 21 | 21 | # TH1 tests that may modify the repository |
| 22 | 22 | # |
| 23 | 23 | |
| 24 | -catch {exec $::fossilexe info} res | |
| 25 | -if {![regexp {use --repository} $res]} { | |
| 26 | - puts stderr "Cannot run this test within an open checkout" | |
| 27 | - return | |
| 28 | -} | |
| 24 | +require_no_open_checkout | |
| 29 | 25 | |
| 30 | 26 | ######################################## |
| 31 | 27 | # Setup: Add Files and Commit # |
| 32 | 28 | ######################################## |
| 33 | 29 | |
| 34 | 30 |
| --- test/th1-repo.test | |
| +++ test/th1-repo.test | |
| @@ -19,15 +19,11 @@ | |
| 19 | ############################################################################ |
| 20 | # |
| 21 | # TH1 tests that may modify the repository |
| 22 | # |
| 23 | |
| 24 | catch {exec $::fossilexe info} res |
| 25 | if {![regexp {use --repository} $res]} { |
| 26 | puts stderr "Cannot run this test within an open checkout" |
| 27 | return |
| 28 | } |
| 29 | |
| 30 | ######################################## |
| 31 | # Setup: Add Files and Commit # |
| 32 | ######################################## |
| 33 | |
| 34 |
| --- test/th1-repo.test | |
| +++ test/th1-repo.test | |
| @@ -19,15 +19,11 @@ | |
| 19 | ############################################################################ |
| 20 | # |
| 21 | # TH1 tests that may modify the repository |
| 22 | # |
| 23 | |
| 24 | require_no_open_checkout |
| 25 | |
| 26 | ######################################## |
| 27 | # Setup: Add Files and Commit # |
| 28 | ######################################## |
| 29 | |
| 30 |
+1
-1
| --- test/th1-tcl.test | ||
| +++ test/th1-tcl.test | ||
| @@ -26,11 +26,11 @@ | ||
| 26 | 26 | |
| 27 | 27 | ############################################################################### |
| 28 | 28 | |
| 29 | 29 | fossil test-th-eval "hasfeature tcl" |
| 30 | 30 | |
| 31 | -if {$::RESULT ne "1"} then { | |
| 31 | +if {$::RESULT ne "1"} { | |
| 32 | 32 | puts "Fossil was not compiled with Tcl support."; return |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | ############################################################################### |
| 36 | 36 | |
| 37 | 37 |
| --- test/th1-tcl.test | |
| +++ test/th1-tcl.test | |
| @@ -26,11 +26,11 @@ | |
| 26 | |
| 27 | ############################################################################### |
| 28 | |
| 29 | fossil test-th-eval "hasfeature tcl" |
| 30 | |
| 31 | if {$::RESULT ne "1"} then { |
| 32 | puts "Fossil was not compiled with Tcl support."; return |
| 33 | } |
| 34 | |
| 35 | ############################################################################### |
| 36 | |
| 37 |
| --- test/th1-tcl.test | |
| +++ test/th1-tcl.test | |
| @@ -26,11 +26,11 @@ | |
| 26 | |
| 27 | ############################################################################### |
| 28 | |
| 29 | fossil test-th-eval "hasfeature tcl" |
| 30 | |
| 31 | if {$::RESULT ne "1"} { |
| 32 | puts "Fossil was not compiled with Tcl support."; return |
| 33 | } |
| 34 | |
| 35 | ############################################################################### |
| 36 | |
| 37 |
+1
-1
| --- test/th1.test | ||
| +++ test/th1.test | ||
| @@ -884,11 +884,11 @@ | ||
| 884 | 884 | fossil test-th-eval "globalState vfs" |
| 885 | 885 | test th1-globalState-14 {[string length $RESULT] == 0} |
| 886 | 886 | |
| 887 | 887 | ############################################################################### |
| 888 | 888 | |
| 889 | -if {$tcl_platform(platform) eq "windows"} then { | |
| 889 | +if {$tcl_platform(platform) eq "windows"} { | |
| 890 | 890 | set altVfs win32-longpath |
| 891 | 891 | } else { |
| 892 | 892 | set altVfs unix-dotfile |
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -884,11 +884,11 @@ | |
| 884 | fossil test-th-eval "globalState vfs" |
| 885 | test th1-globalState-14 {[string length $RESULT] == 0} |
| 886 | |
| 887 | ############################################################################### |
| 888 | |
| 889 | if {$tcl_platform(platform) eq "windows"} then { |
| 890 | set altVfs win32-longpath |
| 891 | } else { |
| 892 | set altVfs unix-dotfile |
| 893 | } |
| 894 | |
| 895 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -884,11 +884,11 @@ | |
| 884 | fossil test-th-eval "globalState vfs" |
| 885 | test th1-globalState-14 {[string length $RESULT] == 0} |
| 886 | |
| 887 | ############################################################################### |
| 888 | |
| 889 | if {$tcl_platform(platform) eq "windows"} { |
| 890 | set altVfs win32-longpath |
| 891 | } else { |
| 892 | set altVfs unix-dotfile |
| 893 | } |
| 894 | |
| 895 |