Fossil SCM
Add 'reinitialize' command to TH1. Add 'flags' to the globalState TH1 command.
Commit
3355835fdc5f4583a5dd2165b8389ca9390e4ee2
Parent
7807ec4e130b636…
2 files changed
+43
-1
+19
+43
-1
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -31,12 +31,17 @@ | ||
| 31 | 31 | #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ |
| 32 | 32 | #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ |
| 33 | 33 | #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */ |
| 34 | 34 | #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ |
| 35 | 35 | #define TH_INIT_MASK ((u32)0x0000000F) /* All possible init flags. */ |
| 36 | -#define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */ | |
| 36 | + | |
| 37 | +/* | |
| 38 | +** Useful and/or "well-known" combinations of flag values. | |
| 39 | +*/ | |
| 40 | +#define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */ | |
| 37 | 41 | #define TH_INIT_HOOK (TH_INIT_NEED_CONFIG | TH_INIT_FORCE_SETUP) |
| 42 | +#define TH_INIT_FORBID_MASK (TH_INIT_FORCE_TCL) /* Illegal from a script. */ | |
| 38 | 43 | #endif |
| 39 | 44 | |
| 40 | 45 | /* |
| 41 | 46 | ** Flags set by functions in this file to keep track of integration state |
| 42 | 47 | ** information. These flags should not be used outside of this file. |
| @@ -682,10 +687,11 @@ | ||
| 682 | 687 | ** |
| 683 | 688 | ** "checkout" = The active local checkout directory, if any. |
| 684 | 689 | ** "configuration" = The active configuration database file name, |
| 685 | 690 | ** if any. |
| 686 | 691 | ** "executable" = The fully qualified executable file name. |
| 692 | +** "flags" = The TH1 initialization flags. | |
| 687 | 693 | ** "log" = The error log file name, if any. |
| 688 | 694 | ** "repository" = The active local repository file name, if |
| 689 | 695 | ** any. |
| 690 | 696 | ** "top" = The base path for the active server instance, |
| 691 | 697 | ** if applicable. |
| @@ -718,10 +724,13 @@ | ||
| 718 | 724 | }else if( fossil_strnicmp(argv[1], "configuration\0", 14)==0 ){ |
| 719 | 725 | Th_SetResult(interp, g.zConfigDbName ? g.zConfigDbName : zDefault, -1); |
| 720 | 726 | return TH_OK; |
| 721 | 727 | }else if( fossil_strnicmp(argv[1], "executable\0", 11)==0 ){ |
| 722 | 728 | Th_SetResult(interp, g.nameOfExe ? g.nameOfExe : zDefault, -1); |
| 729 | + return TH_OK; | |
| 730 | + }else if( fossil_strnicmp(argv[1], "flags\0", 6)==0 ){ | |
| 731 | + Th_SetResultInt(interp, g.th1Flags); | |
| 723 | 732 | return TH_OK; |
| 724 | 733 | }else if( fossil_strnicmp(argv[1], "log\0", 4)==0 ){ |
| 725 | 734 | Th_SetResult(interp, g.zErrlog ? g.zErrlog : zDefault, -1); |
| 726 | 735 | return TH_OK; |
| 727 | 736 | }else if( fossil_strnicmp(argv[1], "repository\0", 11)==0 ){ |
| @@ -782,10 +791,39 @@ | ||
| 782 | 791 | return Th_WrongNumArgs(interp, "setParameter NAME VALUE"); |
| 783 | 792 | } |
| 784 | 793 | cgi_replace_parameter(mprintf("%s", argv[1]), mprintf("%s", argv[2])); |
| 785 | 794 | return TH_OK; |
| 786 | 795 | } |
| 796 | + | |
| 797 | +/* | |
| 798 | +** TH1 command: reinitialize ?FLAGS? | |
| 799 | +** | |
| 800 | +** Reinitializes the TH1 interpreter using the specified flags. | |
| 801 | +*/ | |
| 802 | +static int reinitializeCmd( | |
| 803 | + Th_Interp *interp, | |
| 804 | + void *p, | |
| 805 | + int argc, | |
| 806 | + const char **argv, | |
| 807 | + int *argl | |
| 808 | +){ | |
| 809 | + u32 flags = TH_INIT_DEFAULT; | |
| 810 | + if( argc!=1 && argc!=2 ){ | |
| 811 | + return Th_WrongNumArgs(interp, "reinitialize ?FLAGS?"); | |
| 812 | + } | |
| 813 | + if( argc==2 ){ | |
| 814 | + int iFlags; | |
| 815 | + if( Th_ToInt(interp, argv[1], argl[1], &iFlags) ){ | |
| 816 | + return TH_ERROR; | |
| 817 | + }else{ | |
| 818 | + flags = (u32)iFlags; | |
| 819 | + } | |
| 820 | + } | |
| 821 | + Th_FossilInit(flags & ~TH_INIT_FORBID_MASK); | |
| 822 | + Th_SetResult(interp, 0, 0); | |
| 823 | + return TH_OK; | |
| 824 | +} | |
| 787 | 825 | |
| 788 | 826 | /* |
| 789 | 827 | ** TH1 command: render STRING |
| 790 | 828 | ** |
| 791 | 829 | ** Renders the template and writes the results. |
| @@ -1372,10 +1410,11 @@ | ||
| 1372 | 1410 | {"linecount", linecntCmd, 0}, |
| 1373 | 1411 | {"puts", putsCmd, (void*)&aFlags[1]}, |
| 1374 | 1412 | {"query", queryCmd, 0}, |
| 1375 | 1413 | {"randhex", randhexCmd, 0}, |
| 1376 | 1414 | {"regexp", regexpCmd, 0}, |
| 1415 | + {"reinitialize", reinitializeCmd, 0}, | |
| 1377 | 1416 | {"render", renderCmd, 0}, |
| 1378 | 1417 | {"repository", repositoryCmd, 0}, |
| 1379 | 1418 | {"setParameter", setParameterCmd, 0}, |
| 1380 | 1419 | {"setting", settingCmd, 0}, |
| 1381 | 1420 | {"styleHeader", styleHeaderCmd, 0}, |
| @@ -1385,10 +1424,13 @@ | ||
| 1385 | 1424 | {"stime", stimeCmd, 0}, |
| 1386 | 1425 | {"utime", utimeCmd, 0}, |
| 1387 | 1426 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1388 | 1427 | {0, 0, 0} |
| 1389 | 1428 | }; |
| 1429 | + if( g.thTrace ){ | |
| 1430 | + Th_Trace("th1-init 0x%x => 0x%x<br />\n", g.th1Flags, flags); | |
| 1431 | + } | |
| 1390 | 1432 | if( needConfig ){ |
| 1391 | 1433 | /* |
| 1392 | 1434 | ** This function uses several settings which may be defined in the |
| 1393 | 1435 | ** repository and/or the global configuration. Since the caller |
| 1394 | 1436 | ** passed a non-zero value for the needConfig parameter, make sure |
| 1395 | 1437 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -31,12 +31,17 @@ | |
| 31 | #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ |
| 32 | #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ |
| 33 | #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */ |
| 34 | #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ |
| 35 | #define TH_INIT_MASK ((u32)0x0000000F) /* All possible init flags. */ |
| 36 | #define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */ |
| 37 | #define TH_INIT_HOOK (TH_INIT_NEED_CONFIG | TH_INIT_FORCE_SETUP) |
| 38 | #endif |
| 39 | |
| 40 | /* |
| 41 | ** Flags set by functions in this file to keep track of integration state |
| 42 | ** information. These flags should not be used outside of this file. |
| @@ -682,10 +687,11 @@ | |
| 682 | ** |
| 683 | ** "checkout" = The active local checkout directory, if any. |
| 684 | ** "configuration" = The active configuration database file name, |
| 685 | ** if any. |
| 686 | ** "executable" = The fully qualified executable file name. |
| 687 | ** "log" = The error log file name, if any. |
| 688 | ** "repository" = The active local repository file name, if |
| 689 | ** any. |
| 690 | ** "top" = The base path for the active server instance, |
| 691 | ** if applicable. |
| @@ -718,10 +724,13 @@ | |
| 718 | }else if( fossil_strnicmp(argv[1], "configuration\0", 14)==0 ){ |
| 719 | Th_SetResult(interp, g.zConfigDbName ? g.zConfigDbName : zDefault, -1); |
| 720 | return TH_OK; |
| 721 | }else if( fossil_strnicmp(argv[1], "executable\0", 11)==0 ){ |
| 722 | Th_SetResult(interp, g.nameOfExe ? g.nameOfExe : zDefault, -1); |
| 723 | return TH_OK; |
| 724 | }else if( fossil_strnicmp(argv[1], "log\0", 4)==0 ){ |
| 725 | Th_SetResult(interp, g.zErrlog ? g.zErrlog : zDefault, -1); |
| 726 | return TH_OK; |
| 727 | }else if( fossil_strnicmp(argv[1], "repository\0", 11)==0 ){ |
| @@ -782,10 +791,39 @@ | |
| 782 | return Th_WrongNumArgs(interp, "setParameter NAME VALUE"); |
| 783 | } |
| 784 | cgi_replace_parameter(mprintf("%s", argv[1]), mprintf("%s", argv[2])); |
| 785 | return TH_OK; |
| 786 | } |
| 787 | |
| 788 | /* |
| 789 | ** TH1 command: render STRING |
| 790 | ** |
| 791 | ** Renders the template and writes the results. |
| @@ -1372,10 +1410,11 @@ | |
| 1372 | {"linecount", linecntCmd, 0}, |
| 1373 | {"puts", putsCmd, (void*)&aFlags[1]}, |
| 1374 | {"query", queryCmd, 0}, |
| 1375 | {"randhex", randhexCmd, 0}, |
| 1376 | {"regexp", regexpCmd, 0}, |
| 1377 | {"render", renderCmd, 0}, |
| 1378 | {"repository", repositoryCmd, 0}, |
| 1379 | {"setParameter", setParameterCmd, 0}, |
| 1380 | {"setting", settingCmd, 0}, |
| 1381 | {"styleHeader", styleHeaderCmd, 0}, |
| @@ -1385,10 +1424,13 @@ | |
| 1385 | {"stime", stimeCmd, 0}, |
| 1386 | {"utime", utimeCmd, 0}, |
| 1387 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1388 | {0, 0, 0} |
| 1389 | }; |
| 1390 | if( needConfig ){ |
| 1391 | /* |
| 1392 | ** This function uses several settings which may be defined in the |
| 1393 | ** repository and/or the global configuration. Since the caller |
| 1394 | ** passed a non-zero value for the needConfig parameter, make sure |
| 1395 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -31,12 +31,17 @@ | |
| 31 | #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ |
| 32 | #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ |
| 33 | #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */ |
| 34 | #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ |
| 35 | #define TH_INIT_MASK ((u32)0x0000000F) /* All possible init flags. */ |
| 36 | |
| 37 | /* |
| 38 | ** Useful and/or "well-known" combinations of flag values. |
| 39 | */ |
| 40 | #define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */ |
| 41 | #define TH_INIT_HOOK (TH_INIT_NEED_CONFIG | TH_INIT_FORCE_SETUP) |
| 42 | #define TH_INIT_FORBID_MASK (TH_INIT_FORCE_TCL) /* Illegal from a script. */ |
| 43 | #endif |
| 44 | |
| 45 | /* |
| 46 | ** Flags set by functions in this file to keep track of integration state |
| 47 | ** information. These flags should not be used outside of this file. |
| @@ -682,10 +687,11 @@ | |
| 687 | ** |
| 688 | ** "checkout" = The active local checkout directory, if any. |
| 689 | ** "configuration" = The active configuration database file name, |
| 690 | ** if any. |
| 691 | ** "executable" = The fully qualified executable file name. |
| 692 | ** "flags" = The TH1 initialization flags. |
| 693 | ** "log" = The error log file name, if any. |
| 694 | ** "repository" = The active local repository file name, if |
| 695 | ** any. |
| 696 | ** "top" = The base path for the active server instance, |
| 697 | ** if applicable. |
| @@ -718,10 +724,13 @@ | |
| 724 | }else if( fossil_strnicmp(argv[1], "configuration\0", 14)==0 ){ |
| 725 | Th_SetResult(interp, g.zConfigDbName ? g.zConfigDbName : zDefault, -1); |
| 726 | return TH_OK; |
| 727 | }else if( fossil_strnicmp(argv[1], "executable\0", 11)==0 ){ |
| 728 | Th_SetResult(interp, g.nameOfExe ? g.nameOfExe : zDefault, -1); |
| 729 | return TH_OK; |
| 730 | }else if( fossil_strnicmp(argv[1], "flags\0", 6)==0 ){ |
| 731 | Th_SetResultInt(interp, g.th1Flags); |
| 732 | return TH_OK; |
| 733 | }else if( fossil_strnicmp(argv[1], "log\0", 4)==0 ){ |
| 734 | Th_SetResult(interp, g.zErrlog ? g.zErrlog : zDefault, -1); |
| 735 | return TH_OK; |
| 736 | }else if( fossil_strnicmp(argv[1], "repository\0", 11)==0 ){ |
| @@ -782,10 +791,39 @@ | |
| 791 | return Th_WrongNumArgs(interp, "setParameter NAME VALUE"); |
| 792 | } |
| 793 | cgi_replace_parameter(mprintf("%s", argv[1]), mprintf("%s", argv[2])); |
| 794 | return TH_OK; |
| 795 | } |
| 796 | |
| 797 | /* |
| 798 | ** TH1 command: reinitialize ?FLAGS? |
| 799 | ** |
| 800 | ** Reinitializes the TH1 interpreter using the specified flags. |
| 801 | */ |
| 802 | static int reinitializeCmd( |
| 803 | Th_Interp *interp, |
| 804 | void *p, |
| 805 | int argc, |
| 806 | const char **argv, |
| 807 | int *argl |
| 808 | ){ |
| 809 | u32 flags = TH_INIT_DEFAULT; |
| 810 | if( argc!=1 && argc!=2 ){ |
| 811 | return Th_WrongNumArgs(interp, "reinitialize ?FLAGS?"); |
| 812 | } |
| 813 | if( argc==2 ){ |
| 814 | int iFlags; |
| 815 | if( Th_ToInt(interp, argv[1], argl[1], &iFlags) ){ |
| 816 | return TH_ERROR; |
| 817 | }else{ |
| 818 | flags = (u32)iFlags; |
| 819 | } |
| 820 | } |
| 821 | Th_FossilInit(flags & ~TH_INIT_FORBID_MASK); |
| 822 | Th_SetResult(interp, 0, 0); |
| 823 | return TH_OK; |
| 824 | } |
| 825 | |
| 826 | /* |
| 827 | ** TH1 command: render STRING |
| 828 | ** |
| 829 | ** Renders the template and writes the results. |
| @@ -1372,10 +1410,11 @@ | |
| 1410 | {"linecount", linecntCmd, 0}, |
| 1411 | {"puts", putsCmd, (void*)&aFlags[1]}, |
| 1412 | {"query", queryCmd, 0}, |
| 1413 | {"randhex", randhexCmd, 0}, |
| 1414 | {"regexp", regexpCmd, 0}, |
| 1415 | {"reinitialize", reinitializeCmd, 0}, |
| 1416 | {"render", renderCmd, 0}, |
| 1417 | {"repository", repositoryCmd, 0}, |
| 1418 | {"setParameter", setParameterCmd, 0}, |
| 1419 | {"setting", settingCmd, 0}, |
| 1420 | {"styleHeader", styleHeaderCmd, 0}, |
| @@ -1385,10 +1424,13 @@ | |
| 1424 | {"stime", stimeCmd, 0}, |
| 1425 | {"utime", utimeCmd, 0}, |
| 1426 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1427 | {0, 0, 0} |
| 1428 | }; |
| 1429 | if( g.thTrace ){ |
| 1430 | Th_Trace("th1-init 0x%x => 0x%x<br />\n", g.th1Flags, flags); |
| 1431 | } |
| 1432 | if( needConfig ){ |
| 1433 | /* |
| 1434 | ** This function uses several settings which may be defined in the |
| 1435 | ** repository and/or the global configuration. Since the caller |
| 1436 | ** passed a non-zero value for the needConfig parameter, make sure |
| 1437 |
+19
| --- test/th1.test | ||
| +++ test/th1.test | ||
| @@ -553,15 +553,17 @@ | ||
| 553 | 553 | |
| 554 | 554 | fossil test-th-eval --th-trace "trace {}" |
| 555 | 555 | if {$th1Hooks} { |
| 556 | 556 | test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 557 | 557 | {------------------ BEGIN TRACE LOG ------------------ |
| 558 | +th1-init 0x0 => 0x0<br /> | |
| 558 | 559 | |
| 559 | 560 | ------------------- END TRACE LOG -------------------}} |
| 560 | 561 | } else { |
| 561 | 562 | test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 562 | 563 | {------------------ BEGIN TRACE LOG ------------------ |
| 564 | +th1-init 0x0 => 0x0<br /> | |
| 563 | 565 | th1-setup {} => TH_OK<br /> |
| 564 | 566 | |
| 565 | 567 | ------------------- END TRACE LOG -------------------}} |
| 566 | 568 | } |
| 567 | 569 | |
| @@ -574,15 +576,17 @@ | ||
| 574 | 576 | |
| 575 | 577 | fossil test-th-eval --th-trace "trace {this is a trace message.}" |
| 576 | 578 | if {$th1Hooks} { |
| 577 | 579 | test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 578 | 580 | {------------------ BEGIN TRACE LOG ------------------ |
| 581 | +th1-init 0x0 => 0x0<br /> | |
| 579 | 582 | this is a trace message. |
| 580 | 583 | ------------------- END TRACE LOG -------------------}} |
| 581 | 584 | } else { |
| 582 | 585 | test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 583 | 586 | {------------------ BEGIN TRACE LOG ------------------ |
| 587 | +th1-init 0x0 => 0x0<br /> | |
| 584 | 588 | th1-setup {} => TH_OK<br /> |
| 585 | 589 | this is a trace message. |
| 586 | 590 | ------------------- END TRACE LOG -------------------}} |
| 587 | 591 | } |
| 588 | 592 | |
| @@ -789,5 +793,20 @@ | ||
| 789 | 793 | |
| 790 | 794 | ############################################################################### |
| 791 | 795 | |
| 792 | 796 | fossil test-th-eval --vfs $altVfs "globalState vfs" |
| 793 | 797 | test th1-globalState-15 {$RESULT eq $altVfs} |
| 798 | + | |
| 799 | +############################################################################### | |
| 800 | + | |
| 801 | +fossil test-th-eval "globalState flags" | |
| 802 | +test th1-globalState-16 {$RESULT eq "0"} | |
| 803 | + | |
| 804 | +############################################################################### | |
| 805 | + | |
| 806 | +fossil test-th-eval "reinitialize; globalState configuration" | |
| 807 | +test th1-reinitialize-1 {$RESULT eq ""} | |
| 808 | + | |
| 809 | +############################################################################### | |
| 810 | + | |
| 811 | +fossil test-th-eval "reinitialize 1; globalState configuration" | |
| 812 | +test th1-reinitialize-2 {$RESULT ne ""} | |
| 794 | 813 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -553,15 +553,17 @@ | |
| 553 | |
| 554 | fossil test-th-eval --th-trace "trace {}" |
| 555 | if {$th1Hooks} { |
| 556 | test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 557 | {------------------ BEGIN TRACE LOG ------------------ |
| 558 | |
| 559 | ------------------- END TRACE LOG -------------------}} |
| 560 | } else { |
| 561 | test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 562 | {------------------ BEGIN TRACE LOG ------------------ |
| 563 | th1-setup {} => TH_OK<br /> |
| 564 | |
| 565 | ------------------- END TRACE LOG -------------------}} |
| 566 | } |
| 567 | |
| @@ -574,15 +576,17 @@ | |
| 574 | |
| 575 | fossil test-th-eval --th-trace "trace {this is a trace message.}" |
| 576 | if {$th1Hooks} { |
| 577 | test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 578 | {------------------ BEGIN TRACE LOG ------------------ |
| 579 | this is a trace message. |
| 580 | ------------------- END TRACE LOG -------------------}} |
| 581 | } else { |
| 582 | test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 583 | {------------------ BEGIN TRACE LOG ------------------ |
| 584 | th1-setup {} => TH_OK<br /> |
| 585 | this is a trace message. |
| 586 | ------------------- END TRACE LOG -------------------}} |
| 587 | } |
| 588 | |
| @@ -789,5 +793,20 @@ | |
| 789 | |
| 790 | ############################################################################### |
| 791 | |
| 792 | fossil test-th-eval --vfs $altVfs "globalState vfs" |
| 793 | test th1-globalState-15 {$RESULT eq $altVfs} |
| 794 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -553,15 +553,17 @@ | |
| 553 | |
| 554 | fossil test-th-eval --th-trace "trace {}" |
| 555 | if {$th1Hooks} { |
| 556 | test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 557 | {------------------ BEGIN TRACE LOG ------------------ |
| 558 | th1-init 0x0 => 0x0<br /> |
| 559 | |
| 560 | ------------------- END TRACE LOG -------------------}} |
| 561 | } else { |
| 562 | test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 563 | {------------------ BEGIN TRACE LOG ------------------ |
| 564 | th1-init 0x0 => 0x0<br /> |
| 565 | th1-setup {} => TH_OK<br /> |
| 566 | |
| 567 | ------------------- END TRACE LOG -------------------}} |
| 568 | } |
| 569 | |
| @@ -574,15 +576,17 @@ | |
| 576 | |
| 577 | fossil test-th-eval --th-trace "trace {this is a trace message.}" |
| 578 | if {$th1Hooks} { |
| 579 | test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 580 | {------------------ BEGIN TRACE LOG ------------------ |
| 581 | th1-init 0x0 => 0x0<br /> |
| 582 | this is a trace message. |
| 583 | ------------------- END TRACE LOG -------------------}} |
| 584 | } else { |
| 585 | test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 586 | {------------------ BEGIN TRACE LOG ------------------ |
| 587 | th1-init 0x0 => 0x0<br /> |
| 588 | th1-setup {} => TH_OK<br /> |
| 589 | this is a trace message. |
| 590 | ------------------- END TRACE LOG -------------------}} |
| 591 | } |
| 592 | |
| @@ -789,5 +793,20 @@ | |
| 793 | |
| 794 | ############################################################################### |
| 795 | |
| 796 | fossil test-th-eval --vfs $altVfs "globalState vfs" |
| 797 | test th1-globalState-15 {$RESULT eq $altVfs} |
| 798 | |
| 799 | ############################################################################### |
| 800 | |
| 801 | fossil test-th-eval "globalState flags" |
| 802 | test th1-globalState-16 {$RESULT eq "0"} |
| 803 | |
| 804 | ############################################################################### |
| 805 | |
| 806 | fossil test-th-eval "reinitialize; globalState configuration" |
| 807 | test th1-reinitialize-1 {$RESULT eq ""} |
| 808 | |
| 809 | ############################################################################### |
| 810 | |
| 811 | fossil test-th-eval "reinitialize 1; globalState configuration" |
| 812 | test th1-reinitialize-2 {$RESULT ne ""} |
| 813 |