Fossil SCM

Updates to the 'th1-docs' tests. Also, enhance output of the --th-trace option.

mistachkin 2020-06-11 01:52 trunk
Commit fee9ede22ab0273874e408aeec3e875308b62f15819c841b46d5a6f69ea6f430
2 files changed +16 -1 +1 -1
+16 -1
--- src/th_main.c
+++ src/th_main.c
@@ -1772,11 +1772,20 @@
17721772
int szCol = th_strlen(zCol);
17731773
const char *zVal = (const char*)sqlite3_column_text(pStmt, i);
17741774
int szVal = sqlite3_column_bytes(pStmt, i);
17751775
Th_SetVar(interp, zCol, szCol, zVal, szVal);
17761776
}
1777
+ if( g.thTrace ){
1778
+ Th_Trace("query_eval {<pre>%#h</pre>}<br />\n", argl[2], argv[2]);
1779
+ }
17771780
res = Th_Eval(interp, 0, argv[2], argl[2]);
1781
+ if( g.thTrace ){
1782
+ int nTrRes;
1783
+ char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes);
1784
+ Th_Trace("[query_eval] => %h {%#h}<br />\n",
1785
+ Th_ReturnCodeName(res, 0), nTrRes, zTrRes);
1786
+ }
17781787
if( res==TH_BREAK || res==TH_CONTINUE ) res = TH_OK;
17791788
}
17801789
rc = sqlite3_finalize(pStmt);
17811790
if( rc!=SQLITE_OK ){
17821791
if( noComplain ) return TH_OK;
@@ -2624,13 +2633,19 @@
26242633
}else if( z[i]=='<' && isBeginScriptTag(&z[i]) ){
26252634
sendText(z, i, 0);
26262635
z += i+5;
26272636
for(i=0; z[i] && (z[i]!='<' || !isEndScriptTag(&z[i])); i++){}
26282637
if( g.thTrace ){
2629
- Th_Trace("eval {<pre>%#h</pre>}<br />", i, z);
2638
+ Th_Trace("render_eval {<pre>%#h</pre>}<br />\n", i, z);
26302639
}
26312640
rc = Th_Eval(g.interp, 0, (const char*)z, i);
2641
+ if( g.thTrace ){
2642
+ int nTrRes;
2643
+ char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes);
2644
+ Th_Trace("[render_eval] => %h {%#h}<br />\n",
2645
+ Th_ReturnCodeName(rc, 0), nTrRes, zTrRes);
2646
+ }
26322647
if( rc!=TH_OK ) break;
26332648
z += i;
26342649
if( z[0] ){ z += 6; }
26352650
i = 0;
26362651
}else{
26372652
--- src/th_main.c
+++ src/th_main.c
@@ -1772,11 +1772,20 @@
1772 int szCol = th_strlen(zCol);
1773 const char *zVal = (const char*)sqlite3_column_text(pStmt, i);
1774 int szVal = sqlite3_column_bytes(pStmt, i);
1775 Th_SetVar(interp, zCol, szCol, zVal, szVal);
1776 }
 
 
 
