Index: third_party/sqlite/src/Makefile.in |
diff --git a/third_party/sqlite/src/Makefile.in b/third_party/sqlite/src/Makefile.in |
index 13894865d6887d121a9f92a371971b63078adeac..8b965c7accceb3d929d49eb387635ebcfc351cb9 100644 |
--- a/third_party/sqlite/src/Makefile.in |
+++ b/third_party/sqlite/src/Makefile.in |
@@ -15,18 +15,22 @@ |
# The toplevel directory of the source tree. This is the directory |
# that contains this "Makefile.in" and the "configure.in" script. |
# |
-TOP = @srcdir@ |
+TOP = @abs_srcdir@ |
# C Compiler and options for use in building executables that |
# will run on the platform that is doing the build. |
# |
BCC = @BUILD_CC@ @BUILD_CFLAGS@ |
-# C Compile and options for use in building executables that |
+# TCC is the C Compile and options for use in building executables that |
# will run on the target platform. (BCC and TCC are usually the |
-# same unless your are cross-compiling.) |
+# same unless your are cross-compiling.) Separate CC and CFLAGS macros |
+# are provide so that these aspects of the build process can be changed |
+# on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined" |
# |
-TCC = @CC@ @CPPFLAGS@ @CFLAGS@ -I. -I${TOP}/src -I${TOP}/ext/rtree |
+CC = @CC@ |
+CFLAGS = @CPPFLAGS@ @CFLAGS@ |
+TCC = $(CC) $(CFLAGS) -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/fts3 |
# Define this for the autoconf-based build, so that the code knows it can |
# include the generated config.h |
@@ -37,7 +41,7 @@ TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite |
# Omitting the define will cause extra debugging code to be inserted and |
# includes extra comments when "EXPLAIN stmt" is used. |
# |
-TCC += @TARGET_DEBUG@ @XTHREADCONNECT@ |
+TCC += @TARGET_DEBUG@ |
# Compiler options needed for programs that use the TCL library. |
# |
@@ -50,6 +54,7 @@ LIBTCL = @TCL_LIB_SPEC@ |
# Compiler options needed for programs that use the readline() library. |
# |
READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@ |
+READLINE_FLAGS += -DHAVE_EDITLINE=@TARGET_HAVE_EDITLINE@ |
# The library that programs using readline() must link against. |
# |
@@ -61,7 +66,7 @@ TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@ |
# Any target libraries which libsqlite must be linked against |
# |
-TLIBS = @LIBS@ |
+TLIBS = @LIBS@ $(LIBS) |
# Flags controlling use of the in memory btree implementation |
# |
@@ -151,9 +156,6 @@ LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC) $(LTCOMPILE_EXTRAS) |
LTLINK = $(LIBTOOL) --mode=link $(TCC) $(LTCOMPILE_EXTRAS) @LDFLAGS@ $(LTLINK_EXTRAS) |
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) |
-# nawk compatible awk. |
-NAWK = @AWK@ |
- |
# You should not have to change anything below this line |
############################################################################### |
@@ -163,24 +165,26 @@ USE_AMALGAMATION = @USE_AMALGAMATION@ |
# |
LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \ |
backup.lo bitvec.lo btmutex.lo btree.lo build.lo \ |
- callback.lo complete.lo ctime.lo date.lo delete.lo \ |
+ callback.lo complete.lo ctime.lo date.lo dbstat.lo delete.lo \ |
expr.lo fault.lo fkey.lo \ |
fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \ |
fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \ |
fts3_tokenize_vtab.lo \ |
fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \ |
+ fts5.lo \ |
func.lo global.lo hash.lo \ |
- icu.lo insert.lo journal.lo legacy.lo loadext.lo \ |
+ icu.lo insert.lo journal.lo json1.lo legacy.lo loadext.lo \ |
main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \ |
memjournal.lo \ |
mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \ |
notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \ |
pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \ |
random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \ |
- table.lo threads.lo tokenize.lo trigger.lo \ |
+ table.lo threads.lo tokenize.lo treeview.lo trigger.lo \ |
update.lo util.lo vacuum.lo \ |
vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \ |
- vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo |
+ vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \ |
+ utf.lo vtab.lo |
# Object files for the amalgamation. |
# |
@@ -209,6 +213,7 @@ SRC = \ |
$(TOP)/src/complete.c \ |
$(TOP)/src/ctime.c \ |
$(TOP)/src/date.c \ |
+ $(TOP)/src/dbstat.c \ |
$(TOP)/src/delete.c \ |
$(TOP)/src/expr.c \ |
$(TOP)/src/fault.c \ |
@@ -230,6 +235,7 @@ SRC = \ |
$(TOP)/src/mem3.c \ |
$(TOP)/src/mem5.c \ |
$(TOP)/src/memjournal.c \ |
+ $(TOP)/src/msvc.h \ |
$(TOP)/src/mutex.c \ |
$(TOP)/src/mutex.h \ |
$(TOP)/src/mutex_noop.c \ |
@@ -250,6 +256,7 @@ SRC = \ |
$(TOP)/src/pcache.h \ |
$(TOP)/src/pcache1.c \ |
$(TOP)/src/pragma.c \ |
+ $(TOP)/src/pragma.h \ |
$(TOP)/src/prepare.c \ |
$(TOP)/src/printf.c \ |
$(TOP)/src/random.c \ |
@@ -264,9 +271,10 @@ SRC = \ |
$(TOP)/src/sqliteInt.h \ |
$(TOP)/src/sqliteLimit.h \ |
$(TOP)/src/table.c \ |
- $(TOP)/src/threads.c \ |
$(TOP)/src/tclsqlite.c \ |
+ $(TOP)/src/threads.c \ |
$(TOP)/src/tokenize.c \ |
+ $(TOP)/src/treeview.c \ |
$(TOP)/src/trigger.c \ |
$(TOP)/src/utf.c \ |
$(TOP)/src/update.c \ |
@@ -282,10 +290,13 @@ SRC = \ |
$(TOP)/src/vdbetrace.c \ |
$(TOP)/src/vdbeInt.h \ |
$(TOP)/src/vtab.c \ |
+ $(TOP)/src/vxworks.h \ |
$(TOP)/src/wal.c \ |
$(TOP)/src/wal.h \ |
$(TOP)/src/walker.c \ |
$(TOP)/src/where.c \ |
+ $(TOP)/src/wherecode.c \ |
+ $(TOP)/src/whereexpr.c \ |
$(TOP)/src/whereInt.h |
# Source code for extensions |
@@ -332,6 +343,12 @@ SRC += \ |
SRC += \ |
$(TOP)/ext/rtree/rtree.h \ |
$(TOP)/ext/rtree/rtree.c |
+SRC += \ |
+ $(TOP)/ext/rbu/sqlite3rbu.h \ |
+ $(TOP)/ext/rbu/sqlite3rbu.c |
+SRC += \ |
+ $(TOP)/ext/misc/json1.c |
+ |
# Generated source code files |
@@ -360,6 +377,7 @@ TESTSRC = \ |
$(TOP)/src/test_autoext.c \ |
$(TOP)/src/test_async.c \ |
$(TOP)/src/test_backup.c \ |
+ $(TOP)/src/test_blob.c \ |
$(TOP)/src/test_btree.c \ |
$(TOP)/src/test_config.c \ |
$(TOP)/src/test_demovfs.c \ |
@@ -382,25 +400,30 @@ TESTSRC = \ |
$(TOP)/src/test_server.c \ |
$(TOP)/src/test_superlock.c \ |
$(TOP)/src/test_syscall.c \ |
- $(TOP)/src/test_stat.c \ |
$(TOP)/src/test_tclvar.c \ |
$(TOP)/src/test_thread.c \ |
$(TOP)/src/test_vfs.c \ |
+ $(TOP)/src/test_windirent.c \ |
$(TOP)/src/test_wsd.c \ |
$(TOP)/ext/fts3/fts3_term.c \ |
- $(TOP)/ext/fts3/fts3_test.c |
+ $(TOP)/ext/fts3/fts3_test.c \ |
+ $(TOP)/ext/rbu/test_rbu.c |
# Statically linked extensions |
# |
TESTSRC += \ |
$(TOP)/ext/misc/amatch.c \ |
$(TOP)/ext/misc/closure.c \ |
+ $(TOP)/ext/misc/eval.c \ |
$(TOP)/ext/misc/fileio.c \ |
$(TOP)/ext/misc/fuzzer.c \ |
+ $(TOP)/ext/fts5/fts5_tcl.c \ |
+ $(TOP)/ext/fts5/fts5_test_mi.c \ |
$(TOP)/ext/misc/ieee754.c \ |
$(TOP)/ext/misc/nextchar.c \ |
$(TOP)/ext/misc/percentile.c \ |
$(TOP)/ext/misc/regexp.c \ |
+ $(TOP)/ext/misc/series.c \ |
$(TOP)/ext/misc/spellfix.c \ |
$(TOP)/ext/misc/totype.c \ |
$(TOP)/ext/misc/wholenumber.c |
@@ -415,6 +438,7 @@ TESTSRC2 = \ |
$(TOP)/src/build.c \ |
$(TOP)/src/ctime.c \ |
$(TOP)/src/date.c \ |
+ $(TOP)/src/dbstat.c \ |
$(TOP)/src/expr.c \ |
$(TOP)/src/func.c \ |
$(TOP)/src/insert.c \ |
@@ -441,6 +465,8 @@ TESTSRC2 = \ |
$(TOP)/src/vdbemem.c \ |
$(TOP)/src/vdbetrace.c \ |
$(TOP)/src/where.c \ |
+ $(TOP)/src/wherecode.c \ |
+ $(TOP)/src/whereexpr.c \ |
parse.c \ |
$(TOP)/ext/fts3/fts3.c \ |
$(TOP)/ext/fts3/fts3_aux.c \ |
@@ -458,6 +484,7 @@ HDR = \ |
$(TOP)/src/hash.h \ |
$(TOP)/src/hwtime.h \ |
keywordhash.h \ |
+ $(TOP)/src/msvc.h \ |
$(TOP)/src/mutex.h \ |
opcodes.h \ |
$(TOP)/src/os.h \ |
@@ -467,12 +494,14 @@ HDR = \ |
$(TOP)/src/pager.h \ |
$(TOP)/src/pcache.h \ |
parse.h \ |
+ $(TOP)/src/pragma.h \ |
sqlite3.h \ |
$(TOP)/src/sqlite3ext.h \ |
$(TOP)/src/sqliteInt.h \ |
$(TOP)/src/sqliteLimit.h \ |
$(TOP)/src/vdbe.h \ |
$(TOP)/src/vdbeInt.h \ |
+ $(TOP)/src/vxworks.h \ |
$(TOP)/src/whereInt.h \ |
config.h |
@@ -498,6 +527,32 @@ EXTHDR += \ |
EXTHDR += \ |
$(TOP)/ext/rtree/sqlite3rtree.h |
+# executables needed for testing |
+# |
+TESTPROGS = \ |
+ testfixture$(TEXE) \ |
+ sqlite3$(TEXE) \ |
+ sqlite3_analyzer$(TEXE) \ |
+ sqldiff$(TEXE) |
+ |
+# Databases containing fuzzer test cases |
+# |
+FUZZDATA = \ |
+ $(TOP)/test/fuzzdata1.db \ |
+ $(TOP)/test/fuzzdata2.db \ |
+ $(TOP)/test/fuzzdata3.db \ |
+ $(TOP)/test/fuzzdata4.db |
+ |
+# Standard options to testfixture |
+# |
+TESTOPTS = --verbose=file --output=test-out.txt |
+ |
+# Extra compiler options for various shell tools |
+# |
+SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 |
+FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1 |
+FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 |
+ |
# This is the default Makefile target. The objects listed here |
# are what get build when you type just "make" with no arguments. |
# |
@@ -521,14 +576,37 @@ libtclsqlite3.la: tclsqlite.lo libsqlite3.la |
-avoid-version |
sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h |
- $(LTLINK) $(READLINE_FLAGS) \ |
- -o $@ $(TOP)/src/shell.c libsqlite3.la \ |
+ $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \ |
+ $(TOP)/src/shell.c libsqlite3.la \ |
$(LIBREADLINE) $(TLIBS) -rpath "$(libdir)" |
-mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c |
+sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h |
+ $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) |
+ |
+fuzzershell$(TEXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h |
+ $(LTLINK) -o $@ $(FUZZERSHELL_OPT) \ |
+ $(TOP)/tool/fuzzershell.c sqlite3.c $(TLIBS) |
+ |
+fuzzcheck$(TEXE): $(TOP)/test/fuzzcheck.c sqlite3.c sqlite3.h |
+ $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(TOP)/test/fuzzcheck.c sqlite3.c $(TLIBS) |
+ |
+mptester$(TEXE): sqlite3.c $(TOP)/mptest/mptest.c |
$(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \ |
$(TLIBS) -rpath "$(libdir)" |
+MPTEST1=./mptester$(TEXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20 |
+MPTEST2=./mptester$(TEXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20 |
+mptest: mptester$(TEXE) |
+ rm -f mptest.db |
+ $(MPTEST1) --journalmode DELETE |
+ $(MPTEST2) --journalmode WAL |
+ $(MPTEST1) --journalmode WAL |
+ $(MPTEST2) --journalmode PERSIST |
+ $(MPTEST1) --journalmode PERSIST |
+ $(MPTEST2) --journalmode TRUNCATE |
+ $(MPTEST1) --journalmode TRUNCATE |
+ $(MPTEST2) --journalmode DELETE |
+ |
# This target creates a directory named "tsrc" and fills it with |
# copies of all of the C source code and header files needed to |
@@ -536,19 +614,23 @@ mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c |
# files are automatically generated. This target takes care of |
# all that automatic generation. |
# |
-.target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl |
+.target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c |
rm -rf tsrc |
mkdir tsrc |
cp -f $(SRC) tsrc |
rm tsrc/sqlite.h.in tsrc/parse.y |
$(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new |
mv vdbe.new tsrc/vdbe.c |
+ cp fts5.c fts5.h tsrc |
touch .target_source |
sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl |
$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl |
cp tsrc/shell.c tsrc/sqlite3ext.h . |
+sqlite3ext.h: .target_source |
+ cp tsrc/sqlite3ext.h . |
+ |
tclsqlite3.c: sqlite3.c |
echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c |
cat sqlite3.c >>tclsqlite3.c |
@@ -565,9 +647,9 @@ sqlite3.lo: sqlite3.c |
# Rules to build the LEMON compiler generator |
# |
-lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/src/lempar.c |
+lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c |
$(BCC) -o $@ $(TOP)/tool/lemon.c |
- cp $(TOP)/src/lempar.c . |
+ cp $(TOP)/tool/lempar.c . |
# Rules to build individual *.o files from generated *.c files. This |
# applies to: |
@@ -622,6 +704,9 @@ ctime.lo: $(TOP)/src/ctime.c $(HDR) |
date.lo: $(TOP)/src/date.c $(HDR) |
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c |
+dbstat.lo: $(TOP)/src/dbstat.c $(HDR) |
+ $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbstat.c |
+ |
delete.lo: $(TOP)/src/delete.c $(HDR) |
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c |
@@ -745,6 +830,9 @@ threads.lo: $(TOP)/src/threads.c $(HDR) |
tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR) |
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c |
+treeview.lo: $(TOP)/src/treeview.c $(HDR) |
+ $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/treeview.c |
+ |
trigger.lo: $(TOP)/src/trigger.c $(HDR) |
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c |
@@ -793,6 +881,12 @@ walker.lo: $(TOP)/src/walker.c $(HDR) |
where.lo: $(TOP)/src/where.c $(HDR) |
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c |
+wherecode.lo: $(TOP)/src/wherecode.c $(HDR) |
+ $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wherecode.c |
+ |
+whereexpr.lo: $(TOP)/src/whereexpr.c $(HDR) |
+ $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/whereexpr.c |
+ |
tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR) |
$(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c |
@@ -808,22 +902,22 @@ tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la |
# Rules to build opcodes.c and opcodes.h |
# |
-opcodes.c: opcodes.h $(TOP)/mkopcodec.awk |
- $(NAWK) -f $(TOP)/mkopcodec.awk opcodes.h >opcodes.c |
+opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl |
+ $(TCLSH_CMD) $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c |
-opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk |
- cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h |
+opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl |
+ cat parse.h $(TOP)/src/vdbe.c | $(TCLSH_CMD) $(TOP)/tool/mkopcodeh.tcl >opcodes.h |
# Rules to build parse.c and parse.h - the outputs of lemon. |
# |
parse.h: parse.c |
-parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopcodes.awk |
+parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/tool/addopcodes.tcl |
cp $(TOP)/src/parse.y . |
rm -f parse.h |
./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y |
mv parse.h parse.h.temp |
- $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h |
+ $(TCLSH_CMD) $(TOP)/tool/addopcodes.tcl parse.h.temp >parse.h |
sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION |
$(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h |
@@ -899,6 +993,42 @@ fts3_write.lo: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR) |
rtree.lo: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR) |
$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c |
+json1.lo: $(TOP)/ext/misc/json1.c |
+ $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c |
+ |
+# FTS5 things |
+# |
+FTS5_SRC = \ |
+ $(TOP)/ext/fts5/fts5.h \ |
+ $(TOP)/ext/fts5/fts5Int.h \ |
+ $(TOP)/ext/fts5/fts5_aux.c \ |
+ $(TOP)/ext/fts5/fts5_buffer.c \ |
+ $(TOP)/ext/fts5/fts5_main.c \ |
+ $(TOP)/ext/fts5/fts5_config.c \ |
+ $(TOP)/ext/fts5/fts5_expr.c \ |
+ $(TOP)/ext/fts5/fts5_hash.c \ |
+ $(TOP)/ext/fts5/fts5_index.c \ |
+ fts5parse.c fts5parse.h \ |
+ $(TOP)/ext/fts5/fts5_storage.c \ |
+ $(TOP)/ext/fts5/fts5_tokenize.c \ |
+ $(TOP)/ext/fts5/fts5_unicode2.c \ |
+ $(TOP)/ext/fts5/fts5_varint.c \ |
+ $(TOP)/ext/fts5/fts5_vocab.c \ |
+ |
+fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon |
+ cp $(TOP)/ext/fts5/fts5parse.y . |
+ rm -f fts5parse.h |
+ ./lemon $(OPTS) fts5parse.y |
+ |
+fts5parse.h: fts5parse.c |
+ |
+fts5.c: $(FTS5_SRC) |
+ $(TCLSH_CMD) $(TOP)/ext/fts5/tool/mkfts5c.tcl |
+ cp $(TOP)/ext/fts5/fts5.h . |
+ |
+fts5.lo: fts5.c $(HDR) $(EXTHDR) |
+ $(LTCOMPILE) -DSQLITE_CORE -c fts5.c |
+ |
# Rules to build the 'testfixture' application. |
# |
@@ -920,25 +1050,59 @@ testfixture$(TEXE): $(TESTFIXTURE_SRC) |
$(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \ |
-o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS) |
+# A very detailed test running most or all test cases |
+fulltest: $(TESTPROGS) fuzztest |
+ ./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS) |
-fulltest: testfixture$(TEXE) sqlite3$(TEXE) |
- ./testfixture$(TEXE) $(TOP)/test/all.test |
+# Really really long testing |
+soaktest: $(TESTPROGS) |
+ ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS) |
-soaktest: testfixture$(TEXE) sqlite3$(TEXE) |
- ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 |
- |
-fulltestonly: testfixture$(TEXE) sqlite3$(TEXE) |
+# Do extra testing but not everything. |
+fulltestonly: $(TESTPROGS) fuzztest |
./testfixture$(TEXE) $(TOP)/test/full.test |
-test: testfixture$(TEXE) sqlite3$(TEXE) |
- ./testfixture$(TEXE) $(TOP)/test/veryquick.test |
+# Fuzz testing |
+fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) |
+ ./fuzzcheck$(TEXE) $(FUZZDATA) |
+ |
+fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA) |
+ ./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA) |
+ |
+valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) |
+ valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA) |
+ |
+# Minimal testing that runs in less than 3 minutes |
+# |
+quicktest: ./testfixture$(TEXE) |
+ ./testfixture$(TEXE) $(TOP)/test/extraquick.test $(TESTOPTS) |
+ |
+# This is the common case. Run many tests that do not take too long, |
+# including fuzzcheck, sqlite3_analyzer, and sqldiff tests. |
+# |
+test: $(TESTPROGS) fastfuzztest |
+ ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS) |
+ |
+# Run a test using valgrind. This can take a really long time |
+# because valgrind is so much slower than a native machine. |
+# |
+valgrindtest: $(TESTPROGS) valgrindfuzz |
+ OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS) |
-sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl |
+# A very fast test that checks basic sanity. The name comes from |
+# the 60s-era electronics testing: "Turn it on and see if smoke |
+# comes out." |
+# |
+smoketest: $(TESTPROGS) fuzzcheck$(TEXE) |
+ ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS) |
+ |
+sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl |
echo "#define TCLSH 2" > $@ |
- cat sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c >> $@ |
+ echo "#define SQLITE_ENABLE_DBSTAT_VTAB 1" >> $@ |
+ cat sqlite3.c $(TOP)/src/tclsqlite.c >> $@ |
echo "static const char *tclsh_main_loop(void){" >> $@ |
echo "static const char *zMainloop = " >> $@ |
- $(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl >> $@ |
+ $(TCLSH_CMD) $(TOP)/tool/tostr.tcl $(TOP)/tool/spaceanal.tcl >> $@ |
echo "; return zMainloop; }" >> $@ |
sqlite3_analyzer$(TEXE): sqlite3_analyzer.c |
@@ -965,9 +1129,42 @@ LogEst$(TEXE): $(TOP)/tool/logest.c sqlite3.h |
wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.c |
$(LTLINK) -o $@ $(TOP)/test/wordcount.c sqlite3.c $(TLIBS) |
-speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo |
+speedtest1$(TEXE): $(TOP)/test/speedtest1.c sqlite3.lo |
$(LTLINK) -o $@ $(TOP)/test/speedtest1.c sqlite3.lo $(TLIBS) |
+# This target will fail if the SQLite amalgamation contains any exported |
+# symbols that do not begin with "sqlite3_". It is run as part of the |
+# releasetest.tcl script. |
+# |
+checksymbols: sqlite3.lo |
+ nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0 |
+ echo '0 errors out of 1 tests' |
+ |
+# Build the amalgamation-autoconf package. |
+# |
+amalgamation-tarball: sqlite3.c |
+ TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh |
+ |
+# The next two rules are used to support the "threadtest" target. Building |
+# threadtest runs a few thread-safety tests that are implemented in C. This |
+# target is invoked by the releasetest.tcl script. |
+# |
+THREADTEST3_SRC = $(TOP)/test/threadtest3.c \ |
+ $(TOP)/test/tt3_checkpoint.c \ |
+ $(TOP)/test/tt3_index.c \ |
+ $(TOP)/test/tt3_vacuum.c \ |
+ $(TOP)/test/tt3_stress.c \ |
+ $(TOP)/test/tt3_lookaside1.c |
+ |
+threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC) |
+ $(LTLINK) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.lo -o $@ $(TLIBS) |
+ |
+threadtest: threadtest3$(TEXE) |
+ ./threadtest3$(TEXE) |
+ |
+releasetest: |
+ $(TCLSH_CMD) $(TOP)/test/releasetest.tcl |
+ |
# Standard install and cleanup targets |
# |
lib_install: libsqlite3.la |
@@ -984,7 +1181,7 @@ install: sqlite3$(BEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_instal |
$(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir) |
pkgIndex.tcl: |
- echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3.so sqlite3]' > $@ |
+ echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3$(SHLIB_SUFFIX) sqlite3]' > $@ |
tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl |
$(INSTALL) -d $(DESTDIR)$(TCLLIBDIR) |
$(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR) |
@@ -1012,9 +1209,13 @@ clean: |
rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c |
rm -f sqlite-*-output.vsix |
rm -f mptester mptester.exe |
+ rm -f fuzzershell fuzzershell.exe |
+ rm -f fuzzcheck fuzzcheck.exe |
+ rm -f sqldiff sqldiff.exe |
+ rm -f fts5.* fts5parse.* |
distclean: clean |
- rm -f config.log config.status libtool Makefile sqlite3.pc |
+ rm -f config.h config.log config.status libtool Makefile sqlite3.pc |
# |
# Windows section |