aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorKai Dohmen <psykai1993@googlemail.com>2021-10-14 12:58:03 +0200
committerKai Dohmen <psykai1993@googlemail.com>2021-10-26 12:25:46 +0000
commit22b93598471a22e09052405ad33e24bd15f1e6be (patch)
tree45b7fc61d62bab5db5a017e55115e2c661af3800 /tests/auto
parent24044d6da5d3f3725adc134fdb7e71fe398381ff (diff)
Print conan output while ConanfileProbe runs
Sometimes installing dependencies with conan takes multiple minutes. To see what conan does and if somehow conan stopped working the conan stdout and stderr will be printed to commandline. Change-Id: I987ef95b38deecd713dc6b46be0e2641025345c6 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/blackbox/testdata/conanfile-probe/testapp/conanfile-probe-project.qbs3
-rw-r--r--tests/auto/blackbox/testdata/conanfile-probe/testapp/conanfile.py5
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp15
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
4 files changed, 20 insertions, 4 deletions
diff --git a/tests/auto/blackbox/testdata/conanfile-probe/testapp/conanfile-probe-project.qbs b/tests/auto/blackbox/testdata/conanfile-probe/testapp/conanfile-probe-project.qbs
index c1cb1ddda..adcb2bd9c 100644
--- a/tests/auto/blackbox/testdata/conanfile-probe/testapp/conanfile-probe-project.qbs
+++ b/tests/auto/blackbox/testdata/conanfile-probe/testapp/conanfile-probe-project.qbs
@@ -2,11 +2,12 @@ import qbs.Probes
import qbs.TextFile
Project {
+ readonly property bool forceFailure: false
Probes.ConanfileProbe {
id: conan
conanfilePath: path + "/conanfile.py"
- options: ({opt: "True"})
+ options: ({opt: "True", forceFailure: (project.forceFailure ? "True" : "False")})
settings: ({os: "AIX"})
}
diff --git a/tests/auto/blackbox/testdata/conanfile-probe/testapp/conanfile.py b/tests/auto/blackbox/testdata/conanfile-probe/testapp/conanfile.py
index 630cf0283..59e40cc80 100644
--- a/tests/auto/blackbox/testdata/conanfile-probe/testapp/conanfile.py
+++ b/tests/auto/blackbox/testdata/conanfile-probe/testapp/conanfile.py
@@ -7,12 +7,13 @@ class TestApp(ConanFile):
version = "6.6.6"
settings = "os"
- options = {"opt": [True, False]}
- default_options = {"opt": False}
+ options = {"opt": [True, False], "forceFailure": [True, False]}
+ default_options = {"opt": False, "forceFailure": False}
requires = "testlib/1.2.3@qbs/testing"
def configure(self):
+ assert(not self.options.forceFailure)
self.options["testlib"].opt = self.options.opt
def source(self):
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 41f307632..c64976e36 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -1867,8 +1867,18 @@ void TestBlackbox::cxxLanguageVersion_data()
std::make_pair(QString("msvc-new"), QString("/std:"))});
}
+void TestBlackbox::conanfileProbe_data()
+{
+ QTest::addColumn<bool>("forceFailure");
+
+ QTest::newRow("success") << false;
+ QTest::newRow("failure") << true;
+}
+
void TestBlackbox::conanfileProbe()
{
+ QFETCH(bool, forceFailure);
+
QString executable = findExecutable({"conan"});
if (executable.isEmpty())
QSKIP("conan is not installed or not available in PATH.");
@@ -1883,7 +1893,10 @@ void TestBlackbox::conanfileProbe()
QVERIFY(waitForProcessSuccess(conan));
QDir::setCurrent(testDataDir + "/conanfile-probe/testapp");
- QCOMPARE(runQbs(QbsRunParameters("resolve", {"--force-probe-execution"})), 0);
+ QCOMPARE(runQbs(QbsRunParameters("resolve",
+ {"--force-probe-execution",
+ QStringLiteral("projects.conanfile-probe-project.forceFailure:") +
+ (forceFailure ? "true" : "false")})), forceFailure ? 1 : 0);
QFile file(relativeBuildDir() + "/results.json");
QVERIFY(file.open(QIODevice::ReadOnly));
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index 2f443f681..987c87d6a 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -89,6 +89,7 @@ private slots:
void conflictingArtifacts();
void cxxLanguageVersion();
void cxxLanguageVersion_data();
+ void conanfileProbe_data();
void conanfileProbe();
void cpuFeatures();
void dependenciesProperty();