]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add the "mptester" target to the makefiles. Make mptester run with mptest
authordrh <drh@noemail.net>
Mon, 8 Apr 2013 14:28:33 +0000 (14:28 +0000)
committerdrh <drh@noemail.net>
Mon, 8 Apr 2013 14:28:33 +0000 (14:28 +0000)
synchronous off by default.

FossilOrigin-Name: 1397830bfead3699a7e6b1858ae67ae15259b89e

Makefile.in
Makefile.msc
main.mk
manifest
manifest.uuid
mptest/mptest.c

index edd29ae011bd2141976c8a1b0e319ce58f363102..0b702def798b543fdcbacec720ac9da860e22ba2 100644 (file)
@@ -502,6 +502,11 @@ sqlite3$(TEXE):    $(TOP)/src/shell.c libsqlite3.la sqlite3.h
                -o $@ $(TOP)/src/shell.c libsqlite3.la \
                $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
 
+mptester$(EXE):        sqlite3.c $(TOP)/mptest/mptest.c
+       $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
+               $(TLIBS) -rpath "$(libdir)"
+
+
 # This target creates a directory named "tsrc" and fills it with
 # copies of all of the C source code and header files needed to
 # build on the target system.  Some of the C source code and header
@@ -950,6 +955,7 @@ clean:
        rm -f shell.c sqlite3ext.h
        rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c
        rm -f sqlite-*-output.vsix
+       rm -f mptest mptest.exe
 
 distclean:     clean
        rm -f config.log config.status libtool Makefile sqlite3.pc
index 70be76afa8ef9e9ab296acd89ac07512b51d2ffc..8c91e86bc8b940aa5194af333a0a2e561aede006 100644 (file)
@@ -813,6 +813,10 @@ sqlite3.exe:       $(TOP)\src\shell.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h
                $(TOP)\src\shell.c \
                /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
 
+mptester.exe:  $(TOP)\mptest\mptest.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h
+       $(LTLINK) $(TOP)\mptest\mptest.c \
+               /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
+
 # This target creates a directory named "tsrc" and fills it with
 # copies of all of the C source code and header files needed to
 # build on the target system.  Some of the C source code and header
@@ -1253,6 +1257,7 @@ clean:
        del /Q shell.c sqlite3ext.h
        del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c
        del /Q sqlite-*-output.vsix
+       del /Q mptester.exe
 
 # Dynamic link library section.
 #
diff --git a/main.mk b/main.mk
index 1294121c0ad4a9410ee5264bc2ca4930142c8d9b..7ab2bca2ba2c26efd72e63e829ad9e6e491c18e5 100644 (file)
--- a/main.mk
+++ b/main.mk
@@ -365,6 +365,10 @@ sqlite3$(EXE):     $(TOP)/src/shell.c libsqlite3.a sqlite3.h
                $(TOP)/src/shell.c                                  \
                libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
 
