From 78a2220fd49d65d27e9eea4247a81266b69bb06b Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 9 Feb 2024 11:48:14 +0100 Subject: Do not run module validators for erroneous products in IDE mode Otherwise, we will potentially emit unwanted warning messages. Amends 5af4f376f88e7859667de6be0eff8f8af304528d. Change-Id: Icf55cfde089ae9f371c125bdad3eb79768070578 Reviewed-by: Ivan Komissarov --- .../testdata/restored-warnings/restored-warnings.qbs | 14 +++++++++----- tests/auto/api/tst_api.cpp | 17 +++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'tests') diff --git a/tests/auto/api/testdata/restored-warnings/restored-warnings.qbs b/tests/auto/api/testdata/restored-warnings/restored-warnings.qbs index f6a68f27c..9d4abb757 100644 --- a/tests/auto/api/testdata/restored-warnings/restored-warnings.qbs +++ b/tests/auto/api/testdata/restored-warnings/restored-warnings.qbs @@ -4,18 +4,22 @@ Project { CppApplication { name: "theProduct" - property bool moreFiles: false cpp.blubb: true files: ["file.cpp", "main.cpp"] - Group { - condition: moreFiles - files: ["blubb.cpp"] - } } Product { name: "theOtherProduct" property bool dummy: { throw "this one comes from a thread"; } } + + Product { + name: "aThirdProduct" + property bool moreFiles: false + Group { + condition: moreFiles + files: ["blubb.txt"] + } + } } diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp index 7726cee15..3816eca2b 100644 --- a/tests/auto/api/tst_api.cpp +++ b/tests/auto/api/tst_api.cpp @@ -2738,7 +2738,7 @@ void TestApi::restoredWarnings() // Re-resolving with changes: Errors come from the re-resolving, stored ones must be suppressed. QVariantMap overridenValues; - overridenValues.insert("products.theProduct.moreFiles", true); + overridenValues.insert("products.aThirdProduct.moreFiles", true); setupParams.setOverriddenValues(overridenValues); job.reset(qbs::Project().setupProject(setupParams, m_logSink, nullptr)); waitForFinished(job.get()); @@ -2748,13 +2748,14 @@ void TestApi::restoredWarnings() const auto afterErrors = m_logSink->warnings; for (const qbs::ErrorInfo &e : afterErrors) { const QString msg = e.toString(); - QVERIFY2(msg.contains("Superfluous version") - || msg.contains("Property 'blubb' is not declared") - || msg.contains("blubb.cpp' does not exist") - || msg.contains("this one comes from a thread") - || msg.contains("Product 'theOtherProduct' had errors and was disabled") - || msg.contains("Product 'theProduct' had errors and was disabled"), - qPrintable(msg)); + QVERIFY2( + msg.contains("Superfluous version") || msg.contains("Property 'blubb' is not declared") + || msg.contains("blubb.txt' does not exist") + || msg.contains("this one comes from a thread") + || msg.contains("Product 'theOtherProduct' had errors and was disabled") + || msg.contains("Product 'theThirdProduct' had errors and was disabled") + || msg.contains("Product 'theProduct' had errors and was disabled"), + qPrintable(msg)); } m_logSink->warnings.clear(); } -- cgit v1.2.3