1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Update the command-line parsing for threadtest3 so that tests are run in the

order they are specified on the command-line.

FossilOrigin-Name: f489bc31165f043dc10570e6c1250a292673660e
This commit is contained in:
drh
2014-12-31 18:28:59 +00:00
parent b8a9d8db87
commit 169c464403
3 changed files with 29 additions and 25 deletions

View File

@ -1447,27 +1447,31 @@ int main(int argc, char **argv){
{ stress1, "stress1", 10000 },
{ stress2, "stress2", 60000 },
};
int i;
static char *substArgv[] = { 0, "*", 0 };
int i, iArg;
int nTestfound = 0;
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
char const *z = aTest[i].zTest;
if( argc>1 ){
int iArg;
for(iArg=1; iArg<argc; iArg++){
if( 0==sqlite3_strglob(argv[iArg], z) ) break;
}
if( iArg==argc ) continue;
if( argc<2 ){
argc = 2;
argv = substArgv;
}
for(iArg=1; iArg<argc; iArg++){
for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
if( sqlite3_strglob(argv[iArg],aTest[i].zTest)==0 ) break;
}
if( i>=sizeof(aTest)/sizeof(aTest[0]) ) goto usage;
}
for(iArg=1; iArg<argc; iArg++){
for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
char const *z = aTest[i].zTest;
if( sqlite3_strglob(argv[iArg],z)==0 ){
printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000);
fflush(stdout);
aTest[i].xTest(aTest[i].nMs);
nTestfound++;
}
}
printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000);
fflush(stdout);
aTest[i].xTest(aTest[i].nMs);
nTestfound++;
}
if( nTestfound==0 ) goto usage;