+mptester$(EXE):        sqlite3.c $(TOP)/mptest/mptest.c
+       $(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
+               $(TLIBS) $(THREADLIB)
+
 sqlite3.o:     sqlite3.c
        $(TCCX) -c sqlite3.c
 
@@ -626,3 +630,4 @@ clean:
        rm -f shell.c sqlite3ext.h
        rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c
        rm -f sqlite-*-output.vsix
+       rm -f mptest mptest.exe
index 1a6f824d3140ef39e4de620dd549ddaefc7a4a5e..7acc35ecdc6ffc225fcbcc0fbfb2cbe74b7611a1 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,9 +1,9 @@
-C Fix\sharmless\scompiler\swarnings\sin\smptest.c.
-D 2013-04-08T13:59:11.021
+C Add\sthe\s"mptester"\starget\sto\sthe\smakefiles.\s\sMake\smptester\srun\swith\nsynchronous\soff\sby\sdefault.
+D 2013-04-08T14:28:33.142
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
-F Makefile.in aafa71d66bab7e87fb2f348152340645f79f0244
+F Makefile.in 6a6a8c548822302d3a9a651f0296bbc3dad55e83
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
-F Makefile.msc 9ab787d472c9cb8bad29c2c4aeba15b06fba7bc4
+F Makefile.msc a244e5b5ba2493625db95b4d46b79201ea868bfe
 F Makefile.vxworks db21ed42a01d5740e656b16f92cb5d8d5e5dd315
 F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6
 F VERSION 05c7bd63b96f31cfdef5c766ed91307ac121f5aa
@@ -103,7 +103,7 @@ F ext/rtree/tkt3363.test 142ab96eded44a3615ec79fba98c7bde7d0f96de
 F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024
 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
 F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
-F main.mk b25a7a0b657409b2dcf9b09d39562703d5df702d
+F main.mk 1c26f3cc57d7c357da5218ae2928b7ca5acfecde
 F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a
 F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f
 F mkextw.sh 4123480947681d9b434a5e7b1ee08135abe409ac
@@ -111,7 +111,7 @@ F mkopcodec.awk f6fccee29e68493bfd90a2e0466ede5fa94dd2fc
 F mkopcodeh.awk 29b84656502eee5f444c3147f331ee686956ab0e
 F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
 F mptest/config01.test 3f4ddeb152a4f83872f0fa7fcb48d9fd609893da
-F mptest/mptest.c fb46946df7d6f2e8be8c028b21a580a977326f24
+F mptest/mptest.c 739950807a48af97fb3e432256fef96540d0e936
 F mptest/multiwrite01.test aef0af17f1ce1beacd158e403a45a21008d7a70c
 F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
 F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
@@ -1047,7 +1047,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P 91397a147ce4f67a7ea1182f06a7dda3a96ec465
-R ede2c5555feb77dd0a5488dbe1f8d502
+P 59bdbb10ed67bf79e0991e2ad58a28321dedb959
+R 1f9c112eec8d81ff124d0eb10d39eea3
 U drh
-Z 8e0fdcf5a1bb9a273c7156627676f7a5
+Z 523cf56f3e6158426b3e246d7dff8e8c
index a4c5a4a477835087fd80e691d465f0250d41f776..dbce6398ba3276bb2bd5520387fe03bcabe036a2 100644 (file)
@@ -1 +1 @@
-59bdbb10ed67bf79e0991e2ad58a28321dedb959
\ No newline at end of file
+1397830bfead3699a7e6b1858ae67ae15259b89e
\ No newline at end of file
index 30449bddfb798da5add03494005b4fda0f4430fa..48bc382846d961aaa6d2889d569bd2cd64537439 100644 (file)
 */
 #include "sqlite3.h"
 #include <stdio.h>
-#include <unistd.h>
+#if defined(_WIN32)
+# include <process.h>
+#else
+# include <unistd.h>
+#endif
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
@@ -62,6 +66,7 @@ static struct Global {
   int nError;            /* Number of errors */
   int nTest;             /* Number of --match operators */
   int iTimeout;          /* Milliseconds until a busy timeout */
+  int bSync;             /* Call fsync() */
 } g;
 
 /* Default timeout */
@@ -604,11 +609,15 @@ static void startClient(int iClient){
   if( sqlite3_changes(g.db) ){
 #if !defined(_WIN32)
     char *zSys;
+    int rc;
     zSys = sqlite3_mprintf(
-                 "%s \"%s\" --client %d --trace %d %s&",
+                 "%s \"%s\" --client %d --trace %d %s%s&",
                  g.argv0, g.zDbFile, iClient, g.iTrace,
-                 g.bSqlTrace ? "--sqltrace " : "");
-    system(zSys);
+                 g.bSqlTrace ? "--sqltrace " : "",
+                 g.bSync ? "--sync " : ""
+    );
+    rc = system(zSys);
+    if( rc ) errorMessage("system() fails with error code %d", rc);
     sqlite3_free(zSys);
 #endif
 #if defined(_WIN32)
@@ -922,8 +931,8 @@ static void runScript(
       if( g.iTrace ) logMessage("begin script [%s]\n", zNewFile);
       runScript(0, 0, zNewScript, zNewFile);
       sqlite3_free(zNewScript);
-      sqlite3_free(zToDel);
       if( g.iTrace ) logMessage("end script [%s]\n", zNewFile);
+      sqlite3_free(zToDel);
     }else
 
     /*
@@ -1148,6 +1157,7 @@ int main(int argc, char **argv){
   if( zTrace ) g.iTrace = atoi(zTrace);
   if( findOption(argv+2, &n, "quiet", 0)!=0 ) g.iTrace = 0;
   g.bSqlTrace = findOption(argv+2, &n, "sqltrace", 0)!=0;
+  g.bSync = findOption(argv+2, &n, "sync", 0)!=0;
   if( g.zErrLog ){
     g.pErrLog = fopen(g.zErrLog, "a");
   }else{
@@ -1184,6 +1194,7 @@ int main(int argc, char **argv){
                           evalFunc, 0, 0);
   g.iTimeout = DEFAULT_TIMEOUT;
   if( g.bSqlTrace ) sqlite3_trace(g.db, sqlTraceCallback, 0);
+  if( !g.bSync ) trySql("PRAGMA synchronous=OFF");
   if( iClient>0 ){
     if( n>0 ) unrecognizedArguments(argv[0], n, argv+2);
     if( g.iTrace ) logMessage("start-client");