tst_QSql*/sqlite: Don't use random output in the datatags
It makes it impossible to rerun it, bad for both CI and local test runs. As a drive-by name the database file sqlite.db instead of foo.db Fixes: QTBUG-100245 Change-Id: I2e4ee01189ccbad2a6add5db7771d35fd7248da8 Reviewed-by: Dimitrios Apostolou <jimis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 30077d462dca28ba1acecc9413e97d115b46cb6d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
0c6f3d69a9
commit
c22bf97cb1
@ -182,6 +182,14 @@ public:
|
|||||||
if ( port > 0 )
|
if ( port > 0 )
|
||||||
cName += QLatin1Char(':') + QString::number( port );
|
cName += QLatin1Char(':') + QString::number( port );
|
||||||
|
|
||||||
|
if (driver == "QSQLITE") {
|
||||||
|
// Since the database for sqlite is generated at runtime it's always
|
||||||
|
// available, but we use QTempDir so it's always in a different
|
||||||
|
// location. Thus, let's ignore the path completely.
|
||||||
|
cName = "SQLite";
|
||||||
|
qInfo("SQLite will use the database located at %ls", qUtf16Printable(dbName));
|
||||||
|
}
|
||||||
|
|
||||||
db = QSqlDatabase::addDatabase( driver, cName );
|
db = QSqlDatabase::addDatabase( driver, cName );
|
||||||
|
|
||||||
if ( !db.isValid() ) {
|
if ( !db.isValid() ) {
|
||||||
@ -250,7 +258,7 @@ public:
|
|||||||
}
|
}
|
||||||
QTemporaryDir *sqLiteDir = dbDir();
|
QTemporaryDir *sqLiteDir = dbDir();
|
||||||
if (sqLiteDir) {
|
if (sqLiteDir) {
|
||||||
addDb(QStringLiteral("QSQLITE"), QDir::toNativeSeparators(sqLiteDir->path() + QStringLiteral("/foo.db")));
|
addDb(QStringLiteral("QSQLITE"), QDir::toNativeSeparators(sqLiteDir->path() + QStringLiteral("/sqlite.db")));
|
||||||
added = true;
|
added = true;
|
||||||
}
|
}
|
||||||
return added;
|
return added;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user