Fossil SCM
When possible, don't call test_setup until after any checks that may cause a test script to exit early. Otherwise, test_cleanup should be called before returning.
Commit
314e9b35663d36c8cad4543517490cdc7505278c
Parent
186e6a71b917bc3…
3 files changed
+2
+2
-2
+4
-4
+2
| --- test/amend.test | ||
| +++ test/amend.test | ||
| @@ -55,17 +55,19 @@ | ||
| 55 | 55 | # Setup: Add file and commit # |
| 56 | 56 | ######################################## |
| 57 | 57 | |
| 58 | 58 | if {![uuid_from_checkout UUIDINIT]} { |
| 59 | 59 | test amend-checkout-failure false |
| 60 | + test_cleanup | |
| 60 | 61 | return |
| 61 | 62 | } |
| 62 | 63 | write_file datafile "data" |
| 63 | 64 | fossil add datafile |
| 64 | 65 | fossil commit -m "c1" |
| 65 | 66 | if {![uuid_from_commit $RESULT UUID]} { |
| 66 | 67 | test amend-setup-failure false |
| 68 | + test_cleanup | |
| 67 | 69 | return |
| 68 | 70 | } |
| 69 | 71 | |
| 70 | 72 | ######################################## |
| 71 | 73 | # Test: -branch # |
| 72 | 74 |
| --- test/amend.test | |
| +++ test/amend.test | |
| @@ -55,17 +55,19 @@ | |
| 55 | # Setup: Add file and commit # |
| 56 | ######################################## |
| 57 | |
| 58 | if {![uuid_from_checkout UUIDINIT]} { |
| 59 | test amend-checkout-failure false |
| 60 | return |
| 61 | } |
| 62 | write_file datafile "data" |
| 63 | fossil add datafile |
| 64 | fossil commit -m "c1" |
| 65 | if {![uuid_from_commit $RESULT UUID]} { |
| 66 | test amend-setup-failure false |
| 67 | return |
| 68 | } |
| 69 | |
| 70 | ######################################## |
| 71 | # Test: -branch # |
| 72 |
| --- test/amend.test | |
| +++ test/amend.test | |
| @@ -55,17 +55,19 @@ | |
| 55 | # Setup: Add file and commit # |
| 56 | ######################################## |
| 57 | |
| 58 | if {![uuid_from_checkout UUIDINIT]} { |
| 59 | test amend-checkout-failure false |
| 60 | test_cleanup |
| 61 | return |
| 62 | } |
| 63 | write_file datafile "data" |
| 64 | fossil add datafile |
| 65 | fossil commit -m "c1" |
| 66 | if {![uuid_from_commit $RESULT UUID]} { |
| 67 | test amend-setup-failure false |
| 68 | test_cleanup |
| 69 | return |
| 70 | } |
| 71 | |
| 72 | ######################################## |
| 73 | # Test: -branch # |
| 74 |
+2
-2
| --- test/th1-docs.test | ||
| +++ test/th1-docs.test | ||
| @@ -16,12 +16,10 @@ | ||
| 16 | 16 | ############################################################################ |
| 17 | 17 | # |
| 18 | 18 | # TH1 Docs |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | -test_setup "" | |
| 22 | - | |
| 23 | 21 | fossil test-th-eval "hasfeature th1Docs" |
| 24 | 22 | |
| 25 | 23 | if {$::RESULT ne "1"} { |
| 26 | 24 | puts "Fossil was not compiled with TH1 docs support."; return |
| 27 | 25 | } |
| @@ -29,10 +27,12 @@ | ||
| 29 | 27 | fossil test-th-eval "hasfeature tcl" |
| 30 | 28 | |
| 31 | 29 | if {$::RESULT ne "1"} { |
| 32 | 30 | puts "Fossil was not compiled with Tcl support."; return |
| 33 | 31 | } |
| 32 | + | |
| 33 | +test_setup "" | |
| 34 | 34 | |
| 35 | 35 | ############################################################################### |
| 36 | 36 | |
| 37 | 37 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 38 | 38 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 39 | 39 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -16,12 +16,10 @@ | |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # TH1 Docs |
| 19 | # |
| 20 | |
| 21 | test_setup "" |
| 22 | |
| 23 | fossil test-th-eval "hasfeature th1Docs" |
| 24 | |
| 25 | if {$::RESULT ne "1"} { |
| 26 | puts "Fossil was not compiled with TH1 docs support."; return |
| 27 | } |
| @@ -29,10 +27,12 @@ | |
| 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 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 38 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 39 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -16,12 +16,10 @@ | |
| 16 | ############################################################################ |
| 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 | } |
| @@ -29,10 +27,12 @@ | |
| 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 | test_setup "" |
| 34 | |
| 35 | ############################################################################### |
| 36 | |
| 37 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 38 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 39 |
+4
-4
| --- test/th1-tcl.test | ||
| +++ test/th1-tcl.test | ||
| @@ -20,19 +20,19 @@ | ||
| 20 | 20 | |
| 21 | 21 | set dir [file dirname [info script]] |
| 22 | 22 | |
| 23 | 23 | ############################################################################### |
| 24 | 24 | |
| 25 | -test_setup | |
| 26 | - | |
| 27 | -############################################################################### | |
| 28 | - | |
| 29 | 25 | fossil test-th-eval "hasfeature tcl" |
| 30 | 26 | |
| 31 | 27 | if {$::RESULT ne "1"} { |
| 32 | 28 | puts "Fossil was not compiled with Tcl support."; return |
| 33 | 29 | } |
| 30 | + | |
| 31 | +############################################################################### | |
| 32 | + | |
| 33 | +test_setup | |
| 34 | 34 | |
| 35 | 35 | ############################################################################### |
| 36 | 36 | |
| 37 | 37 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 38 | 38 | |
| 39 | 39 |
| --- test/th1-tcl.test | |
| +++ test/th1-tcl.test | |
| @@ -20,19 +20,19 @@ | |
| 20 | |
| 21 | set dir [file dirname [info script]] |
| 22 | |
| 23 | ############################################################################### |
| 24 | |
| 25 | test_setup |
| 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 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 38 | |
| 39 |
| --- test/th1-tcl.test | |
| +++ test/th1-tcl.test | |
| @@ -20,19 +20,19 @@ | |
| 20 | |
| 21 | set dir [file dirname [info script]] |
| 22 | |
| 23 | ############################################################################### |
| 24 | |
| 25 | fossil test-th-eval "hasfeature tcl" |
| 26 | |
| 27 | if {$::RESULT ne "1"} { |
| 28 | puts "Fossil was not compiled with Tcl support."; return |
| 29 | } |
| 30 | |
| 31 | ############################################################################### |
| 32 | |
| 33 | test_setup |
| 34 | |
| 35 | ############################################################################### |
| 36 | |
| 37 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 38 | |
| 39 |