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.

joel 2016-03-03 06:46 testerCleanup
Commit 314e9b35663d36c8cad4543517490cdc7505278c
--- test/amend.test
+++ test/amend.test
@@ -55,17 +55,19 @@
5555
# Setup: Add file and commit #
5656
########################################
5757
5858
if {![uuid_from_checkout UUIDINIT]} {
5959
test amend-checkout-failure false
60
+ test_cleanup
6061
return
6162
}
6263
write_file datafile "data"
6364
fossil add datafile
6465
fossil commit -m "c1"
6566
if {![uuid_from_commit $RESULT UUID]} {
6667
test amend-setup-failure false
68
+ test_cleanup
6769
return
6870
}
6971
7072
########################################
7173
# Test: -branch #
7274
--- 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
--- test/th1-docs.test
+++ test/th1-docs.test
@@ -16,12 +16,10 @@
1616
############################################################################
1717
#
1818
# TH1 Docs
1919
#
2020
21
-test_setup ""
22
-
2321
fossil test-th-eval "hasfeature th1Docs"
2422
2523
if {$::RESULT ne "1"} {
2624
puts "Fossil was not compiled with TH1 docs support."; return
2725
}
@@ -29,10 +27,12 @@
2927
fossil test-th-eval "hasfeature tcl"
3028
3129
if {$::RESULT ne "1"} {
3230
puts "Fossil was not compiled with Tcl support."; return
3331
}
32
+
33
+test_setup ""
3434
3535
###############################################################################
3636
3737
set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test.
3838
set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
3939
--- 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
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -20,19 +20,19 @@
2020
2121
set dir [file dirname [info script]]
2222
2323
###############################################################################
2424
25
-test_setup
26
-
27
-###############################################################################
28
-
2925
fossil test-th-eval "hasfeature tcl"
3026
3127
if {$::RESULT ne "1"} {
3228
puts "Fossil was not compiled with Tcl support."; return
3329
}
30
+
31
+###############################################################################
32
+
33
+test_setup
3434
3535
###############################################################################
3636
3737
set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
3838
3939
--- 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

Keyboard Shortcuts

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