Add the current --testcase name to SQLTester --verbose output.

FossilOrigin-Name: f87367402b25adf30f35ab75aa5efc495230d4a83f2fc10b99734c3f3f593840
This commit is contained in:
stephan 2023-08-10 10:44:53 +00:00
parent ec8298fbd1
commit 34fac74362
3 changed files with 16 additions and 10 deletions

View File

@ -941,7 +941,7 @@ class TableResultCommand extends Command {
class TestCaseCommand extends Command {
public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
argcCheck(ts,argv,1);
// TODO?: do something with the test name
ts.setTestCaseName(argv[1]);
t.clearResultBuffer();
t.clearInputBuffer();
}
@ -1016,6 +1016,8 @@ class TestScript {
private String filename = null;
//! Name pulled from the SCRIPT_MODULE_NAME directive of the file
private String moduleName = null;
//! Current test case name.
private String testCaseName = null;
//! Content buffer state.
private final Cursor cur = new Cursor();
//! Utility for console output.
@ -1078,8 +1080,9 @@ class TestScript {
}
public String getOutputPrefix(){
return "["+(moduleName==null ? filename : moduleName)+"] line "+
cur.lineNo;
String rc = "["+(moduleName==null ? filename : moduleName)+"]";
if( null!=testCaseName ) rc += "["+testCaseName+"]";
return rc + " line "+ cur.lineNo;
}
//! Output vals only if level<=current verbosity level.
@ -1098,9 +1101,12 @@ class TestScript {
private TestScript verbose3(Object... vals){return verboseN(3,vals);}
private void reset(){
testCaseName = null;
cur.rewind();
}
void setTestCaseName(String n){ testCaseName = n; }
/**
Returns the next line from the buffer, minus the trailing EOL.

View File

@ -1,5 +1,5 @@
C More\sSQLTester\sdocs.\sAdd\s--verbosity\scommand\sto\shelp\szoom\sin\son\sscript\sareas\swhile\sdebugging.\sSpice\sup\stest-start/end\soutput\swith\ssome\semoji.
D 2023-08-10T10:34:50.418
C Add\sthe\scurrent\s--testcase\sname\sto\sSQLTester\s--verbose\soutput.
D 2023-08-10T10:44:53.161
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -266,7 +266,7 @@ F ext/jni/src/org/sqlite/jni/sqlite3.java 62b1b81935ccf3393472d17cb883dc5ff39c38
F ext/jni/src/org/sqlite/jni/sqlite3_context.java d26573fc7b309228cb49786e9078597d96232257defa955a3425d10897bca810
F ext/jni/src/org/sqlite/jni/sqlite3_stmt.java 78e6d1b95ac600a9475e9db4623f69449322b0c93d1bd4e1616e76ed547ed9fc
F ext/jni/src/org/sqlite/jni/sqlite3_value.java 3d1d4903e267bc0bc81d57d21f5e85978eff389a1a6ed46726dbe75f85e6914a
F ext/jni/src/org/sqlite/jni/tester/SQLTester.java bdc96c5c8a94e49a9e4af6774da1f7373062c9a9f854e0236feaf338552f3018
F ext/jni/src/org/sqlite/jni/tester/SQLTester.java a53136bc757eb46fe5d404d93ffef5fa16bd60957f40b446a320eded81ea8295
F ext/jni/src/org/sqlite/jni/tester/test-script-interpreter.md f9f25126127045d051e918fe59004a1485311c50a13edbf18c79a6ff9160030e
F ext/jni/src/tests/000-000-sanity.test 35817746f1909cc9af5d3e890ee94a43c47ce47127da9cca7d39b0e132d36c84
F ext/jni/src/tests/000-001-ignored.test e17e874c6ab3c437f1293d88093cf06286083b65bf162317f91bbfd92f961b70
@ -2089,8 +2089,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 908c9a44505422a3a15bef3a174d8b931863bc9c74485311a0e62cfec30087bd
R 723877b1e83c903a6eebac5debe5b713
P 8dd08021496f504c23945ecc2bbe1e4a13109fdd03457ca6269b4cb1cc4cd04c
R 6945d572bb09d06283928530ca319652
U stephan
Z 9ac434387da17df208fe2a5e4745ca4c
Z 7ed984402281dd637927941ca5072ed3
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
8dd08021496f504c23945ecc2bbe1e4a13109fdd03457ca6269b4cb1cc4cd04c
f87367402b25adf30f35ab75aa5efc495230d4a83f2fc10b99734c3f3f593840