aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-02-26 09:44:37 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2014-02-27 10:38:37 +0100
commitc30b698ce927fd1f451c2f3c66da37f2c1501a60 (patch)
tree0f5634af50dbc001dce05cd521211e58b22f602b /tests
parent2252f3556fb5b9131c6e2703babc5219d534484e (diff)
Fix "addedFilePersistent" autotest.
This one failed in about 1 of 1000 runs (Windows only), presumably because the OS sometimes flushes the file to disk on its own, so that our call to waitForNewTimestamp() came too late. Change-Id: I3866ea9d081549e8a7daa33733f581f8cc96d97e Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index d1525b72e..394557390 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -209,6 +209,7 @@ void TestBlackbox::addedFilePersistent()
QVERIFY(runQbs(failedRunParams) != 0);
// Add a file. qbs must schedule it for rule application on the next build.
+ waitForNewTimestamp();
QFile projectFile("project.qbs");
QVERIFY2(projectFile.open(QIODevice::ReadWrite), qPrintable(projectFile.errorString()));
const QByteArray originalContent = projectFile.readAll();
@@ -216,22 +217,21 @@ void TestBlackbox::addedFilePersistent()
addedFileContent.replace("/* 'file.cpp' */", "'file.cpp'");
projectFile.resize(0);
projectFile.write(addedFileContent);
- waitForNewTimestamp();
projectFile.flush();
QCOMPARE(runQbs(QbsRunParameters("resolve")), 0);
// Remove the file again. qbs must unschedule the rule application again.
// Consequently, the linking step must fail as in the initial run.
+ waitForNewTimestamp();
projectFile.resize(0);
projectFile.write(originalContent);
- waitForNewTimestamp();
projectFile.flush();
QVERIFY(runQbs(failedRunParams) != 0);
// Add the file again. qbs must schedule it for rule application on the next build.
+ waitForNewTimestamp();
projectFile.resize(0);
projectFile.write(addedFileContent);
- waitForNewTimestamp();
projectFile.close();
QCOMPARE(runQbs(QbsRunParameters("resolve")), 0);