aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-06-26 08:04:56 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-06-26 08:04:56 +0000
commitdb351f78a672cc9ecf50eae01385675348cd1920 (patch)
tree3c4413322f981ab50a4d1800238b1152b4d7dcea
parent3a01ca5fc926faeb08a4a2734f5cf45835dd2014 (diff)
parent5977edbe7bc2d259340e9dfc1e0e4314bc003176 (diff)
Merge "Merge 1.8 into master"
-rw-r--r--share/qbs/modules/cpp/gcc.js3
-rw-r--r--src/lib/corelib/buildgraph/executor.cpp3
-rw-r--r--src/lib/corelib/language/scriptengine.cpp8
-rw-r--r--tests/auto/api/testdata/build-error-code-location/build-error-code-location.qbs12
-rw-r--r--tests/auto/api/tst_api.cpp14
-rw-r--r--tests/auto/api/tst_api.h1
6 files changed, 36 insertions, 5 deletions
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index fba46f879..c8ee9eeaf 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -387,6 +387,9 @@ function linkerFlags(project, product, inputs, output, linkerPath) {
product, inputs, product.cpp.platformLinkerFlags));
args = args.concat(escapeLinkerFlags(product, inputs, product.cpp.linkerFlags));
+ // Note: due to the QCC response files hack in prepareLinker(), at least one object file or
+ // library file must follow the output file path so that QCC has something to process before
+ // sending the rest of the arguments through the response file.
args.push("-o", output.filePath);
if (inputs.obj)
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp
index 4cab204bd..7b98eb909 100644
--- a/src/lib/corelib/buildgraph/executor.cpp
+++ b/src/lib/corelib/buildgraph/executor.cpp
@@ -723,7 +723,8 @@ void Executor::doSanityChecks()
void Executor::handleError(const ErrorInfo &error)
{
- m_error.append(error.toString());
+ for (const ErrorItem &ei : error.items())
+ m_error.append(ei);
if (m_processingJobs.isEmpty())
finish();
else
diff --git a/src/lib/corelib/language/scriptengine.cpp b/src/lib/corelib/language/scriptengine.cpp
index c0b2645b9..a248f0d0a 100644
--- a/src/lib/corelib/language/scriptengine.cpp
+++ b/src/lib/corelib/language/scriptengine.cpp
@@ -578,7 +578,7 @@ static QScriptValue js_consoleError(QScriptContext *context, QScriptEngine *engi
{
if (Q_UNLIKELY(context->argumentCount() != 1))
return context->throwError(QScriptContext::SyntaxError,
- QLatin1String("error expects 1 argument"));
+ QLatin1String("console.error() expects 1 argument"));
logger->qbsLog(LoggerError) << context->argument(0).toString();
return engine->undefinedValue();
}
@@ -587,7 +587,7 @@ static QScriptValue js_consoleWarn(QScriptContext *context, QScriptEngine *engin
{
if (Q_UNLIKELY(context->argumentCount() != 1))
return context->throwError(QScriptContext::SyntaxError,
- QLatin1String("error expects 1 argument"));
+ QLatin1String("console.warn() expects 1 argument"));
logger->qbsWarning() << context->argument(0).toString();
return engine->undefinedValue();
}
@@ -596,7 +596,7 @@ static QScriptValue js_consoleInfo(QScriptContext *context, QScriptEngine *engin
{
if (Q_UNLIKELY(context->argumentCount() != 1))
return context->throwError(QScriptContext::SyntaxError,
- QLatin1String("error expects 1 argument"));
+ QLatin1String("console.info() expects 1 argument"));
logger->qbsInfo() << context->argument(0).toString();
return engine->undefinedValue();
}
@@ -605,7 +605,7 @@ static QScriptValue js_consoleDebug(QScriptContext *context, QScriptEngine *engi
{
if (Q_UNLIKELY(context->argumentCount() != 1))
return context->throwError(QScriptContext::SyntaxError,
- QLatin1String("error expects 1 argument"));
+ QLatin1String("console.debug() expects 1 argument"));
logger->qbsDebug() << context->argument(0).toString();
return engine->undefinedValue();
}
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();