]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Updates to the test script interpreter spec: Rather than failing immediately
authordrh <>
Tue, 8 Aug 2023 14:49:16 +0000 (14:49 +0000)
committerdrh <>
Tue, 8 Aug 2023 14:49:16 +0000 (14:49 +0000)
upon encountering an incompatibility, simply abandon the rest of that particular
input file.

FossilOrigin-Name: d2c99b96f4b61561c3fa34947ca7bfd2cd214b1913aff7ba64b7b897a574fea3

ext/jni/src/org/sqlite/jni/tester/test-script-interpreter.md
manifest
manifest.uuid

index ffaec1b13219766d14940c8e38561479d2d03222..ec1ea530056d3a5e25d01c56f7682e9737f70baf 100644 (file)
@@ -16,22 +16,42 @@ script are deleted when the script finishes.
 
 ## Parsing Rules:
 
-  1.   Ignore the entire script if the script does not contain the
-       string "SCRIPT_MODULE_NAME:".
-
-  2.   Ignore any script that contains the character sequence "\\n\|"
-       (0x0a, 0x7c).  In other words, ignore scripts that contain the
-       pipe character at the beginning of a line.  Such lines represent
-       test database file content in the "dbtotxt" format.  We might add
-       support for this later, but omit it for the first version.
-
-  3.   Ignore individual lines that begin with '#'  (C-preprocessor lines).
-
-  4.   If a line begins with exactly two minus signs followed by a
+  1.   The test script is read line by line, where a line is a sequence of
+       characters that runs up to the next '\\n' (0x0a) character or until
+       the end of the file.  There is never a need to read ahead past the
+       end of the current line.
+
+  2.   If any line contains the string " MODULE_NAME:" (with a space before
+       the initial "M") or "MIXED_MODULE_NAME:" then that test script is
+       incompatible with this spec.  Processing of the test script should
+       end immediately.  There is no need to read any more of the file.
+       In verbose mode, the interpreter might choose to emit an informational
+       messages saying that the test script was abandoned due to an
+       incompatible module type.
+
+  3.   If any line contains the string "SCRIPT_MODULE_NAME:" then the input
+       script is known to be of the correct type for this specification and
+       processing may continue.  The "MODULE_NAME" checking in steps 2 and 3
+       may optionally be discontinued after sighting a "SCRIPT_MODULE_NAME".
+
+  4.   If any line begins with the "\|" (0x7c) character, that indicates that
+       the input script is not compatible with this specification.  Processing
+       of the script should stop immediately.  In verbose mode, the interpreter
+       might choose to emit an informational message indicating that the
+       test script was abandoned because it contained "a dbtotxt format database
+       specification".
+
+  5.   Any line that begins with "#" is a C-preprocessor line.  The interpreter
+       described by this spec does not know how to deal with C-preprocessor lines.
+       Hence, processing should be abandoned.  In verbose mode, the interpreter
+       might emit an informational message similar to
+       "script NAME abandoned due to C-preprocessor line: ..."
+
+  6.   If a line begins with exactly two minus signs followed by a
        lowercase letter, that is a command.  Process commands as described
        below.
 
-  5.   All other lines should be accumulated into the "input buffer".
+  7.   All other lines should be accumulated into the "input buffer".
        The various commands will have access to this input buffer.
        Some commands will reset the buffer.
 
@@ -67,8 +87,12 @@ Commands have access to the input buffer and might reset the input buffer.
 The command can also optionally read (and consume) additional text from
 script that comes after the command.
 
-Unknown or unrecognized commands should cause an error message to be
-printed and execution to stop.
+Unknown or unrecognized commands indicate that the script contains features
+that are not (yet) supported by this specification.  Processing of the
+script should terminate immediately.  When this happens and when the
+interpreter is in a "verbose" mode, the interpreter might choose to emit
+an informational message along the lines of "test script NAME abandoned
+due to unsupported command: --whatever".
 
 The initial implemention will only recognize a few commands.  Other
 commands may be added later.  The following is the initial set of
index e87960384097ba9ddc67aacd8e4e4c2dc79e0d80..4656865a93e9678e960bd2ae37b19fdbcf4b30e4 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C A\snumber\sof\sbaby\ssteps\sfor\sSQLTester.java.\sIt\scan\snow\shandle\sbasic\s--result\scases.
-D 2023-08-08T14:40:47.725
+C Updates\sto\sthe\stest\sscript\sinterpreter\sspec:\s\sRather\sthan\sfailing\simmediately\nupon\sencountering\san\sincompatibility,\ssimply\sabandon\sthe\srest\sof\sthat\sparticular\ninput\sfile.
+D 2023-08-08T14:49:16.921
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -268,7 +268,7 @@ F ext/jni/src/org/sqlite/jni/sqlite3_value.java 3d1d4903e267bc0bc81d57d21f5e8597
 F ext/jni/src/org/sqlite/jni/tester/Outer.java 3d9c40f8ed58ec0df05ca160986ea06ec84ec1f338b069cfba9604bbba467a01
 F ext/jni/src/org/sqlite/jni/tester/SQLTester.java f16d95e0eb89723010de955197164ea5da58a83852499004ec510f778681a8da
 F ext/jni/src/org/sqlite/jni/tester/TestScript.java 52350fb458d7d2816377a824c18c498c4a97f0026b64278f62ff1c382a92a070
-F ext/jni/src/org/sqlite/jni/tester/test-script-interpreter.md e66ee0de4f6b805afe7486f6826d4e1f26b449066c2ec6550b314950369a4ea2
+F ext/jni/src/org/sqlite/jni/tester/test-script-interpreter.md 4a4868c70a68aa1829c1f7659daa78198187199d176778efb86a239c9e58802c
 F ext/jni/src/tests/000_first.test 752aca36279f9b0ceedaf15a4ce6bc9e0b7f9ca2749287e204d81ca2f7e41e6f
 F ext/jni/src/tests/010_ignored.test ce2de6742ff1bf98d8976fda0f260ff3d280e8f8c0a99309fb59fcfef2556fcd
 F ext/lsm1/Makefile a553b728bba6c11201b795188c5708915cc4290f02b7df6ba7e8c4c943fd5cd9
@@ -2090,8 +2090,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 3aa2b5a5cadb214dc64a3db412b7dfdd805abd8681b61da857b886cba3b937b5
-R 879a6e39ab778945869b54b1f498f7c6
-U stephan
-Z d614dd3e6aa20cfdef1208a3dc72efbf
+P 0404f688f6a22b6bbe009de1bee3341ca00e19e2cc32081265cf151876dc032f
+R 5c771fdf09ed554b70864c3b42074aa2
+U drh
+Z a318dc74afcddc68936c41fffb67c044
 # Remove this line to create a well-formed Fossil manifest.
index 19673fabb6a78a947ba482024b085ff790b529b5..940c759510407a6e13db62170247d559a358414c 100644 (file)
@@ -1 +1 @@
-0404f688f6a22b6bbe009de1bee3341ca00e19e2cc32081265cf151876dc032f
\ No newline at end of file
+d2c99b96f4b61561c3fa34947ca7bfd2cd214b1913aff7ba64b7b897a574fea3
\ No newline at end of file