aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-11-30 08:20:52 -0800
committerJake Petroules <jake.petroules@qt.io>2017-12-01 19:52:47 +0000
commitcf2116b63a052bfcd7546bec56f66a5015cf5c51 (patch)
treecc2b0ce1c642570c8a76fe9bdf2c2f3285c9217a /tests/auto
parent983caefa5b7fc8dc40bf620bd75c21d9f07c1573 (diff)
Make Version a public class
It's already exposed in public API; i.e. via qtprofilesetup headers. Change-Id: I56950ce3163e6c5bd2c3fd08cc885b35723be5a7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp16
-rw-r--r--tests/auto/blackbox/tst_blackboxapple.cpp30
-rw-r--r--tests/auto/blackbox/tst_blackboxapple.h4
-rw-r--r--tests/auto/blackbox/tst_clangdb.cpp9
-rw-r--r--tests/auto/blackbox/tst_clangdb.h2
5 files changed, 29 insertions, 32 deletions
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 8f5f73dc6..f51267a6b 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -5157,21 +5157,21 @@ void TestBlackbox::minimumSystemVersion()
QVERIFY(m_qbsStdout.contains(output.toUtf8()));
}
-static qbs::Internal::Version fromMinimumDeploymentTargetValue(int v, bool isMacOS)
+static qbs::Version fromMinimumDeploymentTargetValue(int v, bool isMacOS)
{
if (isMacOS && v < 100000)
- return qbs::Internal::Version(v / 100, v / 10 % 10, v % 10);
- return qbs::Internal::Version(v / 10000, v / 100 % 100, v % 100);
+ return qbs::Version(v / 100, v / 10 % 10, v % 10);
+ return qbs::Version(v / 10000, v / 100 % 100, v % 100);
}
-static int toMinimumDeploymentTargetValue(const qbs::Internal::Version &v, bool isMacOS)
+static int toMinimumDeploymentTargetValue(const qbs::Version &v, bool isMacOS)
{
- if (isMacOS && v < qbs::Internal::Version(10, 10))
+ if (isMacOS && v < qbs::Version(10, 10))
return (v.majorVersion() * 100) + (v.minorVersion() * 10) + v.patchLevel();
return (v.majorVersion() * 10000) + (v.minorVersion() * 100) + v.patchLevel();
}
-static qbs::Internal::Version defaultClangMinimumDeploymentTarget()
+static qbs::Version defaultClangMinimumDeploymentTarget()
{
QProcess process;
process.start("/usr/bin/xcrun", {"-sdk", "macosx", "clang++",
@@ -5192,7 +5192,7 @@ static qbs::Internal::Version defaultClangMinimumDeploymentTarget()
}
}
- return qbs::Internal::Version();
+ return qbs::Version();
}
void TestBlackbox::minimumSystemVersion_data()
@@ -5355,7 +5355,7 @@ void TestBlackbox::badInterpreter()
void TestBlackbox::qbsVersion()
{
- const qbs::Internal::Version v = qbs::Internal::Version::qbsVersion();
+ const qbs::Version v = qbs::Version::qbsVersion();
QDir::setCurrent(testDataDir + QLatin1String("/qbsVersion"));
QbsRunParameters params;
params.arguments = QStringList()
diff --git a/tests/auto/blackbox/tst_blackboxapple.cpp b/tests/auto/blackbox/tst_blackboxapple.cpp
index 9925265e8..6fc526cd8 100644
--- a/tests/auto/blackbox/tst_blackboxapple.cpp
+++ b/tests/auto/blackbox/tst_blackboxapple.cpp
@@ -171,13 +171,13 @@ void TestBlackboxApple::assetCatalog()
QCOMPARE(runQbs(params), 0);
// empty asset catalogs must still produce output
- if (xcodeVersion >= qbs::Internal::Version(5))
+ 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::Internal::Version(10, 9)) {
+ if (v < qbs::Version(10, 9)) {
QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty")
+ "/assetcatalogempty.app/Contents/Resources/other.png"));
QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty")
@@ -189,10 +189,10 @@ void TestBlackboxApple::assetCatalog()
QCOMPARE(runQbs(params), 0);
// empty asset catalogs must still produce output
- if (xcodeVersion >= qbs::Internal::Version(5)) {
+ 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::Internal::Version(10, 9)) {
+ if (HostOsInfo::hostOsVersion() >= qbs::Version(10, 9)) {
QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty")
+ "/assetcatalogempty.app/Contents/Resources/Assets.car"));
} else {
@@ -228,7 +228,7 @@ void TestBlackboxApple::assetCatalog()
QString storyboardc = relativeProductBuildDir("assetcatalogempty") + "/assetcatalogempty.app/Contents/Resources/Storyboard.storyboardc";
QStringList storyboardcFiles;
- if (HostOsInfo::hostOsVersion() >= qbs::Internal::Version(10, 10)) {
+ if (HostOsInfo::hostOsVersion() >= qbs::Version(10, 10)) {
QVERIFY(directoryExists(storyboardc));
storyboardcFiles = QStringList()
@@ -261,7 +261,7 @@ void TestBlackboxApple::assetCatalog_data()
}
void TestBlackboxApple::assetCatalogsEmpty() {
- if (findXcodeVersion() < qbs::Internal::Version(5))
+ if (findXcodeVersion() < qbs::Version(5))
QSKIP("requires Xcode 5 or above");
QDir::setCurrent(testDataDir + QLatin1String("/ib/empty-asset-catalogs"));
QCOMPARE(runQbs(), 0);
@@ -270,7 +270,7 @@ void TestBlackboxApple::assetCatalogsEmpty() {
}
void TestBlackboxApple::assetCatalogsMultiple() {
- if (findXcodeVersion() < qbs::Internal::Version(5))
+ if (findXcodeVersion() < qbs::Version(5))
QSKIP("requires Xcode 5 or above");
QDir::setCurrent(testDataDir + QLatin1String("/ib/multiple-asset-catalogs"));
QCOMPARE(runQbs(), 0);
@@ -290,7 +290,7 @@ void TestBlackboxApple::bundleStructure()
if (isShallow) {
// Coerce shallow bundles - don't set bundle.isShallow directly because we want to test the
// automatic detection
- const auto xcode5 = findXcodeVersion() >= qbs::Internal::Version(5);
+ const auto xcode5 = findXcodeVersion() >= qbs::Version(5);
params.arguments
<< "modules.qbs.targetPlatform:ios"
<< (xcode5 ? "qbs.architectures:arm64" : "qbs.architectures:armv7a");
@@ -572,7 +572,7 @@ void TestBlackboxApple::deploymentTarget_data()
<< "-macosx_version_min 10.4";
const auto xcodeVersion = findXcodeVersion();
- if (xcodeVersion >= qbs::Internal::Version(6))
+ if (xcodeVersion >= qbs::Version(6))
QTest::newRow("macos x86_64h") << "macosx" << macos << "x86_64h"
<< "-triple x86_64h-apple-macosx10.12"
<< "-macosx_version_min 10.12";
@@ -583,20 +583,20 @@ void TestBlackboxApple::deploymentTarget_data()
QTest::newRow("ios armv7s") << "iphoneos" <<ios << "armv7s"
<< "-triple thumbv7s-apple-ios7.0"
<< "-iphoneos_version_min 7.0";
- if (xcodeVersion >= qbs::Internal::Version(5))
+ if (xcodeVersion >= qbs::Version(5))
QTest::newRow("ios arm64") << "iphoneos" <<ios << "arm64"
<< "-triple arm64-apple-ios7.0"
<< "-iphoneos_version_min 7.0";
QTest::newRow("ios-simulator x86") << "iphonesimulator" << ios_sim << "x86"
<< "-triple i386-apple-ios6.0"
<< "-ios_simulator_version_min 6.0";
- if (xcodeVersion >= qbs::Internal::Version(5))
+ if (xcodeVersion >= qbs::Version(5))
QTest::newRow("ios-simulator x86_64") << "iphonesimulator" << ios_sim << "x86_64"
<< "-triple x86_64-apple-ios7.0"
<< "-ios_simulator_version_min 7.0";
- if (xcodeVersion >= qbs::Internal::Version(7)) {
- if (xcodeVersion >= qbs::Internal::Version(7, 1)) {
+ if (xcodeVersion >= qbs::Version(7)) {
+ if (xcodeVersion >= qbs::Version(7, 1)) {
QTest::newRow("tvos arm64") << "appletvos" << tvos << "arm64"
<< "-triple arm64-apple-tvos9.0"
<< "-tvos_version_min 9.0";
@@ -768,7 +768,7 @@ QVariantMap TestBlackboxApple::findXcode(int *status)
return QJsonDocument::fromJson(file.readAll()).toVariant().toMap();
}
-qbs::Internal::Version TestBlackboxApple::findXcodeVersion()
+qbs::Version TestBlackboxApple::findXcodeVersion()
{
- return qbs::Internal::Version::fromString(findXcode().value("version").toString());
+ return qbs::Version::fromString(findXcode().value("version").toString());
}
diff --git a/tests/auto/blackbox/tst_blackboxapple.h b/tests/auto/blackbox/tst_blackboxapple.h
index b9bb64104..05e0d8acd 100644
--- a/tests/auto/blackbox/tst_blackboxapple.h
+++ b/tests/auto/blackbox/tst_blackboxapple.h
@@ -32,9 +32,7 @@
#include "tst_blackboxbase.h"
namespace qbs {
-namespace Internal {
class Version;
-} // namespace Internal
} // namespace qbs
class TestBlackboxApple : public TestBlackboxBase
@@ -68,7 +66,7 @@ private slots:
private:
QVariantMap findXcode(int *status = nullptr);
- qbs::Internal::Version findXcodeVersion();
+ qbs::Version findXcodeVersion();
};
#endif // TST_BLACKBOXAPPLE_H
diff --git a/tests/auto/blackbox/tst_clangdb.cpp b/tests/auto/blackbox/tst_clangdb.cpp
index b1b03dbc3..566082211 100644
--- a/tests/auto/blackbox/tst_clangdb.cpp
+++ b/tests/auto/blackbox/tst_clangdb.cpp
@@ -46,7 +46,6 @@
using qbs::InstallOptions;
using qbs::Internal::HostOsInfo;
-using qbs::Internal::Version;
int TestClangDb::runProcess(const QString &exec, const QStringList &args, QByteArray &stdErr,
QByteArray &stdOut)
@@ -78,15 +77,15 @@ int TestClangDb::runProcess(const QString &exec, const QStringList &args, QByteA
return process.exitStatus() == QProcess::NormalExit ? process.exitCode() : -1;
}
-Version TestClangDb::clangVersion()
+qbs::Version TestClangDb::clangVersion()
{
QByteArray stdErr;
QByteArray stdOut;
if (runProcess("clang-check", QStringList("--version"), stdErr, stdOut) != 0)
- return Version();
+ return qbs::Version();
stdOut.remove(0, stdOut.indexOf("LLVM version ") + 13);
stdOut.truncate(stdOut.indexOf('\n'));
- return Version::fromString(QString::fromLocal8Bit(stdOut));
+ return qbs::Version::fromString(QString::fromLocal8Bit(stdOut));
}
@@ -195,7 +194,7 @@ void TestClangDb::checkClangDetectsSourceCodeProblems()
// Older clang versions do not support the "arguments" array in the compilation database.
// Should we really want to support them, we would have to fall back to "command" instead.
- if (clangVersion() < Version(3, 7))
+ if (clangVersion() < qbs::Version(3, 7))
QSKIP("This test requires clang-check to be based on at least LLVM 3.7.0.");
// clang-check.exe does not understand MSVC command-line syntax
diff --git a/tests/auto/blackbox/tst_clangdb.h b/tests/auto/blackbox/tst_clangdb.h
index 16da83414..6122e636d 100644
--- a/tests/auto/blackbox/tst_clangdb.h
+++ b/tests/auto/blackbox/tst_clangdb.h
@@ -51,7 +51,7 @@ private slots:
private:
int runProcess(const QString &exec, const QStringList &args, QByteArray &stdErr,
QByteArray &stdOut);
- qbs::Internal::Version clangVersion();
+ qbs::Version clangVersion();
const QString projectDir;
const QString projectFileName;