Hello all,

The following piece of boilerplate can be found in various Fossil test files:

catch {exec $::fossilexe info} res
if {![regexp {use --repository} $res]} {
  puts stderr "Cannot run this test within an open checkout"
  return
}

I've come to realize that this code doesn't actually do anything useful, despite my best efforts to blindly copy and paste it into a couple of test files myself. In tester.tcl, the directory used as the working directory for the next test file is deleted and then recreated before the test file is evaluated, so the only thing it prevents you from doing is running the test if you somehow manage to open a checkout in that directory between the time it is created and the time that the above code is executed.

As someone who has accidentally called the test runner from an unintended directory once or twice (no damage done besides directory spam, thankfully), we should give testers some protection from having a directory unintentionally deleted because it shares the name of one of our test files. My recommendation is simply to add a special suffix to each test directory name, so "merge_renames.test" is run inside the directory "merge_renames#fossil", for example.

Comments, suggestions, etc.?
_______________________________________________
fossil-dev mailing list
fossil-dev@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/fossil-dev

Reply via email to