aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/api
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-02-18 12:54:41 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2014-02-18 15:05:59 +0100
commit6f6606b798b2e9c3911b2a0794835089ab100cb8 (patch)
treea72480bfaabdcd300a15c99305147034fcf651ee /tests/auto/api
parentbb505ec457932a595ff1f70dac64ec084f79dcb5 (diff)
Do not cache external project data.
Always retrieve it anew, as information about targets can change due to building. Change-Id: I7b15f8bc50f7b22ea1351e66b5a4b22ea83f34d1 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests/auto/api')
-rw-r--r--tests/auto/api/tst_api.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp
index 3ef5d7364..764ebdc5a 100644
--- a/tests/auto/api/tst_api.cpp
+++ b/tests/auto/api/tst_api.cpp
@@ -298,7 +298,12 @@ void TestApi::changeContent()
QVERIFY2(!job->error().hasError(), qPrintable(job->error().toString()));
project = job->project();
const qbs::ProjectData newProjectData = project.projectData();
- const bool projectDataMatches = newProjectData == projectData;
+
+ // Can't use Project::operator== here, as the target artifacts will differ due to the build
+ // not having run yet.
+ const bool projectDataMatches = newProjectData.products().count() == 1
+ && projectData.products().count() == 1
+ && newProjectData.products().first().groups() == projectData.products().first().groups();
if (!projectDataMatches) {
qDebug("This is the assumed project:");
printProjectData(projectData);
@@ -316,6 +321,9 @@ void TestApi::changeContent()
QVERIFY(rcvr.descriptions.contains("compiling file.cpp"));
QVERIFY(!rcvr.descriptions.contains("compiling main.cpp"));
+ // Now, after the build, the project data must be entirely identical.
+ QVERIFY(projectData == project.projectData());
+
// Error handling: Try to change the project during a build.
buildJob.reset(project.buildAllProducts(buildOptions, this));
errorInfo = project.addGroup(newProjectData.products().first(), "blubb");