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.

joel 2016-03-01 21:50 trunk
Commit d4907f17fbaf46cc5135c5ae46ba331725a7ebee
--- test/merge5.test
+++ test/merge5.test
@@ -41,14 +41,10 @@
4141
catch {exec $::fossilexe info} res
4242
if {![regexp {use --repository} $res]} {
4343
puts stderr "Cannot run this test within an open checkout"
4444
return
4545
}
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]
5046
5147
# Construct a test repository
5248
#
5349
exec $::fossilexe sqlite3 --no-repository m5.fossil <$testdir/${testfile}_repo.sql
5450
fossil rebuild m5.fossil
5551
--- 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 @@
192192
}
193193
194194
# Create and open a new Fossil repository and clean the checkout
195195
#
196196
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
- }
208197
catch {exec $::fossilexe close -f}
209198
file delete $filename
210199
exec $::fossilexe new $filename
211200
exec $::fossilexe open $filename
212201
exec $::fossilexe clean -f
@@ -521,10 +510,14 @@
521510
set dir [file root [file tail $testfile]]
522511
file delete -force $dir
523512
file mkdir $dir
524513
set origwd [pwd]
525514
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
526519
protOut "***** $testfile ******"
527520
source $testdir/$testfile.test
528521
protOut "***** End of $testfile: [llength $bad_test] errors so far ******"
529522
cd $origwd
530523
}
531524
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button