diff options
-rw-r--r-- | .github/workflows/main.yml | 10 | ||||
-rw-r--r-- | changelogs/1.24.0.md | 12 | ||||
-rwxr-xr-x | scripts/test-qbs.sh | 12 | ||||
-rw-r--r-- | share/qbs/imports/qbs/DarwinTools/darwin-tools.js | 13 | ||||
-rw-r--r-- | share/qbs/module-providers/qbspkgconfig.qbs | 10 | ||||
-rw-r--r-- | src/app/qbs/sessionpacket.cpp | 2 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/dot-dot-pc-file/dot-dot-pc-file.qbs | 7 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/dot-dot-pc-file/libdir/qbs.metatest.module.pc | 5 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/dot-dot-pc-file/main.cpp | 5 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 9 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.h | 1 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackboxapple.cpp | 39 |
12 files changed, 72 insertions, 53 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 811add8cc..0c01ec534 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -617,6 +617,7 @@ jobs: runner: 'macos-12', target: 'desktop', toolchain: 'clang_64', + xcodeVersion: '13.4.1', testProfile: 'xcode_13_4_1-macosx-x86_64', qtVersion: '5.15.2', script: './scripts/test-qbs.sh', @@ -626,6 +627,7 @@ jobs: runner: 'macos-12', target: 'desktop', toolchain: 'clang_64', + xcodeVersion: '13.4.1', testProfile: 'xcode_13_4_1-macosx-x86_64', qtVersion: '6.3.1', script: './scripts/test-qt.sh', @@ -635,6 +637,7 @@ jobs: runner: 'macos-12', target: 'ios', toolchain: 'ios', + xcodeVersion: '13.4.1', testProfile: 'xcode_13_4_1-iphoneos-arm64', qtVersion: '5.15.2', script: './scripts/test-qbs.sh', @@ -644,6 +647,7 @@ jobs: runner: 'macos-12', target: 'ios', toolchain: 'ios', + xcodeVersion: '13.4.1', testProfile: 'xcode_13_4_1-iphonesimulator-x86_64', qtVersion: '5.15.2', script: './scripts/test-qbs.sh', @@ -653,6 +657,7 @@ jobs: runner: 'macos-11', target: 'desktop', toolchain: 'clang_64', + xcodeVersion: '12.5.1', testProfile: 'xcode_12_5_1-macosx-x86_64', qtVersion: '5.15.2', script: './scripts/test-qbs.sh', @@ -662,6 +667,7 @@ jobs: runner: 'macos-11', target: 'desktop', toolchain: 'clang_64', + xcodeVersion: '11.7', testProfile: 'xcode_11_7-macosx-x86_64', qtVersion: '5.15.2', script: './scripts/test-qbs.sh', @@ -687,6 +693,8 @@ jobs: target: ${{ matrix.config.target }} toolchain: ${{ matrix.config.toolchain }} version: ${{ matrix.config.qtVersion }} + - name: Select Xcode + run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.config.xcodeVersion }}.app - name: Setup Qbs run: | qbs setup-toolchains --detect @@ -703,7 +711,7 @@ jobs: if: ${{ failure() }} run: | for f in $(find /cores -maxdepth 1 -name 'core.*' -print); do - lldb --core $f --batch --one-line "bt" + lldb --core $f --batch --one-line "bt all" done; test-windows: diff --git a/changelogs/1.24.0.md b/changelogs/1.24.0.md new file mode 100644 index 000000000..45250ec98 --- /dev/null +++ b/changelogs/1.24.0.md @@ -0,0 +1,12 @@ +# General +* Users can now control if and when warnings for deprecated properties are emitted. +* Added FileInfo.executableSuffix(). + +# Qt Support +* Minimum windows version is now 10.0, like for cmake and qmake. + +# Contributors +* Christian Kandeler +* Ivan Komissarov +* Petr Mikhalicin +* Raphael Cotty diff --git a/scripts/test-qbs.sh b/scripts/test-qbs.sh index 55dc6524e..3996c63bf 100755 --- a/scripts/test-qbs.sh +++ b/scripts/test-qbs.sh @@ -38,7 +38,7 @@ ## ############################################################################# -set -eu +set -eu -o pipefail # # Qbs is built with the address sanitizer enabled. @@ -48,12 +48,6 @@ export LSAN_OPTIONS="suppressions=$( cd "$(dirname "$0")" ; pwd -P )/address-san export PATH="$1:$PATH" -CPUS=$("$(dirname "$0")"/cpu-count.sh) - export QBS_AUTOTEST_PROFILE=${QBS_AUTOTEST_PROFILE:-qt} -echo "Running Qbs tests (${CPUS} jobs in parallel)." -find $1 -name "tst_*" \ - | grep -v tst_blackbox-joblimits \ - | xargs -I{} -n1 -P${CPUS} bash -c \ - 'export LOG=$(mktemp) ; $({} > ${LOG} 2>&1) ; export RESULT=$? ; cat ${LOG} ; exit ${RESULT}' -tst_blackbox-joblimits +echo "Running Qbs tests." +find $1 -name "tst*" | xargs -I{} -n1 bash -c "{}" diff --git a/share/qbs/imports/qbs/DarwinTools/darwin-tools.js b/share/qbs/imports/qbs/DarwinTools/darwin-tools.js index 15f2c54ec..9f7d92e59 100644 --- a/share/qbs/imports/qbs/DarwinTools/darwin-tools.js +++ b/share/qbs/imports/qbs/DarwinTools/darwin-tools.js @@ -182,7 +182,7 @@ var PropertyListVariableExpander = (function () { return { "syntax": syntax, "index": idx }; } - function expandString(key, str, env) { + function expandString(key, str, env, seenVars) { if (!str) return str; var repl = indexOfReplacementStart(syntaxes, str); @@ -194,7 +194,14 @@ var PropertyListVariableExpander = (function () { var varParts = str.slice(i + repl.syntax.open.length, j).split(':'); var varName = varParts[0]; var varFormatter = varParts[1]; - var varValue = expandString(key, env[varName], env); + var envValue = env[varName]; + // if we end up expanding the same variable again, break the recursion + if (seenVars.indexOf(varName) !== -1) + envValue = ""; + else + seenVars.push(varName); + var varValue = expandString(key, envValue, env, seenVars); + seenVars.pop(); if (undefined === varValue) { // skip replacement if ($this.undefinedVariableFunction) @@ -229,7 +236,7 @@ var PropertyListVariableExpander = (function () { } if (type !== "string") continue; - var expandedValue = expandString(key, value, env); + var expandedValue = expandString(key, value, env, []); if (expandedValue !== value) obj[key] = expandedValue; } diff --git a/share/qbs/module-providers/qbspkgconfig.qbs b/share/qbs/module-providers/qbspkgconfig.qbs index bc2c6be46..ccd08febd 100644 --- a/share/qbs/module-providers/qbspkgconfig.qbs +++ b/share/qbs/module-providers/qbspkgconfig.qbs @@ -120,7 +120,7 @@ ModuleProvider { return result; } - function getModuleName(packageName) { return packageName.replace('.', '-'); } + function getModuleName(packageName) { return packageName.replace(/\./g, '-'); } function getModuleDependencies(pkg, staticMode) { var mapper = function(p) { @@ -214,9 +214,9 @@ ModuleProvider { setupQt(pkg); continue; } - var moduleName = moduleMapping[packageName] + var moduleName = getModuleName(moduleMapping[packageName] ? moduleMapping[packageName] - : getModuleName(packageName); + : packageName); var moduleInfo = getModuleInfo(pkg, staticMode); var deps = getModuleDependencies(pkg, staticMode); @@ -228,7 +228,9 @@ ModuleProvider { module.writeLine(" version: " + ModUtils.toJSLiteral(moduleInfo.version)); module.writeLine(" Depends { name: 'cpp' }"); deps.forEach(function(dep) { - module.write(" Depends { name: '" + dep.name + "'"); + var depName = getModuleName( + moduleMapping[dep.name] ? moduleMapping[dep.name] : dep.name); + module.write(" Depends { name: '" + depName + "'"); for (var k in dep) { if (k === "name") continue; diff --git a/src/app/qbs/sessionpacket.cpp b/src/app/qbs/sessionpacket.cpp index 5af252179..3830704fa 100644 --- a/src/app/qbs/sessionpacket.cpp +++ b/src/app/qbs/sessionpacket.cpp @@ -99,7 +99,7 @@ QJsonObject SessionPacket::helloMessage() { return QJsonObject{ {StringConstants::type(), QLatin1String("hello")}, - {QLatin1String("api-level"), 2}, + {QLatin1String("api-level"), 3}, {QLatin1String("api-compat-level"), 2} }; } diff --git a/tests/auto/blackbox/testdata/dot-dot-pc-file/dot-dot-pc-file.qbs b/tests/auto/blackbox/testdata/dot-dot-pc-file/dot-dot-pc-file.qbs new file mode 100644 index 000000000..60c4ea2bc --- /dev/null +++ b/tests/auto/blackbox/testdata/dot-dot-pc-file/dot-dot-pc-file.qbs @@ -0,0 +1,7 @@ +CppApplication { + name: "p" + Depends { name: "qbs-metatest-module"; } + files: "main.cpp" + moduleProviders.qbspkgconfig.libDirs: "libdir" + qbsModuleProviders: "qbspkgconfig" +} diff --git a/tests/auto/blackbox/testdata/dot-dot-pc-file/libdir/qbs.metatest.module.pc b/tests/auto/blackbox/testdata/dot-dot-pc-file/libdir/qbs.metatest.module.pc new file mode 100644 index 000000000..c00fd26d6 --- /dev/null +++ b/tests/auto/blackbox/testdata/dot-dot-pc-file/libdir/qbs.metatest.module.pc @@ -0,0 +1,5 @@ +Name: qbs.metatest.module +Description: just a test +Version: 0.0.1 + +Cflags: -DTHE_MAGIC_DEFINE diff --git a/tests/auto/blackbox/testdata/dot-dot-pc-file/main.cpp b/tests/auto/blackbox/testdata/dot-dot-pc-file/main.cpp new file mode 100644 index 000000000..442b755bf --- /dev/null +++ b/tests/auto/blackbox/testdata/dot-dot-pc-file/main.cpp @@ -0,0 +1,5 @@ +#ifndef THE_MAGIC_DEFINE +#error "missing the magic define" +#endif + +int main() {} diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 3907a5b66..d97dd4562 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -1226,6 +1226,13 @@ void TestBlackbox::discardUnusedData_data() QTest::newRow("default") << QString() << true; } +void TestBlackbox::dotDotPcFile() +{ + QDir::setCurrent(testDataDir + "/dot-dot-pc-file"); + + QCOMPARE(runQbs(), 0); +} + void TestBlackbox::driverLinkerFlags() { QDir::setCurrent(testDataDir + QLatin1String("/driver-linker-flags")); @@ -6409,7 +6416,7 @@ void TestBlackbox::qbsSession() // Wait for and verify hello packet. QJsonObject receivedMessage = getNextSessionPacket(sessionProc, incomingData); QCOMPARE(receivedMessage.value("type"), "hello"); - QCOMPARE(receivedMessage.value("api-level").toInt(), 2); + QCOMPARE(receivedMessage.value("api-level").toInt(), 3); QCOMPARE(receivedMessage.value("api-compat-level").toInt(), 2); // Resolve & verify structure diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index 285d465fd..429144038 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -99,6 +99,7 @@ private slots: void disappearedProfile(); void discardUnusedData(); void discardUnusedData_data(); + void dotDotPcFile(); void driverLinkerFlags(); void driverLinkerFlags_data(); void dynamicLibraryInModule(); diff --git a/tests/auto/blackbox/tst_blackboxapple.cpp b/tests/auto/blackbox/tst_blackboxapple.cpp index 0a6a763ee..5de371792 100644 --- a/tests/auto/blackbox/tst_blackboxapple.cpp +++ b/tests/auto/blackbox/tst_blackboxapple.cpp @@ -359,15 +359,13 @@ void TestBlackboxApple::assetCatalog() { QFETCH(bool, flatten); - const auto xcodeVersion = findXcodeVersion(); QDir::setCurrent(testDataDir + QLatin1String("/ib/assetcatalog")); rmDirR(relativeBuildDir()); QbsRunParameters params; - const auto v = HostOsInfo::hostOsVersion(); const QString flattens = "modules.ib.flatten:" + QString(flatten ? "true" : "false"); - const QString macosTarget = "modules.cpp.minimumMacosVersion:'" + v.toString() + "'"; + const QString macosTarget = "modules.cpp.minimumMacosVersion:'10.15'"; // Make sure a dry run does not write anything params.arguments = QStringList() << "-f" << "assetcatalogempty.qbs" << "--dry-run" @@ -383,39 +381,12 @@ void TestBlackboxApple::assetCatalog() QCOMPARE(runQbs(params), 0); // empty asset catalogs must still produce output - if (xcodeVersion >= qbs::Version(5)) - QVERIFY((bool)m_qbsStdout.contains("compiling empty.xcassets")); - - // should additionally produce raw assets since deployment target will be < 10.9 - // older versions of ibtool generated either raw assets OR .car files; - // newer versions always generate the .car file regardless of the deployment target - if (v < qbs::Version(10, 9)) { - QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty") - + "/assetcatalogempty.app/Contents/Resources/other.png")); - QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty") - + "/assetcatalogempty.app/Contents/Resources/other@2x.png")); - } - - rmDirR(relativeBuildDir()); - params.arguments.push_back("modules.cpp.minimumMacosVersion:'10.10'"); // force CAR generation - QCOMPARE(runQbs(params), 0); + QVERIFY((bool)m_qbsStdout.contains("compiling empty.xcassets")); // empty asset catalogs must still produce output - if (xcodeVersion >= qbs::Version(5)) { - QVERIFY((bool)m_qbsStdout.contains("compiling empty.xcassets")); - // No matter what, we need a 10.9 host to build CAR files - if (HostOsInfo::hostOsVersion() >= qbs::Version(10, 9)) { - QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty") - + "/assetcatalogempty.app/Contents/Resources/Assets.car")); - } else { - QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty") - + "/assetcatalogempty.app/Contents/Resources/empty.icns")); - QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty") - + "/assetcatalogempty.app/Contents/Resources/other.png")); - QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty") - + "/assetcatalogempty.app/Contents/Resources/other@2x.png")); - } - } + QVERIFY((bool)m_qbsStdout.contains("compiling empty.xcassets")); + QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty") + + "/assetcatalogempty.app/Contents/Resources/Assets.car")); // this asset catalog happens to have an embedded icon set, // but this should NOT be built since it is not in the files list |