/ Check-in [f489bc31]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update the command-line parsing for threadtest3 so that tests are run in the order they are specified on the command-line.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f489bc31165f043dc10570e6c1250a292673660e
User & Date: drh 2014-12-31 18:28:59
Context
2014-12-31
18:55
Change threadtest3.c so that SQLITE_SCHEMA returns result in warnings not hard errors. Add the Darwin-x86_64 platform to releasetest.tcl. check-in: b09a139c user: drh tags: trunk
18:28
Update the command-line parsing for threadtest3 so that tests are run in the order they are specified on the command-line. check-in: f489bc31 user: drh tags: trunk
18:25
Add a missing sqlite3_close() call to threadtest3.c. check-in: a65a44f3 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/threadtest3.c.

  1443   1443   
  1444   1444       { create_drop_index_1, "create_drop_index_1", 10000 },
  1445   1445       { lookaside1,          "lookaside1", 10000 },
  1446   1446       { vacuum1,             "vacuum1", 10000 },
  1447   1447       { stress1,             "stress1", 10000 },
  1448   1448       { stress2,             "stress2", 60000 },
  1449   1449     };
  1450         -
  1451         -  int i;
         1450  +  static char *substArgv[] = { 0, "*", 0 };
         1451  +  int i, iArg;
  1452   1452     int nTestfound = 0;
  1453   1453   
  1454   1454     sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
  1455         -  sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
  1456         -
  1457         -  for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
  1458         -    char const *z = aTest[i].zTest;
  1459         -    if( argc>1 ){
  1460         -      int iArg;
  1461         -      for(iArg=1; iArg<argc; iArg++){
  1462         -        if( 0==sqlite3_strglob(argv[iArg], z) ) break;
  1463         -      }
  1464         -      if( iArg==argc ) continue;
         1455  +  if( argc<2 ){
         1456  +    argc = 2;
         1457  +    argv = substArgv;
         1458  +  }
         1459  +  for(iArg=1; iArg<argc; iArg++){
         1460  +    for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
         1461  +      if( sqlite3_strglob(argv[iArg],aTest[i].zTest)==0 ) break;
  1465   1462       }
  1466         -
  1467         -    printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000);
  1468         -    fflush(stdout);
  1469         -    aTest[i].xTest(aTest[i].nMs);
  1470         -    nTestfound++;
         1463  +    if( i>=sizeof(aTest)/sizeof(aTest[0]) ) goto usage;   
         1464  +  }
         1465  +  for(iArg=1; iArg<argc; iArg++){
         1466  +    for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
         1467  +      char const *z = aTest[i].zTest;
         1468  +      if( sqlite3_strglob(argv[iArg],z)==0 ){
         1469  +        printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000);
         1470  +        fflush(stdout);
         1471  +        aTest[i].xTest(aTest[i].nMs);
         1472  +        nTestfound++;
         1473  +      }
         1474  +    }
  1471   1475     }
  1472   1476     if( nTestfound==0 ) goto usage;
  1473   1477   
  1474   1478     printf("%d errors out of %d tests\n", nGlobalErr, nTestfound);
  1475   1479     return (nGlobalErr>0 ? 255 : 0);
  1476   1480   
  1477   1481    usage: