Path portability enhancements for mptester.exe.

FossilOrigin-Name: c8694657bdc5d0917d8fe78fd3937d8e9cd9d04b
This commit is contained in:
drh 2015-03-31 18:18:53 +00:00
commit 2c32ed7a58
7 changed files with 34 additions and 23 deletions

View File

@ -480,8 +480,8 @@ RCC = $(RCC) -DSQLITE_DEBUG
!ENDIF
!IF $(DEBUG)>4
TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1
RCC = $(RCC) -DSQLITE_DEBUG_OS_TRACE=1
TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1 -DSQLITE_FORCE_OS_TRACE=1
RCC = $(RCC) -DSQLITE_DEBUG_OS_TRACE=1 -DSQLITE_FORCE_OS_TRACE=1
!ENDIF
!IF $(DEBUG)>5
@ -1158,8 +1158,8 @@ mptester.exe: $(TOP)\mptest\mptest.c $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
$(LTLINK) $(SHELL_COMPILE_OPTS) $(TOP)\mptest\mptest.c \
/link $(LTLINKOPTS) $(LTLIBPATHS) $(SHELL_LINK_OPTS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
MPTEST1 = mptester mptest.db $(TOP)/mptest/crash01.test --repeat 20
MPTEST2 = mptester mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
mptest: mptester.exe
del /Q mptest.db 2>NUL

View File

@ -1,9 +1,9 @@
C Add\sthe\s"mptest"\starget\sto\smain.mk.\s\sChange\sTRUNCATE\sand\sPERSIST\sto\sDELETE\nfor\smptest.c\son\sWindows\sbecause\sof\sproblems\strying\sto\sdelete\sthe\sjournal.
D 2015-03-31T18:05:49.317
C Path\sportability\senhancements\sfor\smptester.exe.
D 2015-03-31T18:18:53.022
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 00d12636df7a5b08af09116bcd6c7bfd49b8b3b4
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F Makefile.msc a8d817fa486d8c88dfbd19ae6a6567d9d350de39
F Makefile.msc c3744ee851d76d2be0ff247f5a89a74c88f2ece2
F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858
F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866
F VERSION 319eb1ced4b4d17a67730f2b7b85f15c1346cb60
@ -160,7 +160,7 @@ F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
F mptest/crash02.subtest f4ef05adcd15d60e5d2bd654204f2c008b519df8
F mptest/mptest.c dae6de83eddac3ef97fc4111632f6066760f939a
F mptest/mptest.c fca59f0a922e03f95ed17c44b1515ed37a841c81
F mptest/multiwrite01.test dab5c5f8f9534971efce679152c5146da265222d
F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
@ -195,7 +195,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e
F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770
F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660
F src/main.c 40e333960d53f7d50ee8ce09d40431c87ea653f2
F src/main.c 1cc847aae38c804427f155441c1b73c3f9144c9a
F src/malloc.c 6a370b83d54e4bbf6f94021221c2a311cff26a18
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c abe6ee469b6c5a35c7f22bfeb9c9bac664a1c987
@ -212,7 +212,7 @@ F src/mutex_w32.c 61660ada28d8308ad190f444c2170c4f2a590c2f
F src/notify.c 9711a7575036f0d3040ba61bc6e217f13a9888e7
F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8
F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_common.h 75309c5996a3d201d59ccde946caef1651f206e2
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
F src/os_unix.c a4dadbc2da41599e99093e91e276c38c17a73b89
F src/os_win.c 23c2d1fab9b44e728e7d3ac0c82d5ac2a96de290
@ -235,7 +235,7 @@ F src/shell.c 84a1593bd86aaa14f4da8a8f9b16fbc239d262aa
F src/sqlite.h.in 278602140d49575e8708e643161f4263e428a02a
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
F src/sqliteInt.h d02d2b85cb02a38bc442cf9302ec8209baf6771d
F src/sqliteInt.h b54a3815ab5a353aac0e6f94c02c51a065fa7fab
F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
F src/status.c f266ad8a2892d659b74f0f50cb6a88b6e7c12179
F src/table.c e7a09215315a978057fb42c640f890160dbcc45e
@ -1248,7 +1248,8 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 5d533eee049e63b3700f5ef7c28c588afccde57a
R 9e646d8c9c851fc471bfbde27cfe2ec7
P ea697e6d9ff1f4d77774589a02ba4a18feafbf03 da49634b331812fa4d6e33d72c9661aeab203ae8
R 126147c160c4bad0e1b7fe3417e6316b
T +closed da49634b331812fa4d6e33d72c9661aeab203ae8
U drh
Z 7401f8256f1a048a9f3296d27a2e41e1
Z 3bf817d5b936af30f76c04f3a5290142

View File

@ -1 +1 @@
ea697e6d9ff1f4d77774589a02ba4a18feafbf03
c8694657bdc5d0917d8fe78fd3937d8e9cd9d04b

View File

@ -53,6 +53,13 @@
# define GETPID getpid
#endif
/* The directory separator character(s) */
#if defined(_WIN32)
# define isDirSep(c) (((c) == '/') || ((c) == '\\'))
#else
# define isDirSep(c) ((c) == '/')
#endif
/* Mark a parameter as unused to suppress compiler warnings */
#define UNUSED_PARAMETER(x) (void)x
@ -824,7 +831,7 @@ static void waitForClient(int iClient, int iTimeout, char *zErrPrefix){
*/
static char *filenameTail(char *z){
int i, j;
for(i=j=0; z[i]; i++) if( z[i]=='/' ) j = i+1;
for(i=j=0; z[i]; i++) if( isDirSep(z[i]) ) j = i+1;
return z+j;
}
@ -1021,9 +1028,9 @@ static void runScript(
char *zNewFile, *zNewScript;
char *zToDel = 0;
zNewFile = azArg[0];
if( zNewFile[0]!='/' ){
if( !isDirSep(zNewFile[0]) ){
int k;
for(k=(int)strlen(zFilename)-1; k>=0 && zFilename[k]!='/'; k--){}
for(k=(int)strlen(zFilename)-1; k>=0 && !isDirSep(zFilename[k]); k--){}
if( k>0 ){
zNewFile = zToDel = sqlite3_mprintf("%.*s/%s", k,zFilename,zNewFile);
}
@ -1231,7 +1238,7 @@ static void usage(const char *argv0){
int i;
const char *zTail = argv0;
for(i=0; argv0[i]; i++){
if( argv0[i]=='/' ) zTail = argv0+i+1;
if( isDirSep(argv0[i]) ) zTail = argv0+i+1;
}
fprintf(stderr,"Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n", zTail);
exit(1);
@ -1338,6 +1345,7 @@ int SQLITE_CDECL main(int argc, char **argv){
#endif
runSql("PRAGMA journal_mode=%Q;", zJMode);
}
if( !g.bSync ) trySql("PRAGMA synchronous=OFF");
sqlite3_enable_load_extension(g.db, 1);
sqlite3_busy_handler(g.db, busyHandler, 0);
sqlite3_create_function(g.db, "vfsname", 0, SQLITE_UTF8, 0,
@ -1346,7 +1354,6 @@ int SQLITE_CDECL 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");

View File

@ -1194,7 +1194,8 @@ void sqlite3RollbackAll(sqlite3 *db, int tripCode){
** Return a static string containing the name corresponding to the error code
** specified in the argument.
*/
#if (defined(SQLITE_DEBUG) && SQLITE_OS_WIN) || defined(SQLITE_TEST)
#if defined(SQLITE_DEBUG) && \
(defined(SQLITE_TEST) || defined(SQLITE_FORCE_OS_TRACE))
const char *sqlite3ErrName(int rc){
const char *zName = 0;
int i, origRc = rc;

View File

@ -29,7 +29,8 @@
# error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead."
#endif
#if defined(SQLITE_TEST) && defined(SQLITE_DEBUG)
#if defined(SQLITE_DEBUG) && \
(defined(SQLITE_TEST) || defined(SQLITE_FORCE_OS_TRACE))
# ifndef SQLITE_DEBUG_OS_TRACE
# define SQLITE_DEBUG_OS_TRACE 0
# endif

View File

@ -3491,7 +3491,8 @@ void *sqlite3HexToBlob(sqlite3*, const char *z, int n);
u8 sqlite3HexToInt(int h);
int sqlite3TwoPartName(Parse *, Token *, Token *, Token **);
#if defined(SQLITE_TEST)
#if defined(SQLITE_DEBUG) && \
(defined(SQLITE_TEST) || defined(SQLITE_FORCE_OS_TRACE))
const char *sqlite3ErrName(int);
#endif