Fossil SCM
Allow the 'th1' test file to fully pass with or without the 'tcl' and 'th1-hooks' settings enabled.
Commit
a9dc33d415730a64ba4dde7c38e6c750bdc2fec7
Parent
2fbbd4f61d5c8bf…
1 file changed
+54
-12
+54
-12
| --- test/th1.test | ||
| +++ test/th1.test | ||
| @@ -20,12 +20,17 @@ | ||
| 20 | 20 | |
| 21 | 21 | set dir [file dirname [info script]]; repo_init |
| 22 | 22 | |
| 23 | 23 | ############################################################################### |
| 24 | 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 | + | |
| 25 | 30 | 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)]}] | |
| 27 | 32 | |
| 28 | 33 | ############################################################################### |
| 29 | 34 | |
| 30 | 35 | fossil test-th-eval --open-config "setting abc" |
| 31 | 36 | test th1-setting-1 {$RESULT eq ""} |
| @@ -885,42 +890,79 @@ | ||
| 885 | 890 | # |
| 886 | 891 | # NOTE: This test may fail if the command names do not always come |
| 887 | 892 | # out in a deterministic order from TH1. |
| 888 | 893 | # |
| 889 | 894 | 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 | +} | |
| 897 | 915 | |
| 898 | 916 | ############################################################################### |
| 899 | 917 | |
| 900 | 918 | 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 | +} | |
| 902 | 926 | |
| 903 | 927 | ############################################################################### |
| 904 | 928 | |
| 905 | 929 | 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 | +} | |
| 907 | 937 | |
| 908 | 938 | ############################################################################### |
| 909 | 939 | |
| 910 | 940 | 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 | +} | |
| 912 | 948 | |
| 913 | 949 | ############################################################################### |
| 914 | 950 | |
| 915 | 951 | fossil test-th-eval "proc foo {} {set x 1; info vars}; foo" |
| 916 | 952 | test th1-info-vars-4 {$RESULT eq "x"} |
| 917 | 953 | |
| 918 | 954 | ############################################################################### |
| 919 | 955 | |
| 920 | 956 | 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 | +} | |
| 922 | 964 | |
| 923 | 965 | ############################################################################### |
| 924 | 966 | |
| 925 | 967 | fossil test-th-eval "lsearch" |
| 926 | 968 | test th1-lsearch-1 {$RESULT eq \ |
| 927 | 969 |
| --- 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 |