summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsqldriver
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2010-03-10 03:41:29 (GMT)
committerBill King <bill.king@nokia.com>2010-03-10 03:41:29 (GMT)
commit1ae64d1dcf2e9613d2580075a7b716910a6bf972 (patch)
tree15be6391432e1c6c2e83113ead30a28e1fa68d7e /tests/auto/qsqldriver
parenta90117092e4bc5ecc1cb1640a16c70569a342759 (diff)
downloadQt-1ae64d1dcf2e9613d2580075a7b716910a6bf972.zip
Qt-1ae64d1dcf2e9613d2580075a7b716910a6bf972.tar.gz
Qt-1ae64d1dcf2e9613d2580075a7b716910a6bf972.tar.bz2
Parallelize DB autotests, also some factorization
Add local machine parallelization of auto-tests, not just host to host. Reviewed-by: Justin McPherson
Diffstat (limited to 'tests/auto/qsqldriver')
-rw-r--r--tests/auto/qsqldriver/tst_qsqldriver.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/auto/qsqldriver/tst_qsqldriver.cpp b/tests/auto/qsqldriver/tst_qsqldriver.cpp
index 19e4001..f2393ba 100644
--- a/tests/auto/qsqldriver/tst_qsqldriver.cpp
+++ b/tests/auto/qsqldriver/tst_qsqldriver.cpp
@@ -84,18 +84,19 @@ void tst_QSqlDriver::initTestCase_data()
void tst_QSqlDriver::recreateTestTables(QSqlDatabase db)
{
QSqlQuery q(db);
+ const QString relTEST1(qTableName("relTEST1", __FILE__));
if(tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
- tst_Databases::safeDropTable( db, qTableName( "relTEST1" ) );
+ tst_Databases::safeDropTable( db, relTEST1 );
- QVERIFY_SQL( q, exec("create table " + qTableName("relTEST1") +
+ QVERIFY_SQL( q, exec("create table " + relTEST1 +
" (id int not null primary key, name varchar(20), title_key int, another_title_key int)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("relTEST1") + " values(1, 'harry', 1, 2)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("relTEST1") + " values(2, 'trond', 2, 1)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("relTEST1") + " values(3, 'vohi', 1, 2)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("relTEST1") + " values(4, 'boris', 2, 2)"));
+ QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(1, 'harry', 1, 2)"));
+ QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(2, 'trond', 2, 1)"));
+ QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(3, 'vohi', 1, 2)"));
+ QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(4, 'boris', 2, 2)"));
}
void tst_QSqlDriver::initTestCase()
@@ -108,7 +109,7 @@ void tst_QSqlDriver::cleanupTestCase()
{
foreach (const QString &dbName, dbs.dbNames) {
QSqlDatabase db = QSqlDatabase::database(dbName);
- tst_Databases::safeDropTable( db, qTableName( "relTEST1" ) );
+ tst_Databases::safeDropTable( db, qTableName( "relTEST1", __FILE__ ) );
}
dbs.close();
}
@@ -127,7 +128,7 @@ void tst_QSqlDriver::record()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- QString tablename = qTableName("relTEST1");
+ QString tablename(qTableName("relTEST1", __FILE__));
QStringList fields;
fields << "id" << "name" << "title_key" << "another_title_key";
@@ -180,7 +181,7 @@ void tst_QSqlDriver::primaryIndex()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- QString tablename = qTableName("relTEST1");
+ QString tablename(qTableName("relTEST1", __FILE__));
//check that we can get primary index using unquoted mixed case table name
QSqlIndex index = db.driver()->primaryIndex(tablename);
QCOMPARE(index.count(), 1);