diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-06-23 15:45:25 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-06-23 15:45:25 +0200 |
commit | 5977edbe7bc2d259340e9dfc1e0e4314bc003176 (patch) | |
tree | 8f7207d5e0ed12bc27665feb8ee17598523107db /tests | |
parent | 815bfbea8bb816e0853e75fff1c30a5b92c64e19 (diff) | |
parent | 7e0191856b3c76517a2654183b52192713ff5770 (diff) |
Merge 1.8 into master
Change-Id: Ie41cb55eb3cd78507ecde13ae72f9cb2bfd92c9c
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/api/testdata/build-error-code-location/build-error-code-location.qbs | 12 | ||||
-rw-r--r-- | tests/auto/api/tst_api.cpp | 14 | ||||
-rw-r--r-- | tests/auto/api/tst_api.h | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/api/testdata/build-error-code-location/build-error-code-location.qbs b/tests/auto/api/testdata/build-error-code-location/build-error-code-location.qbs new file mode 100644 index 000000000..f51e91e1f --- /dev/null +++ b/tests/auto/api/testdata/build-error-code-location/build-error-code-location.qbs @@ -0,0 +1,12 @@ +import qbs + +Product { + name: "p" + type: ["p.out"] + Rule { + multiplex: true + outputFileTags: ["p.out"] + outputArtifacts: { } + prepare: {} + } +} diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp index 96fbf7839..29891eecc 100644 --- a/tests/auto/api/tst_api.cpp +++ b/tests/auto/api/tst_api.cpp @@ -290,6 +290,20 @@ void TestApi::buildGraphInfo() QCOMPARE(bgInfo.requestedProperties.value("qbs.targetOS").toStringList(), QStringList("xenix")); } +void TestApi::buildErrorCodeLocation() +{ + const qbs::ErrorInfo errorInfo + = doBuildProject("build-error-code-location/build-error-code-location.qbs"); + QVERIFY(errorInfo.hasError()); + const qbs::ErrorItem errorItem = errorInfo.items().first(); + QCOMPARE(errorItem.description(), + QString("Rule.outputArtifacts must return an array of objects.")); + const qbs::CodeLocation errorLoc = errorItem.codeLocation(); + QCOMPARE(QFileInfo(errorLoc.filePath()).fileName(), QString("build-error-code-location.qbs")); + QCOMPARE(errorLoc.line(), 9); + QCOMPARE(errorLoc.column(), 26); +} + void TestApi::buildGraphLocking() { qbs::SetupProjectParameters setupParams diff --git a/tests/auto/api/tst_api.h b/tests/auto/api/tst_api.h index 8af149e3f..beb0ab4ac 100644 --- a/tests/auto/api/tst_api.h +++ b/tests/auto/api/tst_api.h @@ -59,6 +59,7 @@ private slots: void addQObjectMacroToCppFile(); void addedFilePersistent(); void baseProperties(); + void buildErrorCodeLocation(); void buildGraphInfo(); void buildGraphLocking(); void buildProject(); |