Fossil SCM
Set the FOSSIL_HOME envvar before each test. Use the root test run directory instead of the directories created for each test file so the config DB file on Windows doesn't mess up tests of commands like addremove and extras.
Commit
d4907f17fbaf46cc5135c5ae46ba331725a7ebee
Parent
a9e3db1f707d499…
2 files changed
-4
+4
-11
-4
| --- test/merge5.test | ||
| +++ test/merge5.test | ||
| @@ -41,14 +41,10 @@ | ||
| 41 | 41 | catch {exec $::fossilexe info} res |
| 42 | 42 | if {![regexp {use --repository} $res]} { |
| 43 | 43 | puts stderr "Cannot run this test within an open checkout" |
| 44 | 44 | return |
| 45 | 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 | 46 | |
| 51 | 47 | # Construct a test repository |
| 52 | 48 | # |
| 53 | 49 | exec $::fossilexe sqlite3 --no-repository m5.fossil <$testdir/${testfile}_repo.sql |
| 54 | 50 | fossil rebuild m5.fossil |
| 55 | 51 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -41,14 +41,10 @@ | |
| 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 | |
| @@ -41,14 +41,10 @@ | |
| 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 | # Construct a test repository |
| 48 | # |
| 49 | exec $::fossilexe sqlite3 --no-repository m5.fossil <$testdir/${testfile}_repo.sql |
| 50 | fossil rebuild m5.fossil |
| 51 |
+4
-11
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -192,21 +192,10 @@ | ||
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | # Create and open a new Fossil repository and clean the checkout |
| 195 | 195 | # |
| 196 | 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 | 197 | catch {exec $::fossilexe close -f} |
| 209 | 198 | file delete $filename |
| 210 | 199 | exec $::fossilexe new $filename |
| 211 | 200 | exec $::fossilexe open $filename |
| 212 | 201 | exec $::fossilexe clean -f |
| @@ -521,10 +510,14 @@ | ||
| 521 | 510 | set dir [file root [file tail $testfile]] |
| 522 | 511 | file delete -force $dir |
| 523 | 512 | file mkdir $dir |
| 524 | 513 | set origwd [pwd] |
| 525 | 514 | cd $dir |
| 515 | + # FOSSIL_HOME overrides the location of the configuration database. Set this | |
| 516 | + # here so as not to pollute the user's normal settings and repository lists. | |
| 517 | + # Done before every test in case it gets modified. | |
| 518 | + set env(FOSSIL_HOME) $origwd | |
| 526 | 519 | protOut "***** $testfile ******" |
| 527 | 520 | source $testdir/$testfile.test |
| 528 | 521 | protOut "***** End of $testfile: [llength $bad_test] errors so far ******" |
| 529 | 522 | cd $origwd |
| 530 | 523 | } |
| 531 | 524 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -192,21 +192,10 @@ | |
| 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 |
| 212 | exec $::fossilexe clean -f |
| @@ -521,10 +510,14 @@ | |
| 521 | set dir [file root [file tail $testfile]] |
| 522 | file delete -force $dir |
| 523 | file mkdir $dir |
| 524 | set origwd [pwd] |
| 525 | cd $dir |
| 526 | protOut "***** $testfile ******" |
| 527 | source $testdir/$testfile.test |
| 528 | protOut "***** End of $testfile: [llength $bad_test] errors so far ******" |
| 529 | cd $origwd |
| 530 | } |
| 531 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -192,21 +192,10 @@ | |
| 192 | } |
| 193 | |
| 194 | # Create and open a new Fossil repository and clean the checkout |
| 195 | # |
| 196 | proc repo_init {{filename ".rep.fossil"}} { |
| 197 | catch {exec $::fossilexe close -f} |
| 198 | file delete $filename |
| 199 | exec $::fossilexe new $filename |
| 200 | exec $::fossilexe open $filename |
| 201 | exec $::fossilexe clean -f |
| @@ -521,10 +510,14 @@ | |
| 510 | set dir [file root [file tail $testfile]] |
| 511 | file delete -force $dir |
| 512 | file mkdir $dir |
| 513 | set origwd [pwd] |
| 514 | cd $dir |
| 515 | # FOSSIL_HOME overrides the location of the configuration database. Set this |
| 516 | # here so as not to pollute the user's normal settings and repository lists. |
| 517 | # Done before every test in case it gets modified. |
| 518 | set env(FOSSIL_HOME) $origwd |
| 519 | protOut "***** $testfile ******" |
| 520 | source $testdir/$testfile.test |
| 521 | protOut "***** End of $testfile: [llength $bad_test] errors so far ******" |
| 522 | cd $origwd |
| 523 | } |
| 524 |