e5a054a02e7a80af675a99ba146c27465837f1d8 markd Thu Dec 21 10:13:23 2023 -0800 more work on running tests in parallel diff --git src/hg/autoSql/tests/dbLinkTest.c src/hg/autoSql/tests/dbLinkTest.c index ba10ab4..97fe727 100644 --- src/hg/autoSql/tests/dbLinkTest.c +++ src/hg/autoSql/tests/dbLinkTest.c @@ -66,31 +66,31 @@ dyStringPrintf(ds, "%s", line); } update = replaceChars(ds->string, "PRIMARY KEY", "UNIQUE"); // TRUST sql data off disk sqlSafef(query, sizeof query, update, NULL); sqlUpdate(conn, query); freez(&update); dyStringFree(&ds); lineFileClose(&lf); } void dropTable(struct sqlConnection *conn) /* Drop the test table that was created in setupTable(). */ { char update[256]; -sqlSafef(update, sizeof(update), "drop table %s", testTableName); +sqlSafef(update, sizeof(update), "drop table if exists %s", testTableName); sqlUpdate(conn, update); } int countWcDiff(char *fileName) /** Count how many lines counted are reported by 'wc'. */ { struct lineFile *lf = lineFileOpen(fileName, TRUE); char *line; int lineSize; int numLineDiff=0; char *row[3]; lineFileNeedNext(lf, &line, &lineSize); line = trimSpaces(line); chopString(line, " ", row, 3); numLineDiff=atoi(row[0]); @@ -297,30 +297,31 @@ warn("FAILED."); numFailed++; } autoTestFree(&at); autoTestFree(&atFromDb); } void doTests() /* Run our set of tests that use functions exploited by -dbLink flag. */ { struct sqlConnection *conn = dbConnect(); testCommaOutputInput(); testTabOutputInput(); +dropTable(conn); setupTable(conn); testInsertion(conn, FALSE); testInsertion(conn, TRUE); dropTable(conn); if(numFailed == 0) warn("dbLinkTest: PASSED. All %d tests passed", numPassed); else warn("dbLinkTest: FAILURES. %d tests failed", numFailed); sqlDisconnect(&conn); } int main(int argc, char *argv[]) { if(argc != 1) usage();