Fossil SCM

Allow the 'th1' test file to fully pass with or without the 'tcl' and 'th1-hooks' settings enabled.

mistachkin 2016-01-11 21:09 UTC trunk
Commit a9dc33d415730a64ba4dde7c38e6c750bdc2fec7
1 file changed +54 -12
+54 -12
--- test/th1.test
+++ test/th1.test
@@ -20,12 +20,17 @@
2020
2121
set dir [file dirname [info script]]; repo_init
2222
2323
###############################################################################
2424
25
+fossil test-th-eval --open-config "setting tcl"
26
+set th1Tcl [expr {$RESULT eq "1" || [info exists ::env(TH1_ENABLE_TCL)]}]
27
+
28
+###############################################################################
29
+
2530
fossil test-th-eval --open-config "setting th1-hooks"
26
-set th1Hooks [expr {$RESULT eq "1"}]
31
+set th1Hooks [expr {$RESULT eq "1" || [info exists ::env(TH1_ENABLE_HOOKS)]}]
2732
2833
###############################################################################
2934
3035
fossil test-th-eval --open-config "setting abc"
3136
test th1-setting-1 {$RESULT eq ""}
@@ -885,42 +890,79 @@
885890
#
886891
# NOTE: This test may fail if the command names do not always come
887892
# out in a deterministic order from TH1.
888893
#
889894
fossil test-th-eval "info commands"
890
-test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
891
-enable_output uplevel dir http expr glob_match utime styleFooter encode64\
892
-catch if tclReady searchable reinitialize combobox lindex query html anoncap\
893
-randhex llength for set break regexp markdown styleHeader puts return checkout\
894
-decorate artifact trace wiki proc hascap globalState continue getParameter\
895
-hasfeature setting lsearch breakpoint upvar render repository string unset\
896
-setParameter list error info rename anycap httpize}}
895
+
896
+if {$th1Tcl} {
897
+ test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
898
+ enable_output uplevel dir http expr glob_match utime styleFooter encode64\
899
+ catch if tclReady searchable reinitialize combobox lindex tclIsSafe query\
900
+ html anoncap randhex llength for set break regexp markdown styleHeader\
901
+ puts return checkout decorate artifact trace wiki proc tclInvoke hascap\
902
+ globalState continue getParameter hasfeature setting lsearch breakpoint\
903
+ upvar render repository string unset setParameter list error info rename\
904
+ tclExpr anycap tclEval httpize tclMakeSafe}}
905
+} else {
906
+ test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
907
+ enable_output uplevel dir http expr glob_match utime styleFooter encode64\
908
+ catch if tclReady searchable reinitialize combobox lindex query html\
909
+ anoncap randhex llength for set break regexp markdown styleHeader puts\
910
+ return checkout decorate artifact trace wiki proc hascap globalState\
911
+ continue getParameter hasfeature setting lsearch breakpoint upvar render\
912
+ repository string unset setParameter list error info rename anycap\
913
+ httpize}}
914
+}
897915
898916
###############################################################################
899917
900918
fossil test-th-eval "info vars"
901
-test th1-info-vars-1 {$RESULT eq ""}
919
+
920
+if {$th1Hooks} {
921
+ test th1-info-vars-1 {$RESULT eq \
922
+ "th_stack_trace cmd_flags cmd_name cmd_args"}
923
+} else {
924
+ test th1-info-vars-1 {$RESULT eq ""}
925
+}
902926
903927
###############################################################################
904928
905929
fossil test-th-eval "set x 1; info vars"
906
-test th1-info-vars-2 {$RESULT eq "x"}
930
+
931
+if {$th1Hooks} {
932
+ test th1-info-vars-2 {$RESULT eq \
933
+ "x th_stack_trace cmd_flags cmd_name cmd_args"}
934
+} else {
935
+ test th1-info-vars-2 {$RESULT eq "x"}
936
+}
907937
908938
###############################################################################
909939
910940
fossil test-th-eval "set x 1; unset x; info vars"
911
-test th1-info-vars-3 {$RESULT eq ""}
941
+
942
+if {$th1Hooks} {
943
+ test th1-info-vars-3 {$RESULT eq \
944
+ "th_stack_trace cmd_flags cmd_name cmd_args"}
945
+} else {
946
+ test th1-info-vars-3 {$RESULT eq ""}
947
+}
912948
913949
###############################################################################
914950
915951
fossil test-th-eval "proc foo {} {set x 1; info vars}; foo"
916952
test th1-info-vars-4 {$RESULT eq "x"}
917953
918954
###############################################################################
919955
920956
fossil test-th-eval "set y 1; proc foo {} {set x 1; uplevel 1 {info vars}}; foo"
921
-test th1-info-vars-5 {$RESULT eq "y"}
957
+
958
+if {$th1Hooks} {
959
+ test th1-info-vars-5 {$RESULT eq \
960
+ "th_stack_trace y cmd_flags cmd_name cmd_args"}
961
+} else {
962
+ test th1-info-vars-5 {$RESULT eq "y"}
963
+}
922964
923965
###############################################################################
924966
925967
fossil test-th-eval "lsearch"
926968
test th1-lsearch-1 {$RESULT eq \
927969
--- test/th1.test
+++ test/th1.test
@@ -20,12 +20,17 @@
20
21 set dir [file dirname [info script]]; repo_init
22
23 ###############################################################################
24
 
 
 
 
 
25 fossil test-th-eval --open-config "setting th1-hooks"
26 set th1Hooks [expr {$RESULT eq "1"}]
27
28 ###############################################################################
29
30 fossil test-th-eval --open-config "setting abc"
31 test th1-setting-1 {$RESULT eq ""}
@@ -885,42 +890,79 @@
885 #
886 # NOTE: This test may fail if the command names do not always come
887 # out in a deterministic order from TH1.
888 #
889 fossil test-th-eval "info commands"
890 test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
891 enable_output uplevel dir http expr glob_match utime styleFooter encode64\
892 catch if tclReady searchable reinitialize combobox lindex query html anoncap\
893 randhex llength for set break regexp markdown styleHeader puts return checkout\
894 decorate artifact trace wiki proc hascap globalState continue getParameter\
895 hasfeature setting lsearch breakpoint upvar render repository string unset\
896 setParameter list error info rename anycap httpize}}
 
 
 
 
 
 
 
 
 
 
 
 
 
897
898 ###############################################################################
899
900 fossil test-th-eval "info vars"
901 test th1-info-vars-1 {$RESULT eq ""}
 
 
 
 
 
 
902
903 ###############################################################################
904
905 fossil test-th-eval "set x 1; info vars"
906 test th1-info-vars-2 {$RESULT eq "x"}
 
 
 
 
 
 
907
908 ###############################################################################
909
910 fossil test-th-eval "set x 1; unset x; info vars"
911 test th1-info-vars-3 {$RESULT eq ""}
 
 
 
 
 
 
912
913 ###############################################################################
914
915 fossil test-th-eval "proc foo {} {set x 1; info vars}; foo"
916 test th1-info-vars-4 {$RESULT eq "x"}
917
918 ###############################################################################
919
920 fossil test-th-eval "set y 1; proc foo {} {set x 1; uplevel 1 {info vars}}; foo"
921 test th1-info-vars-5 {$RESULT eq "y"}
 
 
 
 
 
 
922
923 ###############################################################################
924
925 fossil test-th-eval "lsearch"
926 test th1-lsearch-1 {$RESULT eq \
927
--- test/th1.test
+++ test/th1.test
@@ -20,12 +20,17 @@
20
21 set dir [file dirname [info script]]; repo_init
22
23 ###############################################################################
24
25 fossil test-th-eval --open-config "setting tcl"
26 set th1Tcl [expr {$RESULT eq "1" || [info exists ::env(TH1_ENABLE_TCL)]}]
27
28 ###############################################################################
29
30 fossil test-th-eval --open-config "setting th1-hooks"
31 set th1Hooks [expr {$RESULT eq "1" || [info exists ::env(TH1_ENABLE_HOOKS)]}]
32
33 ###############################################################################
34
35 fossil test-th-eval --open-config "setting abc"
36 test th1-setting-1 {$RESULT eq ""}
@@ -885,42 +890,79 @@
890 #
891 # NOTE: This test may fail if the command names do not always come
892 # out in a deterministic order from TH1.
893 #
894 fossil test-th-eval "info commands"
895
896 if {$th1Tcl} {
897 test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
898 enable_output uplevel dir http expr glob_match utime styleFooter encode64\
899 catch if tclReady searchable reinitialize combobox lindex tclIsSafe query\
900 html anoncap randhex llength for set break regexp markdown styleHeader\
901 puts return checkout decorate artifact trace wiki proc tclInvoke hascap\
902 globalState continue getParameter hasfeature setting lsearch breakpoint\
903 upvar render repository string unset setParameter list error info rename\
904 tclExpr anycap tclEval httpize tclMakeSafe}}
905 } else {
906 test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
907 enable_output uplevel dir http expr glob_match utime styleFooter encode64\
908 catch if tclReady searchable reinitialize combobox lindex query html\
909 anoncap randhex llength for set break regexp markdown styleHeader puts\
910 return checkout decorate artifact trace wiki proc hascap globalState\
911 continue getParameter hasfeature setting lsearch breakpoint upvar render\
912 repository string unset setParameter list error info rename anycap\
913 httpize}}
914 }
915
916 ###############################################################################
917
918 fossil test-th-eval "info vars"
919
920 if {$th1Hooks} {
921 test th1-info-vars-1 {$RESULT eq \
922 "th_stack_trace cmd_flags cmd_name cmd_args"}
923 } else {
924 test th1-info-vars-1 {$RESULT eq ""}
925 }
926
927 ###############################################################################
928
929 fossil test-th-eval "set x 1; info vars"
930
931 if {$th1Hooks} {
932 test th1-info-vars-2 {$RESULT eq \
933 "x th_stack_trace cmd_flags cmd_name cmd_args"}
934 } else {
935 test th1-info-vars-2 {$RESULT eq "x"}
936 }
937
938 ###############################################################################
939
940 fossil test-th-eval "set x 1; unset x; info vars"
941
942 if {$th1Hooks} {
943 test th1-info-vars-3 {$RESULT eq \
944 "th_stack_trace cmd_flags cmd_name cmd_args"}
945 } else {
946 test th1-info-vars-3 {$RESULT eq ""}
947 }
948
949 ###############################################################################
950
951 fossil test-th-eval "proc foo {} {set x 1; info vars}; foo"
952 test th1-info-vars-4 {$RESULT eq "x"}
953
954 ###############################################################################
955
956 fossil test-th-eval "set y 1; proc foo {} {set x 1; uplevel 1 {info vars}}; foo"
957
958 if {$th1Hooks} {
959 test th1-info-vars-5 {$RESULT eq \
960 "th_stack_trace y cmd_flags cmd_name cmd_args"}
961 } else {
962 test th1-info-vars-5 {$RESULT eq "y"}
963 }
964
965 ###############################################################################
966
967 fossil test-th-eval "lsearch"
968 test th1-lsearch-1 {$RESULT eq \
969

Keyboard Shortcuts

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