forked from qt-creator/qt-creator
Tests: C++: Make tests run from shadow builds.
For shadow builds some tests couldn't find their test data. Solved by using the same pattern as in Qt tests: Inject $$PWD as SRCDIR via a DEFINES statement. Note: It was considered to use QFINDTESTDATA for Qt5, but this was rejected due to: 1) It's Qt5 only (would mean to introduce some wrapper...) 2) As the doc states, it will not work with QTEST_APPLESS_MAIN tests. Change-Id: Ie6cf59570fe61725b7f6f83b7da650331ddb38fc Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -39,7 +39,7 @@ using namespace CPlusPlus;
|
||||
|
||||
QByteArray loadSource(const QString &fileName)
|
||||
{
|
||||
QFile inf(fileName);
|
||||
QFile inf(QLatin1String(SRCDIR) + QLatin1Char('/') + fileName);
|
||||
if (!inf.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
qDebug("Cannot open \"%s\"", fileName.toUtf8().constData());
|
||||
return QByteArray();
|
||||
@@ -53,7 +53,7 @@ QByteArray loadSource(const QString &fileName)
|
||||
|
||||
void saveData(const QByteArray &data, const QString &fileName)
|
||||
{
|
||||
QFile inf(fileName);
|
||||
QFile inf(QLatin1String(SRCDIR) + QLatin1Char('/') + fileName);
|
||||
if (!inf.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qDebug("Cannot open \"%s\"", fileName.toUtf8().constData());
|
||||
return;
|
||||
|
Reference in New Issue
Block a user