1777 res = Th_Eval(interp, 0, argv[2], argl[2]);
 
 
 
 
 
 
1778 if( res==TH_BREAK || res==TH_CONTINUE ) res = TH_OK;
1779 }
1780 rc = sqlite3_finalize(pStmt);
1781 if( rc!=SQLITE_OK ){
1782 if( noComplain ) return TH_OK;
@@ -2624,13 +2633,19 @@
2624 }else if( z[i]=='<' && isBeginScriptTag(&z[i]) ){
2625 sendText(z, i, 0);
2626 z += i+5;
2627 for(i=0; z[i] && (z[i]!='<' || !isEndScriptTag(&z[i])); i++){}
2628 if( g.thTrace ){
2629 Th_Trace("eval {<pre>%#h</pre>}<br />", i, z);
2630 }
2631 rc = Th_Eval(g.interp, 0, (const char*)z, i);
 
 
 
 
 
 
2632 if( rc!=TH_OK ) break;
2633 z += i;
2634 if( z[0] ){ z += 6; }
2635 i = 0;
2636 }else{
2637
--- src/th_main.c
+++ src/th_main.c
@@ -1772,11 +1772,20 @@
1772 int szCol = th_strlen(zCol);
1773 const char *zVal = (const char*)sqlite3_column_text(pStmt, i);
1774 int szVal = sqlite3_column_bytes(pStmt, i);
1775 Th_SetVar(interp, zCol, szCol, zVal, szVal);
1776 }
1777 if( g.thTrace ){
1778 Th_Trace("query_eval {<pre>%#h</pre>}<br />\n", argl[2], argv[2]);
1779 }
1780 res = Th_Eval(interp, 0, argv[2], argl[2]);
1781 if( g.thTrace ){
1782 int nTrRes;
1783 char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes);
1784 Th_Trace("[query_eval] => %h {%#h}<br />\n",
1785 Th_ReturnCodeName(res, 0), nTrRes, zTrRes);
1786 }
1787 if( res==TH_BREAK || res==TH_CONTINUE ) res = TH_OK;
1788 }
1789 rc = sqlite3_finalize(pStmt);
1790 if( rc!=SQLITE_OK ){
1791 if( noComplain ) return TH_OK;
@@ -2624,13 +2633,19 @@
2633 }else if( z[i]=='<' && isBeginScriptTag(&z[i]) ){
2634 sendText(z, i, 0);
2635 z += i+5;
2636 for(i=0; z[i] && (z[i]!='<' || !isEndScriptTag(&z[i])); i++){}
2637 if( g.thTrace ){
2638 Th_Trace("render_eval {<pre>%#h</pre>}<br />\n", i, z);
2639 }
2640 rc = Th_Eval(g.interp, 0, (const char*)z, i);
2641 if( g.thTrace ){
2642 int nTrRes;
2643 char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes);
2644 Th_Trace("[render_eval] => %h {%#h}<br />\n",
2645 Th_ReturnCodeName(rc, 0), nTrRes, zTrRes);
2646 }
2647 if( rc!=TH_OK ) break;
2648 z += i;
2649 if( z[0] ){ z += 6; }
2650 i = 0;
2651 }else{
2652
--- test/fileStat.th1
+++ test/fileStat.th1
@@ -60,11 +60,11 @@
6060
tclEval {
6161
#
6262
# NOTE: Get the unique Id of the latest check-in on trunk.
6363
#
6464
return [lindex [regexp -line -inline -nocase -- \
65
- {^uuid:\s+([0-9A-F]{40}) } [eval [getFossilCommand \
65
+ {^(?:uuid|hash):\s+([0-9A-F]{40}) } [eval [getFossilCommand \
6666
$repository "" info trunk]]] end]
6767
}
6868
}
6969
7070
7171
proc theSumOfAllFiles { id } {
7272
--- test/fileStat.th1
+++ test/fileStat.th1
@@ -60,11 +60,11 @@
60 tclEval {
61 #
62 # NOTE: Get the unique Id of the latest check-in on trunk.
63 #
64 return [lindex [regexp -line -inline -nocase -- \
65 {^uuid:\s+([0-9A-F]{40}) } [eval [getFossilCommand \
66 $repository "" info trunk]]] end]
67 }
68 }
69
70
71 proc theSumOfAllFiles { id } {
72
--- test/fileStat.th1
+++ test/fileStat.th1
@@ -60,11 +60,11 @@
60 tclEval {
61 #
62 # NOTE: Get the unique Id of the latest check-in on trunk.
63 #
64 return [lindex [regexp -line -inline -nocase -- \
65 {^(?:uuid|hash):\s+([0-9A-F]{40}) } [eval [getFossilCommand \
66 $repository "" info trunk]]] end]
67 }
68 }
69
70
71 proc theSumOfAllFiles { id } {
72

Keyboard Shortcuts

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