Get sqlite3x and extensions testing from Makefile setup, and some of wapptest changes done to run same. (a WIP)

FossilOrigin-Name: d238fcf4beb0b121e4754e288df9906cb61d38a827f1fe38cf4aaa784520fc08
This commit is contained in:
larrybr
2022-04-15 21:21:01 +00:00
parent 34ddefc419
commit a07d62a561
12 changed files with 191 additions and 122 deletions
+31 -3
View File
@@ -52,13 +52,19 @@ TCC += @TCL_INCLUDE_SPEC@
# The library that programs using TCL must link against.
#
LIBTCL = @TCL_LIB_SPEC@
# The preprocessing options that are needed for images using the TCL library.
INCTCL = @TCL_INCLUDE_SPEC@
# TCCX is the C Compile and options for use in building shell extensions
# that will run on the target platform. It relies on no in-tree includes,
# using only pre-glommed source/header files in the current directory.
TCCX = ${CC} ${CFLAGS} -fPIC -shared -I. @TCL_INCLUDE_SPEC@
TCCX = ${CC} ${CFLAGS} -fPIC -shared -I.
TCCX += @EXTENSION_DEBUG@
# TCXX is the C++ compile for building a shell extension from a C++ source.
TCXX = ${CXX} ${CFLAGS} -fPIC -shared -I.
TCXX += @EXTENSION_DEBUG@
# Compiler options needed for programs that use the readline() library.
#
READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
@@ -600,6 +606,11 @@ TESTPROGS = \
dbhash$(TEXE) \
sqltclsh$(TEXE)
TESTPROGS_SHX = \
testfixture$(TEXE) \
sqlite3x$(TEXE) \
shell_extensions
# Databases containing fuzzer test cases
#
FUZZDATA = \
@@ -1250,6 +1261,19 @@ shx_link.h: $(SHX_LINK_SRC)
$(MKSHELL_TOOL) -short-head -header-gen \
$(TOP)/src/shext_linkage.h > $@
# Rules to build shell extensions used for testing extensible shell
shell_extensions: tcl_shell_extension \
test_shellext_cpp$(SHLIB_SUFFIX) test_shellext_c$(SHLIB_SUFFIX)
test_shellext_cpp$(SHLIB_SUFFIX): $(TOP)/src/test_shellext_cpp.cpp \
$(TOP)/shx_link.h
$(TCXX) $(TOP)/src/test_shellext_cpp.cpp -o $@
test_shellext_c$(SHLIB_SUFFIX): $(TOP)/src/test_shellext_c.c \
$(TOP)/shx_link.h
$(TCCX) $(TOP)/src/test_shellext_c.c -o $@
# Rules to build the TCL shell extension (tclshext.{so,dll,dylib})
tcl_shell_extension: tclshext$(SHLIB_SUFFIX)
@@ -1271,7 +1295,8 @@ tclshext.c: $(TOP)/ext/misc/tclshext.c.in $(TOP)/src/tclsqlite.c
$(MKSHELL_TOOL) $(TOP)/ext/misc/tclshext.c.in > $@
tclshext$(SHLIB_SUFFIX): tclshext.c shx_link.h
$(TCCX) $(TCLEXT_OPTS) tclshext.c -o $@ $(TCL_LIBS) $(TCLEXT_LDOPTS)
$(TCCX) $(INCTCL) $(TCLEXT_OPTS) tclshext.c \
-o $@ $(TCL_LIBS) $(TCLEXT_LDOPTS)
# Rules to build the 'testfixture' application.
#
@@ -1356,8 +1381,11 @@ valgrindtest: $(TESTPROGS) valgrindfuzz
smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
shellxtest: $(TESTPROGS_SHX)
./testfixture$(TEXE) $(TOP)/test/shell_x/shell*.test
shelltest: $(TESTPROGS)
./testfixture$(TEXT) $(TOP)/test/permutations.test shell
./testfixture$(TEXE) $(TOP)/test/permutations.test shell
sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in
$(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
+15 -15
View File
@@ -1,9 +1,9 @@
C Extension\sinterface\scleanup,\sand\srename\sMetaCommand\sto\sDotCommand\s(to\sbetter\smatch\sdocs)
D 2022-04-13T03:48:28.689
C Get\ssqlite3x\sand\sextensions\stesting\sfrom\sMakefile\ssetup,\sand\ssome\sof\swapptest\schanges\sdone\sto\srun\ssame.\s(a\sWIP)
D 2022-04-15T21:21:01.750
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F Makefile.in f96bf52d014571fe3bbabd575a2824a7ea9d7ef2f40bf23315efacda81d59ee1
F Makefile.in a39224b4ea1038f67c9ae5049c832e6ab8a6485ea1580dc5c54c13a37a8479d0
F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241
F Makefile.msc 689726a2785027e0eb34ea9ce8e67ac94bc4aebbaa6def20ddb6fa9f7b0c43b5
F README.md 2dd87a5c1d108b224921f3dd47dea567973f706e1f6959386282a626f459a70c
@@ -557,7 +557,7 @@ F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c
F src/resolve.c 18d99e7146852d6064559561769fcca0743eb32b14a97da6dbed373a30ee0e76
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
F src/select.c 7c106b3f36d483242b0a9c696614cd53d6f29e1ac81da6a3f0e9ea92f4211cc3
F src/shell.c.in 244d069485fd1ce481ea19302b4f4b24e2a603991fc450778814142c55788a50
F src/shell.c.in da1afe360a268736d373218fabfce706558628ba49655855bdcb759be963880e
F src/shext_linkage.h 41e7e665fffd125b38b8211dc650233d4fe54941acd8177f23d3deb9d6f70154
F src/sqlite.h.in 2a35f62185eb5e7ecc64a2f68442b538ce9be74f80f28a00abc24837edcf1c17
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
@@ -607,8 +607,8 @@ F src/test_quota.h 2a8ad1952d1d2ca9af0ce0465e56e6c023b5e15d
F src/test_rtree.c 671f3fae50ff116ef2e32a3bf1fe21b5615b4b7b
F src/test_schema.c f5d6067dfc2f2845c4dd56df63e66ee826fb23877855c785f75cc2ca83fd0c1b
F src/test_server.c a2615049954cbb9cfb4a62e18e2f0616e4dc38fe
F src/test_shellext.c 9a1ca8619f036daa6b23d18e0fec1c75721be05e4eb6fe3ad3282dabae625592
F src/test_shellext.cpp 741d9ebd864e058b7b03c3ecf3ede059075464871af5ed9822da792488dfeaf4
F src/test_shellext_c.c e0cd6bf508d4d5c7147766d58b926bf36d49265654896ab91b1abad0aa8d7656 w src/test_shellext.c
F src/test_shellext_cpp.cpp ae20a1d280311348910ac8c6b2dce7ddc36b38c82ff13929434eb98114696342 w src/test_shellext.cpp
F src/test_sqllog.c 540feaea7280cd5f926168aee9deb1065ae136d0bbbe7361e2ef3541783e187a
F src/test_superlock.c 4839644b9201da822f181c5bc406c0b2385f672e
F src/test_syscall.c 1073306ba2e9bfc886771871a13d3de281ed3939
@@ -1293,7 +1293,7 @@ F test/parser1.test 6ccdf5e459a5dc4673d3273dc311a7e9742ca952dd0551a6a6320d27035c
F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b
F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
F test/permutations.test 68b6dcd2667acdc643140d502c0b6c503abe444495cf5d16aa3a4f0391604020
F test/permutations.test 804df60ac3d1ac5ced27aa04b255648db63880412a267564db065ffd00147c32
F test/pg_common.tcl 3b27542224db1e713ae387459b5d117c836a5f6e328846922993b6d2b7640d9f
F test/pragma.test cae534c12a033a5c319ccc94f50b32811acdef9f67bf19a82ff42697caccd69f
F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f
@@ -1321,7 +1321,7 @@ F test/recover.test ccb8c2623902a92ebb76770edd075cb4f75a4760bb7afde38026572c6e79
F test/regexp1.test 0c3ff80f66b0eff80e623eb5db7a3dad512095c573d78ac23009785f6d8f51ce
F test/regexp2.test 55ed41da802b0e284ac7e2fe944be3948f93ff25abbca0361a609acfed1368b5
F test/reindex.test cd9d6021729910ece82267b4f5e1b5ac2911a7566c43b43c176a6a4732e2118d
F test/releasetest_data.tcl 11ba48a21ed1c808147b0e77c6e93d204577f4327ffe6d7c3b34cd3c01eac3a2
F test/releasetest_data.tcl 07c02f23706c17a8d1c00eb17f7b98aaee50cc3077f3a52d5d71c13859fb8ef7
F test/resetdb.test 8062cf10a09d8c048f8de7711e94571c38b38168db0e5877ba7561789e5eeb2b
F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
F test/returning1.test c43b8370a351f77aec6d71f4a2cde59b849369ed1933261a2c2c69e23e34ff5e
@@ -1404,7 +1404,7 @@ F test/shell5.test 39d2cffb3c1c67456b2c42eb5e46bec1e3780c68a6d71bb156e012d3f5373
F test/shell6.test 1ceb51b2678c472ba6cf1e5da96679ce8347889fe2c3bf93a0e0fa73f00b00d3
F test/shell7.test 115132f66d0463417f408562cc2cf534f6bbc6d83a6d50f0072a9eb171bae97f
F test/shell8.test 388471d16e4de767333107e30653983f186232c0e863f4490bb230419e830aae
F test/shell9.test 24042184644d4fd04e4b81885d7001e7e76d6826992242be72246009b3530eda
F test/shell_x/shell9.test c3e5aefa4cc6088efe9034b22ed33157e18653d599cb109f254904a7344cd230 w test/shell9.test
F test/shmlock.test 3dbf017d34ab0c60abe6a44e447d3552154bd0c87b41eaf5ceacd408dd13fda5
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
@@ -1482,7 +1482,7 @@ F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30
F test/temptable2.test d2940417496e2b9548e01d09990763fbe88c316504033256d51493e1f1a5ce6a
F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637
F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc
F test/tester.tcl f577d040078dd4fb56ea1ccaa71f6bfd0ebf0bd0ac373304db4269b5474f9cb7
F test/tester.tcl 25a215da2f02bd1bec6836cfa8154e84b89ccc13b3496d4f0beebe31e56ad8b7
F test/thread001.test b61a29dd87cf669f5f6ac96124a7c97d71b0c80d9012746072055877055cf9ef
F test/thread002.test e630504f8a06c00bf8bbe68528774dd96aeb2e58
F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7
@@ -1776,7 +1776,7 @@ F test/walslow.test c05c68d4dc2700a982f89133ce103a1a84cc285f
F test/walthread.test 14b20fcfa6ae152f5d8e12f5dc8a8a724b7ef189f5d8ef1e2ceab79f2af51747
F test/walvfs.test bccb3e0d235ef85e276f491d34db32c9ada1ea67be8d9f10aabe7b30319ec656
F test/wapp.tcl b440cd8cf57953d3a49e7ee81e6a18f18efdaf113b69f7d8482b0710a64566ec
F test/wapptest.tcl 899594e25684861d5b0c0880fb012364def50ef8097041b8ddf74be5ba7fa270 x
F test/wapptest.tcl c55a4669d02e982921f1dc37ababa21eb14123ec73a396692165e927c16ff061 x
F test/where.test f114842c1851d257a26770f2ad55119b084001c0e1b8c214f886f45152d37cd8
F test/where2.test 03c21a11e7b90e2845fc3c8b4002fc44cc2797fa74c86ee47d70bd7ea4f29ed6
F test/where3.test 5b4ffc0ac2ea0fe92f02b1244b7531522fe4d7bccf6fa8741d54e82c10e67753
@@ -1887,7 +1887,7 @@ F tool/mkopcodec.tcl 33d20791e191df43209b77d37f0ff0904620b28465cca6990cf8d60da61
F tool/mkopcodeh.tcl 5dab48c49a25452257494e9601702ab63adaba6bd54a9b382615fa52661c8f8c
F tool/mkopts.tcl 680f785fdb09729fd9ac50632413da4eadbdf9071535e3f26d03795828ab07fa
F tool/mkpragmatab.tcl bd07bd59d45d0f3448e123d6937e9811195f9908a51e09d774609883055bfd3d
F tool/mkshellc.tcl 59d53f5667a2946042be81519371e1305a2bc954a3292a29c430fca6dbd6e412 x
F tool/mkshellc.tcl db13d7de92f4a4b8f0a03c4e5942d0c032d2388c6c6fb2cd227c823f0d6ad0b3 x
F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6d0274f584a7f
@@ -1953,8 +1953,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 29ab6e90372d216a0cb9d86861c804d356cd2f11ad835443da08651bec0da398
R 1510482cb2995d161d76a9fbb3e87be4
P f78d7b8b89b667daba486fdb67de105bd8524203cc44bb02c3cb94acd85560e9
R 1ba3c589060988b7f35661d48f220afd
U larrybr
Z cc8481583ec9f4daf594610712a79a07
Z 85689539bcda51dbf9a7b11c35f28148
# Remove this line to create a well-formed Fossil manifest.
+1 -1
View File
@@ -1 +1 @@
f78d7b8b89b667daba486fdb67de105bd8524203cc44bb02c3cb94acd85560e9
d238fcf4beb0b121e4754e288df9906cb61d38a827f1fe38cf4aaa784520fc08
+4 -3
View File
@@ -10984,7 +10984,8 @@ static void list_pov_entries(ShellExState *psx, ParamTableUse ptu, u8 bShort,
sqlite3_free(zSql);
if( !bShort ){
int nBindings = 0, nScripts = 0;
zSql = smprintf("SELECT key, uses, iif(uses, value, quote(value))"
zSql = smprintf("SELECT key, uses,"
" iif(typeof(value)='text', quote(value), value) as v"
" %z ORDER BY uses, key", zFromWhere);
shell_check_oom(zSql);
rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
@@ -10994,7 +10995,7 @@ static void list_pov_entries(ShellExState *psx, ParamTableUse ptu, u8 bShort,
switch( ptux ){
case PTU_Binding:
if( nBindings++ == 0 ){
utf8_printf(out, "Binding Values:\n%-*s %s\n",
utf8_printf(out, "Bindings:\n%-*s %s\n",
len, "name", "value");
}
utf8_printf(out, "%-*s %s\n", len, sqlite3_column_text(pStmt,0),
@@ -11002,7 +11003,7 @@ static void list_pov_entries(ShellExState *psx, ParamTableUse ptu, u8 bShort,
break;
case PTU_Script:
if( nScripts++ == 0 ){
utf8_printf(out, "Scripts\n%-*s %s\n", len, "name", "value");
utf8_printf(out, "Scripts:\n%-*s %s\n", len, "name", "value");
}
utf8_printf(out, "%-*s %s\n", len, sqlite3_column_text(pStmt,0),
sqlite3_column_text(pStmt,2));
@@ -11,7 +11,7 @@
*************************************************************************
** Test extension for testing the shell's .load -shellext ... function.
** To build from the SQLite project root:
** gcc -shared -fPIC -Wall -I. -g src/test_shellext.c -o test_shellext.so
** gcc -shared -fPIC -Wall -I. -g src/test_shellext_c.c -o test_shellext_c.so
*/
#include <stdio.h>
#include "shx_link.h"
@@ -119,7 +119,7 @@ static int shellEventHandle(void *pv, NoticeKind nk,
#ifdef _WIN32
__declspec(dllexport)
#endif
int sqlite3_testshellext_init(
int sqlite3_testshellext_c_init(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pApi
@@ -139,12 +139,12 @@ int sqlite3_testshellext_init(
DotCommand *pdc = (DotCommand *)&batty;
int rc;
SHX_API(subscribeEvents)(psx, sqlite3_testshellext_init, &batty,
SHX_API(subscribeEvents)(psx, sqlite3_testshellext_c_init, &batty,
NK_CountOf, shellEventHandle);
batty.pPrint = SHX_HELPER(findDotCommand)("print", psx, &rc);
rc = SHX_API(registerDotCommand)(psx, sqlite3_testshellext_init, pdc);
rc = SHX_API(registerDotCommand)(psx, sqlite3_testshellext_c_init, pdc);
if( rc!=0 ) ++nErr;
pShExtLink->eid = sqlite3_testshellext_init;
pShExtLink->eid = sqlite3_testshellext_c_init;
}
return nErr ? SQLITE_ERROR : SQLITE_OK;
}
@@ -9,9 +9,10 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** Test extension for testing the shell's .load -shellext ... function.
** Test extension for testing the shell's .load <extName> -shext function.
** To build from the SQLite project root:
** g++ -shared -fPIC -Wall -I. -g src/test_shellext.cpp -o test_shellext.so
g++ -shared -fPIC -Wall -I. -g src/test_shellext_cpp.cpp \
-o test_shellext_cpp.so
*/
#include <stdio.h>
#include "shx_link.h"
@@ -115,7 +116,7 @@ extern "C"
#ifdef _WIN32
__declspec(dllexport)
#endif
int sqlite3_testshellext_init(
int sqlite3_testshellext_cpp_init(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pApi
@@ -134,12 +135,13 @@ int sqlite3_testshellext_init(
ShellExState *psx = pShExtLink->pSXS;
int rc;
SHX_API(subscribeEvents)(psx, sqlite3_testshellext_init, &batty,
SHX_API(subscribeEvents)(psx, sqlite3_testshellext_cpp_init, &batty,
NK_CountOf, shellEventHandle);
batty.pPrint = SHX_HELPER(findDotCommand)("print", psx, &rc);
rc = SHX_API(registerDotCommand)(psx, sqlite3_testshellext_init, &batty);
rc = SHX_API(registerDotCommand)(psx,
sqlite3_testshellext_cpp_init, &batty);
if( rc!=0 ) ++nErr;
pShExtLink->eid = sqlite3_testshellext_init;
pShExtLink->eid = sqlite3_testshellext_cpp_init;
}
return nErr ? SQLITE_ERROR : SQLITE_OK;
}
+7 -1
View File
@@ -17,7 +17,7 @@ db close
#-------------------------------------------------------------------------
# test_suite NAME OPTIONS
#
# where available options are:
# where available options are:
#
# -description TITLE (default "")
# -initialize SCRIPT (default "")
@@ -193,6 +193,12 @@ test_suite "shell" -prefix "" -description {
test_set [glob $testdir/shell*.test]
]
test_suite "shellext" -prefix "" -description {
Run tests of the extensible command-line shell and extensions
} -files [
test_set [glob $testdir/shell*.test $testdir/shell_x/*.test]
]
test_suite "extraquick" -prefix "" -description {
"Extra" quick test suite. Runs in a few minutes on a workstation.
This test suite is the same as the "veryquick" tests, except that
+6 -6
View File
@@ -11,13 +11,13 @@
#
# This file implements a program that produces scripts (either shell scripts
# or batch files) to implement a particular test that is part of the SQLite
# release testing procedure. For example, to run veryquick.test with a
# release testing procedure. For example, to run veryquick.test with a
# specified set of -D compiler switches.
#
# A "configuration" is a set of options passed to [./configure] and [make]
# to build the SQLite library in a particular fashion. A "platform" is a
# list of tests; most platforms are named after the hardware/OS platform
# that the tests will be run on as part of the release procedure. Each
# that the tests will be run on as part of the release procedure. Each
# "test" is a combination of a configuration and a makefile target (e.g.
# "fulltest"). The program may be invoked as follows:
#
@@ -462,7 +462,7 @@ proc main_script {args} {
# 3. If the parameter begins with "-D", add it to $opts.
#
# 4. If the parameter begins with "--" add it to $configOpts. Unless
# this command is preparing a script for MSVC - then add an
# this command is preparing a script for MSVC - then add an
# equivalent to $makeOpts or $opts.
#
# 5. If the parameter begins with "-" add it to $cflags. If in MSVC
@@ -499,7 +499,7 @@ proc main_script {args} {
}
--enable-fts5 {
lappend opts -DSQLITE_ENABLE_FTS5
}
}
--enable-shared {
lappend makeOpts USE_CRT_DLL=1 DYNAMIC_SHELL=1
}
@@ -551,8 +551,8 @@ proc main_script {args} {
puts "\$SRCDIR/configure --with-tcl=\$TCL $configOpts"
puts {}
puts {OPTS=" -DSQLITE_NO_SYNC=1"}
foreach o $opts {
puts "OPTS=\"\$OPTS $o\""
foreach o $opts {
puts "OPTS=\"\$OPTS $o\""
}
puts {}
puts "CFLAGS=\"$cflags\""
+100 -71
View File
@@ -23,9 +23,9 @@
# shell9-5.*: Ensure "dot" commands and SQL intermix ok.
# shell9-6.*: .x command operation and refusal
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set CLI [test_find_cli]
set testdir [file join [file dirname $argv0] ..]
source [file join $testdir tester.tcl]
set CLI [test_find_cli sqlite3x]
db close
forcedelete test.db test.db-journal test.db-wal
forcedelete x.db xn.db
@@ -50,8 +50,8 @@ do_test shell9-1.3 {
set res [catchcmd ":memory: -cmd .shxopts -cmd .quit" ""]
} {0 { name value "-shxopts set"
-------- ----- ---------------
parsing 0 "-shxopts 0x01"
all_opts 0 "-shxopts 0x07"}}
parsing 1 "-shxopts 0x01"
all_opts 1 "-shxopts 0x07"}}
#----------------------------------------------------------------------------
# Test cases shell9-2.*: Basic "dot" command, cross-line token parsing
@@ -65,20 +65,20 @@ ab}}
set cmds " .print \"l1\nl2\"\n .print \"a\\\nb\" \n# c\n ## c"
do_test shell9-2.2 {
set res [catchcmd ":memory: -shxopts 1" $cmds]
set res [catchcmd ":memory:" $cmds]
} {0 {l1
l2
ab}}
set cmds ".echo on\n.seeargs 'a'\\\n'b'\n#!"
do_test shell9-2.3 {
set res [catchcmd ":memory: -shxopts 1" $cmds]
set res [catchcmd ":memory:" $cmds]
} {0 {.seeargs 'a''b'
a|b|}}
set cmds ".echo on\n.seeargs a\\\nb\n#!"
do_test shell9-2.4 {
set res [catchcmd ":memory: -shxopts 1" $cmds]
set res [catchcmd ":memory:" $cmds]
} {0 {.seeargs ab
ab|}}
@@ -94,14 +94,14 @@ q"}}
# Test cases shell9-3.*: .parameter set options and types
set cmds {
.pa set -b b x'a5a5'
.pa set -i ii 33-11
.pa set -i ir 3.3-1.1
.pa set -n ni 3-1
.pa set -n nr 3.3-1.1
.pa set -r ri 1
.pa set -r rr 1.2
.pa set -t t 123
.pa set -b $b x'a5a5'
.pa set -i $ii 33-11
.pa set -i $ir 3.3-1.1
.pa set -n $ni 3-1
.pa set -n $nr 3.3-1.1
.pa set -r $ri 1
.pa set -r $rr 1.2
.pa set -t $t 123
.mode list
select typeof(value) from temp.sqlite_parameters order by key;
}
@@ -117,50 +117,50 @@ real
text}}
set cmds {
.pa set expr 1 + 2 * 3
.pa set text "'1 + 2*3'"
.pa set -t ttext 1 + 2*3
.pa set $expr 1 + 2 * 3
.pa set $text "'1 + 2*3'"
.pa set -t $ttext 1 + 2*3
.pa list
}
do_test shell9-3.2 {
set res [catchcmd ":memory:" $cmds]
} {0 {Scripts
name value
expr 7
text 1 + 2*3
ttext 1 + 2*3}}
} {0 {Bindings:
name value
$expr 7
$text '1 + 2*3'
$ttext '1 + 2*3'}}
set cmds {
.pa set a "'a'"
.pa set b "'b'"
.pa set c "'c'"
.pa unset
.pa list
.pa clear a
.pa list
.pa unset b
.pa list
.pa clear
.pa list
.pa set d "'e'"
.pa set e "'e'"
.pa unset d e
.pa list
.var set a a
.var set b b
.var set c c
.var unset
.var list
.var clear a
.var list
.var unset b
.var list
.var clear
.var list
.var set d e
.var set e e
.var unset d e
.var list
}
do_test shell9-3.3 {
set res [catchcmd ":memory:" $cmds]
} {0 {Scripts
} {0 {Scripts:
name value
a a
b b
c c
Scripts
a 'a'
b 'b'
c 'c'
Scripts:
name value
b b
c c
Scripts
b 'b'
c 'c'
Scripts:
name value
c c}}
c 'c'}}
if {$::tcl_platform(platform)=="unix"} {
proc set_ed {sayWhat} {
@@ -179,23 +179,29 @@ if {$::tcl_platform(platform)=="unix"} {
if {[set_ed @name]} {
set cmds {
.pa set @name Fido
.pa edit -t dog
.x dog
.var edit -t dog
.var set mutt 'SELECT @name;'
.x dog mutt
}
do_test shell9-3.4 {
set res [catchcmd ":memory: -quiet 1 -shxopts 1 -interactive" $cmds]
} {0 {Fido
}}
set res [catchcmd ":memory: -quiet 1 -interactive" $cmds]
list [lindex $res 0] [string trimright [lindex $res 1]]
} {0 {.pa set @name Fido
.var edit -t dog
.var set mutt 'SELECT @name;'
.x dog mutt
Fido
Fido}}
}
#----------------------------------------------------------------------------
# Test cases shell9-4.*: .parameter save/load operation
# Test cases shell9-4.*: .parameter and .vars save/load operation
set cmds {
.pa set -t x '.print Ex'
.pa set -t $t 'tt'
.pa set -i $n 7
.pa save xn.db
.pa save x.db x
.pa save x.db $x
.pa clear
.pa load xn.db
.pa list
@@ -207,30 +213,50 @@ set cmds {
.pa list
}
do_test shell9-4.1 {
set res [catchcmd ":memory: -shxopts 1" $cmds]
} {0 {Binding Values:
set res [catchcmd ":memory:" $cmds]
} {0 {Bindings:
name value
$n 7
Scripts
name value
x .print Ex
Scripts
name value
x .print Ex
Binding Values:
$t 'tt'
Bindings:
name value
$n 7}}
set cmds {
.var set t '.print t'
.var set n 'select 7;'
.var save xn.db
.var save x.db x
.var clear
.var load xn.db
.var list
.var clear
.var load x.db
.var list
.var clear
.var load xn.db n
.var list
}
do_test shell9-4.2 {
set res [catchcmd ":memory:" $cmds]
} {0 {Scripts:
name value
n 'select 7;'
t '.print t'
Scripts:
name value
n 'select 7;'}}
forcedelete x.db xn.db
#----------------------------------------------------------------------------
# Test cases shell9-5.*: Ensure "dot" commands and SQL intermix ok.
set cmds {
.pa set -t mixed "
.vars set mixed "
.print Hi.
select 'Hi.';
.print 'Good\
.print 'Good\\
Bye.'
select 'Good'||
' Bye.';
@@ -238,7 +264,7 @@ set cmds {
.x mixed
}
do_test shell9-5.1 {
set res [catchcmd ":memory: -shxopts 1" $cmds]
set res [catchcmd ":memory:" $cmds]
} {0 {Hi.
Hi.
Good Bye.
@@ -247,11 +273,14 @@ Good Bye.}}
#----------------------------------------------------------------------------
# Test cases shell9-6.*: .x command operation and refusal
set cmds {
.pa set -t $v '.print Ok'
.pa set -t $v '.print Nada'
.var set v '.print Ok'
.x v
.x $v
}
do_test shell9-6.1 {
set res [catchcmd ":memory: -bail -shxopts 1" $cmds]
} {1 {Skipping badly named $v. Run ".help x"}}
set res [catchcmd ":memory: -bail" $cmds]
} {1 {Ok
Skipping badly named $v. Run ".help x"}}
finish_test
+3 -3
View File
@@ -2452,7 +2452,7 @@ proc test_restore_config_pagecache {} {
sqlite3_shutdown
eval sqlite3_config_pagecache $::old_pagecache_config
unset ::old_pagecache_config
unset ::old_pagecache_config
sqlite3_initialize
autoinstall_test_functions
sqlite3 db test.db
@@ -2480,8 +2480,8 @@ proc test_find_binary {nm} {
# the tests in shell[1-5].test. If no such executable can be found, invoke
# [finish_test ; return] in the callers context.
#
proc test_find_cli {} {
set prog [test_find_binary sqlite3]
proc test_find_cli {{cli_name {sqlite3}}} {
set prog [test_find_binary $cli_name]
if {$prog==""} { return -code return }
return $prog
}
+9 -6
View File
@@ -8,7 +8,8 @@ source [file join [file dirname [info script]] wapp.tcl]
# Variables set by the "control" form:
#
# G(platform) - User selected platform.
# G(test) - Set to "Normal", "Veryquick", "Smoketest" or "Build-Only".
# G(test) - Set to "Normal", "Veryquick", "Smoketest", "ShellExt"
# or "Build-Only".
# G(keep) - Boolean. True to delete no files after each test.
# G(msvc) - Boolean. True to use MSVC as the compiler.
# G(tcl) - Use Tcl from this directory for builds.
@@ -96,15 +97,15 @@ proc generate_fossil_info {} {
}
if {[string trim $r2]!=""} {
wapp-trim {
<br><span class=warning>
wapp-trim {
<br><span class=warning>
WARNING: Uncommitted changes in checkout
</span>
}
}
}
# If the application is in "config" state, set the contents of the
# If the application is in "config" state, set the contents of the
# ::G(test_array) global to reflect the tests that will be run. If the
# app is in some other state ("running" or "stopped"), this command
# is a no-op.
@@ -120,7 +121,7 @@ proc set_test_array {} {
# If using MSVC, do not run sanitize or valgrind tests. Or the
# checksymbols test.
if {$G(msvc) && (
"Sanitize" == $config
"Sanitize" == $config
|| "checksymbols" in $target
|| "valgrindtest" in $target
)} {
@@ -132,6 +133,7 @@ proc set_test_array {} {
if {$target!="checksymbols" && $G(platform)!="Failure-Detection"} {
switch -- $G(test) {
Veryquick { set target quicktest }
ShellExt { set target shellext }
Smoketest { set target smoketest }
Build-Only {
set target testfixture
@@ -466,7 +468,7 @@ proc generate_main_page {{extra {}}} {
generate_select_widget Platform control_platform $lOpt $G(platform)
# Build the "test" select widget.
set lOpt [list Normal Veryquick Smoketest Build-Only]
set lOpt [list Normal Veryquick Smoketest ShellExt Build-Only]
generate_select_widget Test control_test $lOpt $G(test)
# Build the "jobs" select widget. Options are 1 to 8.
@@ -846,6 +848,7 @@ for {set i 0} {$i < [llength $lTestArg]} {incr i} {
-smoketest { set G(test) Smoketest }
-veryquick { set G(test) Veryquick }
-shellext { set G(test) ShellExt }
-buildonly { set G(test) Build-Only }
-jobs {
if {$i==[llength $lTestArg]-1} { wapptest_usage }
+2 -2
View File
@@ -116,8 +116,8 @@ set ::inFiles {}
set ::topInfile "?"
set ::presumedOutfile "?"
set ::targetProgram "?"
set ::defaultInfile "src/shell.c.in"
array set ::incTypes [list "*" "$::topDir/$::defaultInfile"]
set ::defaultInfile "$::topDir/src/shell.c.in"
array set ::incTypes [list "*" "$::defaultInfile"]
array set ::ignoringCommands [list]
# Shift 0'th element out of named list and return it, modifying the named list.