diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-06-22 10:24:11 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-06-22 10:24:11 +0200 |
commit | e86aea00dbf4c0c2deb127aa93276607e7a51909 (patch) | |
tree | aad005de63de140e9a0bfc76f8e4aa040834bb74 | |
parent | e0efb1d2b09b7979162f4933193b1a247e393814 (diff) | |
parent | 29420ab4698ad45de994cf367b94f23ddc874200 (diff) |
Merge 1.12 into master
Change-Id: I3b5f14cf38452aaa740ac66cffa1e740f7349823
42 files changed, 295 insertions, 26 deletions
diff --git a/doc/reference/cli/builtin/cli-build.qdoc b/doc/reference/cli/builtin/cli-build.qdoc index cc5f4b27f..8e4b8ed44 100644 --- a/doc/reference/cli/builtin/cli-build.qdoc +++ b/doc/reference/cli/builtin/cli-build.qdoc @@ -36,7 +36,7 @@ \section1 Synopsis \code - qbs build [options] [[configuration-name] [property:value] ...] + qbs build [options] [[config:configuration-name] [property:value] ...] \endcode \section1 Description diff --git a/doc/reference/cli/builtin/cli-clean.qdoc b/doc/reference/cli/builtin/cli-clean.qdoc index f87270825..bd6ba1616 100644 --- a/doc/reference/cli/builtin/cli-clean.qdoc +++ b/doc/reference/cli/builtin/cli-clean.qdoc @@ -36,7 +36,7 @@ \section1 Synopsis \code - qbs clean [options] [configuration-name] + qbs clean [options] [config:configuration-name] \endcode \section1 Description diff --git a/doc/reference/cli/builtin/cli-dump-nodes-tree.qdoc b/doc/reference/cli/builtin/cli-dump-nodes-tree.qdoc index 1f3e061c4..2e5485ec2 100644 --- a/doc/reference/cli/builtin/cli-dump-nodes-tree.qdoc +++ b/doc/reference/cli/builtin/cli-dump-nodes-tree.qdoc @@ -36,7 +36,7 @@ \section1 Synopsis \code - qbs dump-nodes-tree [options] [configuration-name] + qbs dump-nodes-tree [options] [config:configuration-name] \endcode \section1 Description diff --git a/doc/reference/cli/builtin/cli-generate.qdoc b/doc/reference/cli/builtin/cli-generate.qdoc index ec85813f0..b6dda6f4f 100644 --- a/doc/reference/cli/builtin/cli-generate.qdoc +++ b/doc/reference/cli/builtin/cli-generate.qdoc @@ -37,7 +37,7 @@ \section1 Synopsis \code - qbs generate [options] [[configuration-name] [property:value] ...] + qbs generate [options] [[config:configuration-name] [property:value] ...] \endcode \section1 Description diff --git a/doc/reference/cli/builtin/cli-install.qdoc b/doc/reference/cli/builtin/cli-install.qdoc index 3bddc4fcd..b55f05296 100644 --- a/doc/reference/cli/builtin/cli-install.qdoc +++ b/doc/reference/cli/builtin/cli-install.qdoc @@ -36,7 +36,7 @@ \section1 Synopsis \code - qbs install [options] [[configuration-name] [property:value] ...] + qbs install [options] [[config:configuration-name] [property:value] ...] \endcode \section1 Description diff --git a/doc/reference/cli/builtin/cli-list-products.qdoc b/doc/reference/cli/builtin/cli-list-products.qdoc new file mode 100644 index 000000000..92ef043da --- /dev/null +++ b/doc/reference/cli/builtin/cli-list-products.qdoc @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \contentspage cli.html + \page cli-list-products.html + \ingroup cli + + \title list-products + \brief Lists all products in the given project. + + \section1 Synopsis + + \code + qbs list-products [options] [config:configuration-name] + \endcode + + \section1 Description + + Lists all products that exist in a project. + + \section1 Options + + \include cli-options.qdocinc project-file + \include cli-options.qdocinc build-directory + \include cli-options.qdocinc settings-dir + + \section1 Parameters + + \include cli-parameters.qdocinc configuration-name + + \section1 Examples + + To list all products for the project in the current directory: + + \code + qbs list-products + \endcode +*/ diff --git a/doc/reference/cli/builtin/cli-resolve.qdoc b/doc/reference/cli/builtin/cli-resolve.qdoc index 1743eb55f..7170856f2 100644 --- a/doc/reference/cli/builtin/cli-resolve.qdoc +++ b/doc/reference/cli/builtin/cli-resolve.qdoc @@ -36,7 +36,7 @@ \section1 Synopsis \code - qbs resolve [options] [[configuration-name] [property:value] ...] + qbs resolve [options] [[config:configuration-name] [property:value] ...] \endcode \section1 Description diff --git a/doc/reference/cli/builtin/cli-run.qdoc b/doc/reference/cli/builtin/cli-run.qdoc index 42bc8d4f9..9f20f868e 100644 --- a/doc/reference/cli/builtin/cli-run.qdoc +++ b/doc/reference/cli/builtin/cli-run.qdoc @@ -36,7 +36,7 @@ \section1 Synopsis \code - qbs run [options] [configuration-name] [property:value] ... [ -- <arguments>] + qbs run [options] [config:configuration-name] [property:value] ... [ -- <arguments>] \endcode \section1 Description diff --git a/doc/reference/cli/builtin/cli-shell.qdoc b/doc/reference/cli/builtin/cli-shell.qdoc index c1af42e20..221bef24d 100644 --- a/doc/reference/cli/builtin/cli-shell.qdoc +++ b/doc/reference/cli/builtin/cli-shell.qdoc @@ -36,7 +36,7 @@ \section1 Synopsis \code - qbs shell [options] [configuration-name] [property:value] + qbs shell [options] [config:configuration-name] [property:value] \endcode \section1 Description diff --git a/doc/reference/cli/builtin/cli-status.qdoc b/doc/reference/cli/builtin/cli-status.qdoc index a619aa9ce..ddc8537f3 100644 --- a/doc/reference/cli/builtin/cli-status.qdoc +++ b/doc/reference/cli/builtin/cli-status.qdoc @@ -36,7 +36,7 @@ \section1 Synopsis \code - qbs status [options] [configuration-name] + qbs status [options] [config:configuration-name] \endcode \section1 Description diff --git a/doc/reference/cli/builtin/cli-update-timestamps.qdoc b/doc/reference/cli/builtin/cli-update-timestamps.qdoc index 39faddfed..366f1352b 100644 --- a/doc/reference/cli/builtin/cli-update-timestamps.qdoc +++ b/doc/reference/cli/builtin/cli-update-timestamps.qdoc @@ -36,7 +36,7 @@ \section1 Synopsis \code - qbs update-timestamps [options] [configuration-name] ... + qbs update-timestamps [options] [config:configuration-name] ... \endcode \section1 Description diff --git a/doc/reference/cli/cli-parameters.qdocinc b/doc/reference/cli/cli-parameters.qdocinc index eb16f3ff8..70f7a087f 100644 --- a/doc/reference/cli/cli-parameters.qdocinc +++ b/doc/reference/cli/cli-parameters.qdocinc @@ -37,7 +37,7 @@ //! [configuration-name] - \section2 \c configuration-name + \section2 \c config:configuration-name Specifies the build configuration to use. diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index 5ac936eb0..896ae48fa 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -157,6 +157,12 @@ function collectLibraryDependencies(product, isDarwin) { var nextIsBelowIndirectDynamicLib = isBelowIndirectDynamicLib || isDynamicLibrary; dep.dependencies.forEach(function(depdep) { + // If "dep" is an aggregate product, and "depdep" is one of the multiplexed variants + // of the same product, we don't want to depend on the multiplexed variants, because + // that could mean linking more than one time against the same library. Instead skip + // the multiplexed dependency, and depend only on the aggregate one. + if (depdep.name === dep.name) + return; traverse(depdep, nextIsBelowIndirectDynamicLib); }); if (isStaticLibrary) { diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js index e96b53d8f..8a2fc4d7a 100644 --- a/share/qbs/modules/cpp/msvc.js +++ b/share/qbs/modules/cpp/msvc.js @@ -320,7 +320,7 @@ function collectLibraryDependencies(product) { function linkerSupportsWholeArchive(product) { - return Utilities.versionCompare(product.cpp.compilerVersion, "19.0.25123") >= 0 + return Utilities.versionCompare(product.cpp.compilerVersion, "19.0.24215.1") >= 0 } function handleDiscardProperty(product, flags) { diff --git a/src/app/qbs-setup-toolchains/probe.cpp b/src/app/qbs-setup-toolchains/probe.cpp index 11dee9ad6..4ca146853 100644 --- a/src/app/qbs-setup-toolchains/probe.cpp +++ b/src/app/qbs-setup-toolchains/probe.cpp @@ -92,7 +92,7 @@ static QString qsystem(const QString &exe, const QStringList &args = QStringList throw qbs::ErrorInfo(Tr::tr("Failed to start compiler '%1': %2") .arg(exe, p.errorString())); } - if (!p.waitForFinished() || p.exitCode() != 0) + if (!p.waitForFinished(-1) || p.exitCode() != 0) throw qbs::ErrorInfo(Tr::tr("Failed to run compiler '%1': %2").arg(exe, p.errorString())); return QString::fromLocal8Bit(p.readAll()); } diff --git a/src/app/qbs/commandlinefrontend.cpp b/src/app/qbs/commandlinefrontend.cpp index ae81265ef..d07af0d6f 100644 --- a/src/app/qbs/commandlinefrontend.cpp +++ b/src/app/qbs/commandlinefrontend.cpp @@ -346,17 +346,28 @@ CommandLineFrontend::ProductMap CommandLineFrontend::productsToUse() const const ProjectData projectData = project.projectData(); const auto products = projectData.allProducts(); for (const ProductData &product : products) { + productNames << product.name(); if (useAll || m_parser.products().contains(product.name())) { productList.push_back(product); - productNames << product.name(); } } } const auto parsedProductNames = m_parser.products(); for (const QString &productName : parsedProductNames) { - if (!productNames.contains(productName)) - throw ErrorInfo(Tr::tr("No such product '%1'.").arg(productName)); + if (!productNames.contains(productName)) { + QString msg; + if (productNames.size() <= 10) { + productNames.sort(); + const QString available = productNames.join(QLatin1String("', '")); + msg = Tr::tr("No such product '%1'. " + "Available products: '%2'").arg(productName, available); + } else { + msg = Tr::tr("No such product '%1'. Use 'list-products' to see " + "all available products.").arg(productName); + } + throw ErrorInfo(msg); + } } return products; diff --git a/src/lib/corelib/buildgraph/projectbuilddata.cpp b/src/lib/corelib/buildgraph/projectbuilddata.cpp index 67228d35d..87e79c7b9 100644 --- a/src/lib/corelib/buildgraph/projectbuilddata.cpp +++ b/src/lib/corelib/buildgraph/projectbuilddata.cpp @@ -171,6 +171,7 @@ static void disconnectArtifactParents(Artifact *artifact) QBS_CHECK(parentArtifact->transformer); parentArtifact->childrenAddedByScanner.remove(artifact); parentArtifact->transformer->inputs.remove(artifact); + parentArtifact->transformer->explicitlyDependsOn.remove(artifact); parentArtifact->product->registerArtifactWithChangedInputs(parentArtifact); } diff --git a/src/lib/corelib/language/evaluatorscriptclass.cpp b/src/lib/corelib/language/evaluatorscriptclass.cpp index b7c2576df..18d7fd83f 100644 --- a/src/lib/corelib/language/evaluatorscriptclass.cpp +++ b/src/lib/corelib/language/evaluatorscriptclass.cpp @@ -177,6 +177,13 @@ private: QScriptValue originalValue; if (data->item->propertyDeclaration(propertyName->toString()).isScalar()) { const Item *item = itemOfProperty; + if (item->type() == ItemType::Module || item->type() == ItemType::Export) { + const QString errorMessage = Tr::tr("The special value 'original' cannot " + "be used on the right-hand side of a property declaration."); + extraScope = engine->currentContext()->throwError(errorMessage); + result.second = false; + return result; + } while (item->type() == ItemType::ModuleInstance) item = item->prototype(); if (item->type() != ItemType::Module && item->type() != ItemType::Export) { diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp index df47e36ea..41781cb7d 100644 --- a/src/lib/corelib/language/moduleloader.cpp +++ b/src/lib/corelib/language/moduleloader.cpp @@ -789,11 +789,18 @@ ModuleLoader::MultiplexInfo ModuleLoader::extractMultiplexInfo(Item *productItem if (!multiplexedType.isEmpty()) multiplexInfo.multiplexedType = VariantValue::create(multiplexedType); + Set<QString> uniqueMultiplexByQbsProperties; for (const QString &key : multiplexByQbsProperties) { const QString mappedKey = multiplexMap.property(key).toString(); if (mappedKey.isEmpty()) throw ErrorInfo(Tr::tr("There is no entry for '%1' in 'qbs.multiplexMap'.").arg(key)); + if (!uniqueMultiplexByQbsProperties.insert(mappedKey).second) { + throw ErrorInfo(Tr::tr("Duplicate entry '%1' in Product.%2.") + .arg(mappedKey, StringConstants::multiplexByQbsPropertiesProperty()), + productItem->location()); + } + const QScriptValue arr = m_evaluator->value(qbsModuleItem, key); if (arr.isUndefined()) continue; @@ -806,8 +813,15 @@ ModuleLoader::MultiplexInfo ModuleLoader::extractMultiplexInfo(Item *productItem MultiplexRow mprow; mprow.resize(arrlen); - for (quint32 i = 0; i < arrlen; ++i) - mprow[i] = VariantValue::create(arr.property(i).toVariant()); + Set<QVariant> entriesForKey; + for (quint32 i = 0; i < arrlen; ++i) { + const QVariant value = arr.property(i).toVariant(); + if (!entriesForKey.insert(value).second) { + throw ErrorInfo(Tr::tr("Duplicate entry '%1' in qbs.%2.") + .arg(value.toString(), key), productItem->location()); + } + mprow[i] = VariantValue::create(value); + } multiplexInfo.table = combine(multiplexInfo.table, mprow); multiplexInfo.properties.push_back(mappedKey); } diff --git a/src/lib/corelib/language/projectresolver.cpp b/src/lib/corelib/language/projectresolver.cpp index ff74f845a..b226ce91a 100644 --- a/src/lib/corelib/language/projectresolver.cpp +++ b/src/lib/corelib/language/projectresolver.cpp @@ -942,6 +942,8 @@ void ProjectResolver::collectExportedProductDependencies() void ProjectResolver::resolveShadowProduct(Item *item, ProjectResolver::ProjectContext *) { + if (!m_productContext->product->enabled) + return; for (const auto &m : item->modules()) { if (m.name.toString() != m_productContext->product->name) continue; @@ -1430,6 +1432,8 @@ private: void ProjectResolver::collectPropertiesForExportItem(Item *productModuleInstance) { + if (!productModuleInstance->isPresentModule()) + return; Item * const exportItem = productModuleInstance->prototype(); QBS_CHECK(exportItem && exportItem->type() == ItemType::Export); TempScopeSetter tempScopeSetter(exportItem, productModuleInstance->scope()); @@ -1457,6 +1461,8 @@ void ProjectResolver::collectPropertiesForExportItem(Item *productModuleInstance // Collects module properties assigned to in other (higher-level) modules. void ProjectResolver::collectPropertiesForModuleInExportItem(const Item::Module &module) { + if (!module.item->isPresentModule()) + return; ExportedModule &exportedModule = m_productContext->product->exportedModule; if (module.isProduct || module.name.first() == StringConstants::qbsModule()) return; diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp index 83a5ccbda..7af87fc32 100644 --- a/tests/auto/api/tst_api.cpp +++ b/tests/auto/api/tst_api.cpp @@ -1822,7 +1822,7 @@ void TestApi::multiArch() setupJob.reset(project.setupProject(setupParams, m_logSink, 0)); waitForFinished(setupJob.get()); QVERIFY(setupJob->error().hasError()); - QVERIFY2(setupJob->error().toString().contains("Duplicate product name 'p1'"), + QVERIFY2(setupJob->error().toString().contains("Duplicate entry 'host' in qbs.profiles."), qPrintable(setupJob->error().toString())); // Error check: Try to build for the same profile twice, this time attaching @@ -1834,7 +1834,7 @@ void TestApi::multiArch() setupJob.reset(project.setupProject(setupParams, m_logSink, 0)); waitForFinished(setupJob.get()); QVERIFY(setupJob->error().hasError()); - QVERIFY2(setupJob->error().toString().contains("Duplicate product name 'p1'"), + QVERIFY2(setupJob->error().toString().contains("Duplicate entry 'target' in qbs.profiles."), qPrintable(setupJob->error().toString())); } diff --git a/tests/auto/blackbox/testdata-apple/aggregateDependencyLinking/aggregateDependencyLinking.qbs b/tests/auto/blackbox/testdata-apple/aggregateDependencyLinking/aggregateDependencyLinking.qbs new file mode 100644 index 000000000..e7c8867bd --- /dev/null +++ b/tests/auto/blackbox/testdata-apple/aggregateDependencyLinking/aggregateDependencyLinking.qbs @@ -0,0 +1,35 @@ +import qbs + +Project { + minimumQbsVersion: "1.8" + + StaticLibrary { + name: "multi_arch_lib" + files: ["lib.c"] + + Depends { name: "cpp" } + Depends { name: "bundle" } + bundle.isBundle: false + + // This will generate 2 multiplex configs and an aggregate. + qbs.architectures: ["x86", "x86_64"] + qbs.buildVariant: "debug" + } + + CppApplication { + name: "just_app" + files: ["app.c"] + + // This should link only against the aggregate static library, and not against + // the {debug, x86_64} variant, or worse - against both the single arch variant + // and the lipo-ed one. + Depends { name: "multi_arch_lib" } + + Depends { name: "bundle" } + bundle.isBundle: false + + qbs.architecture: "x86_64" + qbs.buildVariant: "debug" + multiplexByQbsProperties: [] + } +} diff --git a/tests/auto/blackbox/testdata-apple/aggregateDependencyLinking/app.c b/tests/auto/blackbox/testdata-apple/aggregateDependencyLinking/app.c new file mode 100644 index 000000000..ae414324b --- /dev/null +++ b/tests/auto/blackbox/testdata-apple/aggregateDependencyLinking/app.c @@ -0,0 +1,8 @@ +extern int foo(); + +int main(int argc, char *argv[]) { + (void) argc; + (void) argv; + + return foo(); +} diff --git a/tests/auto/blackbox/testdata-apple/aggregateDependencyLinking/lib.c b/tests/auto/blackbox/testdata-apple/aggregateDependencyLinking/lib.c new file mode 100644 index 000000000..9ef95547b --- /dev/null +++ b/tests/auto/blackbox/testdata-apple/aggregateDependencyLinking/lib.c @@ -0,0 +1,12 @@ +#include <stdio.h> + +int foo() +{ +#ifdef __i386__ + printf("Hello from i386\n"); +#endif +#ifdef __x86_64__ + printf("Hello from x86_64\n"); +#endif + return 0; +} diff --git a/tests/auto/blackbox/testdata/lexyacc/lex_outfile/lex_outfile.qbs b/tests/auto/blackbox/testdata/lexyacc/lex_outfile/lex_outfile.qbs index 677828906..3708140ad 100644 --- a/tests/auto/blackbox/testdata/lexyacc/lex_outfile/lex_outfile.qbs +++ b/tests/auto/blackbox/testdata/lexyacc/lex_outfile/lex_outfile.qbs @@ -1,10 +1,12 @@ import qbs CppApplication { + qbsSearchPaths: ".." + Depends { name: "bisonhelper" } Depends { name: "lex_yacc" } lex_yacc.outputTag: "cpp" lex_yacc.yaccFlags: ["-l"] - cpp.includePaths: ["."] + cpp.includePaths: [".", ".."] cpp.cxxLanguageVersion: "c++11" cpp.minimumMacosVersion: "10.7" consoleApplication: true diff --git a/tests/auto/blackbox/testdata/lexyacc/lex_prefix/lex_prefix.qbs b/tests/auto/blackbox/testdata/lexyacc/lex_prefix/lex_prefix.qbs index 677828906..3708140ad 100644 --- a/tests/auto/blackbox/testdata/lexyacc/lex_prefix/lex_prefix.qbs +++ b/tests/auto/blackbox/testdata/lexyacc/lex_prefix/lex_prefix.qbs @@ -1,10 +1,12 @@ import qbs CppApplication { + qbsSearchPaths: ".." + Depends { name: "bisonhelper" } Depends { name: "lex_yacc" } lex_yacc.outputTag: "cpp" lex_yacc.yaccFlags: ["-l"] - cpp.includePaths: ["."] + cpp.includePaths: [".", ".."] cpp.cxxLanguageVersion: "c++11" cpp.minimumMacosVersion: "10.7" consoleApplication: true diff --git a/tests/auto/blackbox/testdata/lexyacc/modules/bisonhelper/bisonhelper.qbs b/tests/auto/blackbox/testdata/lexyacc/modules/bisonhelper/bisonhelper.qbs new file mode 100644 index 000000000..449b130e2 --- /dev/null +++ b/tests/auto/blackbox/testdata/lexyacc/modules/bisonhelper/bisonhelper.qbs @@ -0,0 +1,19 @@ +import qbs +import qbs.Process + +Module { + Depends { name: "lex_yacc" } + Probe { + id: bisonProbe + property string yaccBinary: lex_yacc.yaccBinary + configure: { + var p = Process(); + found = p.exec(yaccBinary, ["-V"]) == 0 && p.readStdOut().contains("bison"); + p.close(); + } + } + Properties { + condition: bisonProbe.found + lex_yacc.yaccFlags: "-y" + } +} diff --git a/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs b/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs index 677828906..3708140ad 100644 --- a/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs +++ b/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs @@ -1,10 +1,12 @@ import qbs CppApplication { + qbsSearchPaths: ".." + Depends { name: "bisonhelper" } Depends { name: "lex_yacc" } lex_yacc.outputTag: "cpp" lex_yacc.yaccFlags: ["-l"] - cpp.includePaths: ["."] + cpp.includePaths: [".", ".."] cpp.cxxLanguageVersion: "c++11" cpp.minimumMacosVersion: "10.7" consoleApplication: true diff --git a/tests/auto/blackbox/testdata/lexyacc/two-grammars/g1.l b/tests/auto/blackbox/testdata/lexyacc/two-grammars/g1.l index aebda993f..369f1c919 100644 --- a/tests/auto/blackbox/testdata/lexyacc/two-grammars/g1.l +++ b/tests/auto/blackbox/testdata/lexyacc/two-grammars/g1.l @@ -2,7 +2,11 @@ %{ #include <g1.tab.h> +#ifdef _MSC_BUILD +#pragma message("whatever") +#else #pragma whatever +#endif void g1error(const char *e) { } %} diff --git a/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs b/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs index d70f733a9..fb1375598 100644 --- a/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs +++ b/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs @@ -3,6 +3,7 @@ import qbs CppApplication { Depends { name: "lex_yacc" } consoleApplication: true + cpp.includePaths: ".." files: [ "g1.l", "g1.y", diff --git a/tests/auto/blackbox/testdata/lexyacc/unistd.h b/tests/auto/blackbox/testdata/lexyacc/unistd.h new file mode 100644 index 000000000..d9abd4d2a --- /dev/null +++ b/tests/auto/blackbox/testdata/lexyacc/unistd.h @@ -0,0 +1,11 @@ +#ifndef MY_UNISTD_H +#define MY_UNISTD_H + +#ifdef _MSC_BUILD +#include <io.h> +#define isatty _isatty +#else +#include_next <unistd.h> +#endif + +#endif diff --git a/tests/auto/blackbox/testdata/lexyacc/yacc_output/yacc_output.qbs b/tests/auto/blackbox/testdata/lexyacc/yacc_output/yacc_output.qbs index 677828906..298190996 100644 --- a/tests/auto/blackbox/testdata/lexyacc/yacc_output/yacc_output.qbs +++ b/tests/auto/blackbox/testdata/lexyacc/yacc_output/yacc_output.qbs @@ -4,7 +4,7 @@ CppApplication { Depends { name: "lex_yacc" } lex_yacc.outputTag: "cpp" lex_yacc.yaccFlags: ["-l"] - cpp.includePaths: ["."] + cpp.includePaths: [".", ".."] cpp.cxxLanguageVersion: "c++11" cpp.minimumMacosVersion: "10.7" consoleApplication: true diff --git a/tests/auto/blackbox/testdata/whole-archive/whole-archive.qbs b/tests/auto/blackbox/testdata/whole-archive/whole-archive.qbs index 855ab44d0..4ab93af28 100644 --- a/tests/auto/blackbox/testdata/whole-archive/whole-archive.qbs +++ b/tests/auto/blackbox/testdata/whole-archive/whole-archive.qbs @@ -34,7 +34,7 @@ Project { property string dummy: product.linkWholeArchive // To force probe re-execution configure: { if (!toolchain.contains("msvc") - || Utilities.versionCompare(compilerVersion, "19.0.25123") >= 0) { + || Utilities.versionCompare(compilerVersion, "19.0.24215.1") >= 0) { console.info("can link whole archives"); } else { console.info("cannot link whole archives"); diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index a83e50492..199ad74d3 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -4080,7 +4080,8 @@ void TestBlackbox::lexyacc() params.arguments << "modules.lex_yacc.enableCompilerWarnings:true"; QCOMPARE(runQbs(params), 0); QCOMPARE(runQbs(), 0); - QVERIFY2(m_qbsStderr.contains("whatever"), m_qbsStderr.constData()); + const QByteArray outputToCheck = m_qbsStdout + m_qbsStderr; + QVERIFY2(outputToCheck.contains("whatever"), outputToCheck.constData()); } void TestBlackbox::lexyaccOutputs() diff --git a/tests/auto/blackbox/tst_blackboxapple.cpp b/tests/auto/blackbox/tst_blackboxapple.cpp index 64aca99f1..76234e6c8 100644 --- a/tests/auto/blackbox/tst_blackboxapple.cpp +++ b/tests/auto/blackbox/tst_blackboxapple.cpp @@ -145,6 +145,20 @@ void TestBlackboxApple::appleMultiConfig() } } +void TestBlackboxApple::aggregateDependencyLinking() +{ + if (HostOsInfo::hostOsVersion() > qbs::Version(10, 13, 4)) + QSKIP("32-bit arch build is no longer supported on macOS versions higher than 10.13.4."); + + QDir::setCurrent(testDataDir + "/aggregateDependencyLinking"); + QCOMPARE(runQbs(QStringList{"-p", "multi_arch_lib"}), 0); + + QCOMPARE(runQbs(QStringList{"-p", "just_app", "--command-echo-mode", "command-line"}), 0); + int linkedInLibrariesCount = + QString::fromUtf8(m_qbsStdout).count(QStringLiteral("multi_arch_lib.a")); + QCOMPARE(linkedInLibrariesCount, 1); +} + void TestBlackboxApple::assetCatalog() { QFETCH(bool, flatten); diff --git a/tests/auto/blackbox/tst_blackboxapple.h b/tests/auto/blackbox/tst_blackboxapple.h index 05e0d8acd..76711ddf5 100644 --- a/tests/auto/blackbox/tst_blackboxapple.h +++ b/tests/auto/blackbox/tst_blackboxapple.h @@ -47,6 +47,7 @@ public slots: private slots: void appleMultiConfig(); + void aggregateDependencyLinking(); void assetCatalog(); void assetCatalog_data(); void assetCatalogsEmpty(); diff --git a/tests/auto/language/testdata/erroneous/duplicate-multiplex-value.qbs b/tests/auto/language/testdata/erroneous/duplicate-multiplex-value.qbs new file mode 100644 index 000000000..56da41af1 --- /dev/null +++ b/tests/auto/language/testdata/erroneous/duplicate-multiplex-value.qbs @@ -0,0 +1,8 @@ +import qbs + +Product { + name: "p" + multiplexByQbsProperties: "architectures" + aggregate: false + qbs.architectures: ["x86", "arm", "x86"] +} diff --git a/tests/auto/language/testdata/erroneous/duplicate-multiplex-value2.qbs b/tests/auto/language/testdata/erroneous/duplicate-multiplex-value2.qbs new file mode 100644 index 000000000..e412e5210 --- /dev/null +++ b/tests/auto/language/testdata/erroneous/duplicate-multiplex-value2.qbs @@ -0,0 +1,8 @@ +import qbs + +Product { + name: "p" + multiplexByQbsProperties: ["architectures", "buildVariants", "architectures"] + aggregate: false + qbs.architectures: ["x86", "arm"] +} diff --git a/tests/auto/language/testdata/erroneous/modules/module-with-invalid-original/module-with-invalid-original.qbs b/tests/auto/language/testdata/erroneous/modules/module-with-invalid-original/module-with-invalid-original.qbs new file mode 100644 index 000000000..ef2404412 --- /dev/null +++ b/tests/auto/language/testdata/erroneous/modules/module-with-invalid-original/module-with-invalid-original.qbs @@ -0,0 +1,3 @@ +Module { + property string p: original +} diff --git a/tests/auto/language/testdata/erroneous/original-in-export-item.qbs b/tests/auto/language/testdata/erroneous/original-in-export-item.qbs new file mode 100644 index 000000000..51fedb9a2 --- /dev/null +++ b/tests/auto/language/testdata/erroneous/original-in-export-item.qbs @@ -0,0 +1,14 @@ +import qbs + +Project { + Product { + name: "a" + Export { + property string p: original + } + } + Product { + name: "b" + Depends { name: "a" } + } +} diff --git a/tests/auto/language/testdata/erroneous/original-in-module-prototype.qbs b/tests/auto/language/testdata/erroneous/original-in-module-prototype.qbs new file mode 100644 index 000000000..e7128092a --- /dev/null +++ b/tests/auto/language/testdata/erroneous/original-in-module-prototype.qbs @@ -0,0 +1,5 @@ +import qbs + +Product { + Depends { name: "module-with-invalid-original" } +} diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp index f3c510049..323ae763b 100644 --- a/tests/auto/language/tst_language.cpp +++ b/tests/auto/language/tst_language.cpp @@ -833,10 +833,21 @@ void TestLanguage::erroneousFiles_data() QTest::newRow("rule-without-output-tags") << "rule-without-output-tags.qbs:4:5.*A rule needs to have Artifact items or " "a non-empty outputFileTags property."; + QTest::newRow("original-in-module-prototype") + << "module-with-invalid-original.qbs:2:24.*The special value 'original' cannot be used " + "on the right-hand side of a property declaration."; + QTest::newRow("original-in-export-item") + << "original-in-export-item.qbs:7:32.*The special value 'original' cannot be used " + "on the right-hand side of a property declaration."; QTest::newRow("mismatching-multiplex-dependency") << "mismatching-multiplex-dependency.qbs:9:5.*Dependency from product " "'b \\{\"architecture\":\"mips\"\\}' to product 'a \\{\"architecture\":\"mips\"\\}'" " not fulfilled."; + QTest::newRow("duplicate-multiplex-value") + << "duplicate-multiplex-value.qbs:3:1.*Duplicate entry 'x86' in qbs.architectures."; + QTest::newRow("duplicate-multiplex-value2") + << "duplicate-multiplex-value2.qbs:3:1.*Duplicate entry 'architecture' in " + "Product.multiplexByQbsProperties."; QTest::newRow("invalid-references") << "invalid-references.qbs:4:17.*Cannot open '.*nosuchproject.qbs'"; } |