summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-06-08 10:54:50 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-06-09 09:58:25 +0000
commit525165a38302cf43a908a93f57a3a88cd6abc0e0 (patch)
treeac7de05bb77d0ad4f25c6c4149850ab825e360ab /tests
parentdd4f79167e15c563c521663a05143c18063d22f2 (diff)
downloadqbs-525165a38302cf43a908a93f57a3a88cd6abc0e0.tar.gz
Remove the profile name from the unique product name
If the product is multiplexed by profile, its name is already uniquified by the multiplex id. If the product is not multiplexed, we don't need to make the name unique. This removes references to the top-level profile name from the build directory structure, which can be helpful when rebuilding with a different profile name, but the same effective properties. Also, it shortens the paths of generated artifacts in the common case. Change-Id: I1586049b9650542732a64be4b7d5f2db4428d87e Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/api/tst_api.cpp6
-rw-r--r--tests/auto/blackbox/testdata/subprofile-change-tracking/subprofile-change-tracking.qbs3
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp5
-rw-r--r--tests/auto/blackbox/tst_blackboxjava.cpp2
-rw-r--r--tests/auto/shared.h9
5 files changed, 12 insertions, 13 deletions
diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp
index eb1ee0c12..bfe744ddb 100644
--- a/tests/auto/api/tst_api.cpp
+++ b/tests/auto/api/tst_api.cpp
@@ -1529,19 +1529,19 @@ void TestApi::multiArch()
QVERIFY2(!buildJob->error().hasError(), qPrintable(buildJob->error().toString()));
const QString outputBaseDir = setupParams.buildRoot() + '/';
QFile p1HostArtifact(outputBaseDir
- + relativeProductBuildDir("p1", "host", p1HostMultiplexCfgId)
+ + relativeProductBuildDir("p1", p1HostMultiplexCfgId)
+ "/host+target.output");
QVERIFY2(p1HostArtifact.exists(), qPrintable(p1HostArtifact.fileName()));
QVERIFY2(p1HostArtifact.open(QIODevice::ReadOnly), qPrintable(p1HostArtifact.errorString()));
QCOMPARE(p1HostArtifact.readAll().constData(), "host-arch");
QFile p1TargetArtifact(outputBaseDir
- + relativeProductBuildDir("p1", "target", p1TargetMultiplexCfgId)
+ + relativeProductBuildDir("p1", p1TargetMultiplexCfgId)
+ "/host+target.output");
QVERIFY2(p1TargetArtifact.exists(), qPrintable(p1TargetArtifact.fileName()));
QVERIFY2(p1TargetArtifact.open(QIODevice::ReadOnly), qPrintable(p1TargetArtifact.errorString()));
QCOMPARE(p1TargetArtifact.readAll().constData(), "target-arch");
QFile p2Artifact(outputBaseDir
- + relativeProductBuildDir("p2", "host", p2HostMultiplexCfgId)
+ + relativeProductBuildDir("p2", p2HostMultiplexCfgId)
+ "/host-tool.output");
QVERIFY2(p2Artifact.exists(), qPrintable(p2Artifact.fileName()));
QVERIFY2(p2Artifact.open(QIODevice::ReadOnly), qPrintable(p2Artifact.errorString()));
diff --git a/tests/auto/blackbox/testdata/subprofile-change-tracking/subprofile-change-tracking.qbs b/tests/auto/blackbox/testdata/subprofile-change-tracking/subprofile-change-tracking.qbs
index d23881940..b3fba23fe 100644
--- a/tests/auto/blackbox/testdata/subprofile-change-tracking/subprofile-change-tracking.qbs
+++ b/tests/auto/blackbox/testdata/subprofile-change-tracking/subprofile-change-tracking.qbs
@@ -1,8 +1,9 @@
import qbs
Project {
- CppApplication { files: ["main1.cpp"] }
+ CppApplication { name: "app1"; files: ["main1.cpp"] }
CppApplication {
+ name: "app2"
qbs.profiles: ["qbs-autotests-subprofile"]
files: ["main2.cpp"]
}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index c9fc70c58..e0df2e7ac 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -616,8 +616,9 @@ void TestBlackbox::dependencyProfileMismatch()
QbsRunParameters params(QStringList() << ("project.mainProfile:" + profileName())
<< ("project.depProfile:" + depProfile.p.name()));
params.expectFailure = true;
- QVERIFY(runQbs(params) != 0);
- QVERIFY2(m_qbsStderr.contains(profileName().toLocal8Bit() + "', which does not exist"),
+ QVERIFY2(runQbs(params) != 0, m_qbsStderr.constData());
+ QVERIFY2(m_qbsStderr.contains(profileName().toLocal8Bit())
+ && m_qbsStderr.contains("', which does not exist"),
m_qbsStderr.constData());
}
diff --git a/tests/auto/blackbox/tst_blackboxjava.cpp b/tests/auto/blackbox/tst_blackboxjava.cpp
index 43a82839a..18cafead9 100644
--- a/tests/auto/blackbox/tst_blackboxjava.cpp
+++ b/tests/auto/blackbox/tst_blackboxjava.cpp
@@ -94,7 +94,7 @@ void TestBlackboxJava::android()
for (int i = 0; i < productNames.count(); ++i) {
const QString productName = productNames.at(i);
QVERIFY(m_qbsStdout.contains("Creating " + productName.toLocal8Bit() + ".apk"));
- const QString apkFilePath = relativeProductBuildDir(productName, p.name())
+ const QString apkFilePath = relativeProductBuildDir(productName)
+ '/' + productName + ".apk";
QVERIFY2(regularFileExists(apkFilePath), qPrintable(apkFilePath));
const QString jarFilePath = findExecutable(QStringList("jar"));
diff --git a/tests/auto/shared.h b/tests/auto/shared.h
index 98e84e8c1..9c9c10df0 100644
--- a/tests/auto/shared.h
+++ b/tests/auto/shared.h
@@ -81,19 +81,16 @@ inline QString prefixedIfNonEmpty(const T &prefix, const QString &str)
return prefix + str;
}
-inline QString uniqueProductName(const QString &productName, const QString &_profileName,
+inline QString uniqueProductName(const QString &productName,
const QString &multiplexConfigurationId)
{
- const QString p = _profileName.isEmpty() ? profileName() : _profileName;
- return productName + '.' + p + prefixedIfNonEmpty(QLatin1Char('.'), multiplexConfigurationId);
+ return productName + prefixedIfNonEmpty(QLatin1Char('.'), multiplexConfigurationId);
}
inline QString relativeProductBuildDir(const QString &productName,
- const QString &productProfileName = QString(),
const QString &multiplexConfigurationId = QString())
{
- const QString fullName = uniqueProductName(productName, productProfileName,
- multiplexConfigurationId);
+ const QString fullName = uniqueProductName(productName, multiplexConfigurationId);
QString dirName = qbs::Internal::HostOsInfo::rfc1034Identifier(fullName);
const QByteArray hash = QCryptographicHash::hash(fullName.toUtf8(), QCryptographicHash::Sha1);
dirName.append('.').append(hash.toHex().left(8));