Fossil SCM
Let th1-docs test run in a test repo by copying the file we need. This avoids running the test in the actual development checkout.
Commit
f1f5c4ce1e5c0694137554147b7a29d47d2234f9274a464f8f07c6c240d3f3ac
Parent
68ae97d4568c6da…
1 file changed
+14
-18
+14
-18
| --- test/th1-docs.test | ||
| +++ test/th1-docs.test | ||
| @@ -30,50 +30,46 @@ | ||
| 30 | 30 | if {[normalize_result] ne "1"} { |
| 31 | 31 | puts "Fossil was not compiled with Tcl support." |
| 32 | 32 | test_cleanup_then_return |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | -run_in_checkout { | |
| 36 | - set changes [fossil changes --changed] | |
| 37 | -} | |
| 38 | - | |
| 39 | -if {[string length $changes]} { | |
| 40 | - puts "Skipping th1-docs-* tests: uncommitted changes in Fossil checkout." | |
| 41 | - test_cleanup_then_return | |
| 42 | -} | |
| 43 | - | |
| 44 | 35 | ############################################################################### |
| 45 | 36 | |
| 46 | -test_setup "" | |
| 37 | +test_setup | |
| 47 | 38 | |
| 48 | 39 | ############################################################################### |
| 49 | 40 | |
| 50 | 41 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 51 | 42 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 52 | 43 | |
| 53 | 44 | ############################################################################### |
| 54 | 45 | |
| 55 | -run_in_checkout { | |
| 56 | - set data [fossil info] | |
| 57 | -} | |
| 46 | +set data [fossil info] | |
| 58 | 47 | |
| 59 | 48 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 60 | 49 | |
| 61 | 50 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 62 | 51 | error "unable to locate repository" |
| 63 | 52 | } |
| 64 | 53 | |
| 65 | 54 | set dataFileName [file join $::testdir th1-docs-input.txt] |
| 55 | +set origFileStat [file join $::testdir fileStat.th1] | |
| 56 | + | |
| 57 | +if {![file exists $origFileStat]} { | |
| 58 | + error "unable to locate [$origFileStat]" | |
| 59 | +} | |
| 60 | + | |
| 61 | +file copy $origFileStat fileStat.th1 | |
| 62 | +fossil add fileStat.th1 | |
| 63 | +fossil commit -m "Add fileStat.th1" | |
| 66 | 64 | |
| 67 | 65 | ############################################################################### |
| 68 | 66 | |
| 69 | -run_in_checkout { | |
| 70 | - set RESULT [test_fossil_http \ | |
| 71 | - $repository $dataFileName /doc/trunk/test/fileStat.th1] | |
| 72 | -} | |
| 67 | +set RESULT [test_fossil_http \ | |
| 68 | + $repository $dataFileName /doc/trunk/fileStat.th1] | |
| 73 | 69 | |
| 74 | -test th1-docs-1a {[regexp {<title>Fossil: test/fileStat.th1</title>} $RESULT]} | |
| 70 | +test th1-docs-1a {[regexp {<title>Unnamed Fossil Project: fileStat.th1</title>} $RESULT]} | |
| 75 | 71 | test th1-docs-1b {[regexp {>\[[0-9a-f]{40,64}\]<} $RESULT]} |
| 76 | 72 | test th1-docs-1c {[regexp { contains \d+ files\.} $RESULT]} |
| 77 | 73 | |
| 78 | 74 | ############################################################################### |
| 79 | 75 | |
| 80 | 76 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -30,50 +30,46 @@ | |
| 30 | if {[normalize_result] ne "1"} { |
| 31 | puts "Fossil was not compiled with Tcl support." |
| 32 | test_cleanup_then_return |
| 33 | } |
| 34 | |
| 35 | run_in_checkout { |
| 36 | set changes [fossil changes --changed] |
| 37 | } |
| 38 | |
| 39 | if {[string length $changes]} { |
| 40 | puts "Skipping th1-docs-* tests: uncommitted changes in Fossil checkout." |
| 41 | test_cleanup_then_return |
| 42 | } |
| 43 | |
| 44 | ############################################################################### |
| 45 | |
| 46 | test_setup "" |
| 47 | |
| 48 | ############################################################################### |
| 49 | |
| 50 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 51 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 52 | |
| 53 | ############################################################################### |
| 54 | |
| 55 | run_in_checkout { |
| 56 | set data [fossil info] |
| 57 | } |
| 58 | |
| 59 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 60 | |
| 61 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 62 | error "unable to locate repository" |
| 63 | } |
| 64 | |
| 65 | set dataFileName [file join $::testdir th1-docs-input.txt] |
| 66 | |
| 67 | ############################################################################### |
| 68 | |
| 69 | run_in_checkout { |
| 70 | set RESULT [test_fossil_http \ |
| 71 | $repository $dataFileName /doc/trunk/test/fileStat.th1] |
| 72 | } |
| 73 | |
| 74 | test th1-docs-1a {[regexp {<title>Fossil: test/fileStat.th1</title>} $RESULT]} |
| 75 | test th1-docs-1b {[regexp {>\[[0-9a-f]{40,64}\]<} $RESULT]} |
| 76 | test th1-docs-1c {[regexp { contains \d+ files\.} $RESULT]} |
| 77 | |
| 78 | ############################################################################### |
| 79 | |
| 80 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -30,50 +30,46 @@ | |
| 30 | if {[normalize_result] ne "1"} { |
| 31 | puts "Fossil was not compiled with Tcl support." |
| 32 | test_cleanup_then_return |
| 33 | } |
| 34 | |
| 35 | ############################################################################### |
| 36 | |
| 37 | test_setup |
| 38 | |
| 39 | ############################################################################### |
| 40 | |
| 41 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 42 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 43 | |
| 44 | ############################################################################### |
| 45 | |
| 46 | set data [fossil info] |
| 47 | |
| 48 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 49 | |
| 50 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 51 | error "unable to locate repository" |
| 52 | } |
| 53 | |
| 54 | set dataFileName [file join $::testdir th1-docs-input.txt] |
| 55 | set origFileStat [file join $::testdir fileStat.th1] |
| 56 | |
| 57 | if {![file exists $origFileStat]} { |
| 58 | error "unable to locate [$origFileStat]" |
| 59 | } |
| 60 | |
| 61 | file copy $origFileStat fileStat.th1 |
| 62 | fossil add fileStat.th1 |
| 63 | fossil commit -m "Add fileStat.th1" |
| 64 | |
| 65 | ############################################################################### |
| 66 | |
| 67 | set RESULT [test_fossil_http \ |
| 68 | $repository $dataFileName /doc/trunk/fileStat.th1] |
| 69 | |
| 70 | test th1-docs-1a {[regexp {<title>Unnamed Fossil Project: fileStat.th1</title>} $RESULT]} |
| 71 | test th1-docs-1b {[regexp {>\[[0-9a-f]{40,64}\]<} $RESULT]} |
| 72 | test th1-docs-1c {[regexp { contains \d+ files\.} $RESULT]} |
| 73 | |
| 74 | ############################################################################### |
| 75 | |
| 76 |