diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-06-26 08:04:56 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2017-06-26 08:04:56 +0000 |
commit | db351f78a672cc9ecf50eae01385675348cd1920 (patch) | |
tree | 3c4413322f981ab50a4d1800238b1152b4d7dcea /tests | |
parent | 3a01ca5fc926faeb08a4a2734f5cf45835dd2014 (diff) | |
parent | 5977edbe7bc2d259340e9dfc1e0e4314bc003176 (diff) |
Merge "Merge 1.8 into master"
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(); |