mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-08 15:39:35 +00:00
test optimisation
This commit is contained in:
parent
c291853e21
commit
8d294bc41f
@ -22,6 +22,7 @@ android: DEFINES += WITHOUT_TESTS
|
||||
CQtDeployer \
|
||||
UnitTests \
|
||||
tests/TestOnlyC \
|
||||
tests/TestCPPOnly \
|
||||
tests/TestQtWidgets \
|
||||
tests/TestQMLWidgets \
|
||||
tests/virtualkeyboard
|
||||
@ -33,6 +34,7 @@ android: DEFINES += WITHOUT_TESTS
|
||||
contains(DEFINES, WITHOUT_TESTS) {
|
||||
SUBDIRS -= UnitTests \
|
||||
tests/TestOnlyC \
|
||||
tests/TestCPPOnly \
|
||||
tests/TestQtWidgets \
|
||||
tests/TestQMLWidgets \
|
||||
tests/quicknanobrowser \
|
||||
|
@ -44,11 +44,6 @@ class deploytest : public QObject
|
||||
private:
|
||||
QSet<QString> filesTree;
|
||||
|
||||
bool runProcess(const QString& DistroPath,
|
||||
const QString& filename,
|
||||
const QString &qt = "");
|
||||
QStringList getFilesFromDir(const QString& dir);
|
||||
|
||||
void runTestParams(QStringList list,
|
||||
QSet<QString> *tree = nullptr,
|
||||
bool noWarnings = false,
|
||||
@ -142,8 +137,6 @@ private slots:
|
||||
|
||||
void testMSVC();
|
||||
|
||||
void testEmptyParamsString();
|
||||
|
||||
// qif flags
|
||||
void testQIF();
|
||||
void testQIFMulti();
|
||||
@ -191,78 +184,6 @@ private slots:
|
||||
void customTest();
|
||||
};
|
||||
|
||||
bool deploytest::runProcess(const QString &DistroPath,
|
||||
const QString &filename,
|
||||
const QString& qt) {
|
||||
|
||||
QProcess p;
|
||||
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
|
||||
if (qt.size()) {
|
||||
auto val = env.value("LD_LIBRARY_PATH","").remove(qt);
|
||||
env.insert("LD_LIBRARY_PATH", val);
|
||||
|
||||
val = env.value("PATH","").remove(qt);
|
||||
env.insert("PATH", val);
|
||||
|
||||
env.insert("QTDIR", "");
|
||||
} else {
|
||||
env.clear();
|
||||
env.insert("QTDIR", "");
|
||||
|
||||
}
|
||||
p.setProcessEnvironment(env);
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
p.setProgram(DistroPath + "/" + filename + ".sh");
|
||||
#else
|
||||
p.setProgram(DistroPath + "/" + filename + ".exe");
|
||||
#endif
|
||||
|
||||
p.start();
|
||||
|
||||
if (!p.waitForFinished(10000)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QString str = p.readAll();
|
||||
if (p.exitCode()) {
|
||||
qCritical() << p.errorString();
|
||||
}
|
||||
|
||||
if (p.exitCode()) {
|
||||
qWarning() << "exitCode == " << p.exitCode();
|
||||
}
|
||||
|
||||
if (str.contains("failed to load component", Qt::CaseInsensitive)
|
||||
|| str.contains("is not installed", Qt::CaseInsensitive) ||
|
||||
str.contains("error", Qt::CaseInsensitive)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return p.exitCode() == 0;
|
||||
}
|
||||
|
||||
QStringList deploytest::getFilesFromDir(const QString &path) {
|
||||
QDir dir(path);
|
||||
|
||||
QStringList res;
|
||||
|
||||
auto list = dir.entryInfoList(QDir::Dirs| QDir::Files| QDir::NoDotAndDotDot);
|
||||
|
||||
for (const auto &subDir: qAsConst(list)) {
|
||||
|
||||
if (subDir.isFile()) {
|
||||
res.push_back(subDir.fileName());
|
||||
} else {
|
||||
res.append(getFilesFromDir(subDir.absoluteFilePath()));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
deploytest::deploytest() {
|
||||
|
||||
qputenv("QTEST_FUNCTION_TIMEOUT", "1800000");
|
||||
@ -535,9 +456,6 @@ void deploytest::testMSVC() {
|
||||
|
||||
}
|
||||
|
||||
void deploytest::testEmptyParamsString() {
|
||||
}
|
||||
|
||||
void deploytest::testWebEngine() {
|
||||
#ifdef Q_OS_UNIX
|
||||
TestUtils utils;
|
||||
@ -567,84 +485,62 @@ void deploytest::testWebEngine() {
|
||||
void deploytest::testQIF() {
|
||||
TestUtils utils;
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "TestQMLWidgets";
|
||||
QString bin = TestBinDir + "TestOnlyC";
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake";
|
||||
auto comapareTree = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/InstallerTestQMLWidgets.run",
|
||||
"./" + DISTRO_DIR + "/InstallerTestQMLWidgets.run.md5",
|
||||
"./" + DISTRO_DIR + "/InstallerTestOnlyC.run",
|
||||
"./" + DISTRO_DIR + "/InstallerTestOnlyC.run.md5",
|
||||
});
|
||||
|
||||
#else
|
||||
QString bin = TestBinDir + "TestQMLWidgets.exe";
|
||||
QString bin = TestBinDir + "TestOnlyC.exe";
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake.exe";
|
||||
auto comapareTree = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/InstallerTestQMLWidgets.exe",
|
||||
"./" + DISTRO_DIR + "/InstallerTestQMLWidgets.exe.md5",
|
||||
"./" + DISTRO_DIR + "/InstallerTestOnlyC.exe",
|
||||
"./" + DISTRO_DIR + "/InstallerTestOnlyC.exe.md5",
|
||||
|
||||
});
|
||||
|
||||
#endif
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"-qmlDir", TestBinDir + "/../TestQMLWidgets",
|
||||
"qif", "qifFromSystem",
|
||||
"-qifStyle", "quasar",
|
||||
"-qifBanner", TestBinDir + "/../../res/CQtDeployer_banner_web.png",
|
||||
"-qifLogo", TestBinDir + "/../../res/CQtDeployer defaultIcon_web.png"}, &comapareTree, true);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void deploytest::testQIFMulti() {
|
||||
TestUtils utils;
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "TestQMLWidgets";
|
||||
QString target1 = TestBinDir + "TestOnlyC";
|
||||
QString target1 = TestBinDir + "TestCPPOnly";
|
||||
QString target2 = TestBinDir + "TestOnlyC";
|
||||
|
||||
auto comapareTreeMulti = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/InstallerQtWidgetsProject.run",
|
||||
"./" + DISTRO_DIR + "/InstallerQtWidgetsProject.run.md5",
|
||||
"./" + DISTRO_DIR + "/InstallerApplication.run",
|
||||
"./" + DISTRO_DIR + "/InstallerApplication.run.md5",
|
||||
|
||||
});
|
||||
|
||||
#else
|
||||
QString bin = TestBinDir + "TestQMLWidgets.exe";
|
||||
QString target1 = TestBinDir + "TestOnlyC.exe";
|
||||
QString target1 = TestBinDir + "TestCPPOnly.exe";
|
||||
QString target2 = TestBinDir + "TestOnlyC.exe";
|
||||
|
||||
auto comapareTreeMulti = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/InstallerQtWidgetsProject.exe",
|
||||
"./" + DISTRO_DIR + "/InstallerQtWidgetsProject.exe.md5",
|
||||
"./" + DISTRO_DIR + "/InstallerApplication.exe",
|
||||
"./" + DISTRO_DIR + "/InstallerApplication.exe.md5",
|
||||
|
||||
});
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
QString target2 = TestBinDir + "TestQMLWidgets";
|
||||
QString target3 = TestBinDir + "QtWidgetsProject";
|
||||
|
||||
#else
|
||||
QString target2 = TestBinDir + "TestQMLWidgets.exe";
|
||||
QString target3 = TestBinDir + "QtWidgetsProject.exe";
|
||||
|
||||
#endif
|
||||
bin = target1;
|
||||
QString bin = target1;
|
||||
bin += "," + target2;
|
||||
bin += "," + target3;
|
||||
|
||||
auto packageString = "/package1/;" + QFileInfo(target1).absoluteFilePath() + ",/package2/;" + QFileInfo(target2).absoluteFilePath();
|
||||
runTestParams({"-bin", bin, "force-clear",
|
||||
"-binOut", "/lol",
|
||||
"-libOut", "/lolLib",
|
||||
"-trOut", "/lolTr",
|
||||
"-pluginOut", "/p",
|
||||
"-qmlOut", "/q",
|
||||
"-qmlDir", "package2;" + TestBinDir + "/../TestQMLWidgets",
|
||||
"-targetPackage", packageString,
|
||||
"qif", "qifFromSystem"}, &comapareTreeMulti, true);
|
||||
}
|
||||
@ -653,7 +549,7 @@ void deploytest::testQIFCustom() {
|
||||
TestUtils utils;
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "QtWidgetsProject" + "," + TestBinDir + "TestOnlyC";
|
||||
QString bin = TestBinDir + "TestCPPOnly" + "," + TestBinDir + "TestOnlyC";
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake";
|
||||
|
||||
@ -663,7 +559,7 @@ void deploytest::testQIFCustom() {
|
||||
|
||||
});
|
||||
#else
|
||||
QString bin = TestBinDir + "QtWidgetsProject.exe" + "," + TestBinDir + "TestOnlyC.exe";
|
||||
QString bin = TestBinDir + "TestCPPOnly.exe" + "," + TestBinDir + "TestOnlyC.exe";
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake.exe";
|
||||
auto comapareTreeCustom = utils.createTree({
|
||||
@ -675,7 +571,6 @@ void deploytest::testQIFCustom() {
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"-qmlDir", TestBinDir + "/../TestQMLWidgets",
|
||||
"-qif", TestBinDir + "/../../UnitTests/testRes/QIFCustomTemplate",
|
||||
"-name", "org.qtproject.ifw.example.stylesheet",
|
||||
"qifFromSystem"}, &comapareTreeCustom, true);
|
||||
@ -687,30 +582,21 @@ void deploytest::testZIP() {
|
||||
TestUtils utils;
|
||||
|
||||
auto comapareTree = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.zip",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.zip.md5",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.zip",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.zip.md5",
|
||||
});
|
||||
|
||||
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "TestQMLWidgets";
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake";
|
||||
|
||||
QString bin = TestBinDir + "TestOnlyC";
|
||||
#else
|
||||
QString bin = TestBinDir + "TestQMLWidgets.exe";
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake.exe";
|
||||
|
||||
QString bin = TestBinDir + "TestOnlyC.exe";
|
||||
#endif
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"-qmlDir", TestBinDir + "/../TestQMLWidgets",
|
||||
"zip", "verbose"}, &comapareTree, true);
|
||||
|
||||
|
||||
// test clear for zip
|
||||
runTestParams({"clear", "verbose"}, nullptr, true);
|
||||
|
||||
@ -720,42 +606,26 @@ void deploytest::testZIPMulti() {
|
||||
TestUtils utils;
|
||||
|
||||
auto comapareTreeMulti = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.zip",
|
||||
"./" + DISTRO_DIR + "/package1.zip",
|
||||
"./" + DISTRO_DIR + "/package2.zip",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.zip.md5",
|
||||
"./" + DISTRO_DIR + "/package1.zip.md5",
|
||||
"./" + DISTRO_DIR + "/package2.zip.md5",
|
||||
|
||||
});
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "TestQMLWidgets";
|
||||
QString target1 = TestBinDir + "TestOnlyC";
|
||||
|
||||
QString target2 = TestBinDir + "TestQMLWidgets";
|
||||
QString target3 = TestBinDir + "QtWidgetsProject";
|
||||
QString target1 = TestBinDir + "TestCPPOnly";
|
||||
QString target2 = TestBinDir + "TestOnlyC";
|
||||
|
||||
#else
|
||||
QString target2 = TestBinDir + "TestQMLWidgets.exe";
|
||||
QString target3 = TestBinDir + "QtWidgetsProject.exe";
|
||||
QString bin = TestBinDir + "TestQMLWidgets.exe";
|
||||
QString target1 = TestBinDir + "TestOnlyC.exe";
|
||||
|
||||
|
||||
QString target1 = TestBinDir + "TestCPPOnly.exe";
|
||||
QString target2 = TestBinDir + "TestOnlyC.exe";
|
||||
#endif
|
||||
bin = target1;
|
||||
QString bin = target1;
|
||||
bin += "," + target2;
|
||||
bin += "," + target3;
|
||||
|
||||
auto packageString = "/package1/;" + QFileInfo(target1).absoluteFilePath() + ",/package2/;" + QFileInfo(target2).absoluteFilePath();
|
||||
runTestParams({"-bin", bin, "force-clear",
|
||||
"-binOut", "/lol",
|
||||
"-libOut", "/lolLib",
|
||||
"-trOut", "/lolTr",
|
||||
"-pluginOut", "/p",
|
||||
"-qmlOut", "/q",
|
||||
"-qmlDir", "package2;" + TestBinDir + "/../TestQMLWidgets",
|
||||
"-targetPackage", packageString,
|
||||
"zip"}, &comapareTreeMulti, true);
|
||||
}
|
||||
@ -766,19 +636,15 @@ void deploytest::testDEB() {
|
||||
TestUtils utils;
|
||||
|
||||
auto comapareTree = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.deb",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.deb.md5",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.deb",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.deb.md5",
|
||||
|
||||
});
|
||||
|
||||
|
||||
QString bin = TestBinDir + "TestQMLWidgets";
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake";
|
||||
QString bin = TestBinDir + "TestOnlyC";
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"-qmlDir", TestBinDir + "/../TestQMLWidgets",
|
||||
"deb", "verbose"}, &comapareTree, true);
|
||||
|
||||
// test clear for deb
|
||||
@ -793,33 +659,22 @@ void deploytest::testDEBMulti() {
|
||||
TestUtils utils;
|
||||
|
||||
auto comapareTreeMulti = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.deb",
|
||||
"./" + DISTRO_DIR + "/package1.deb",
|
||||
"./" + DISTRO_DIR + "/package2.deb",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.deb.md5",
|
||||
"./" + DISTRO_DIR + "/package1.deb.md5",
|
||||
"./" + DISTRO_DIR + "/package2.deb.md5",
|
||||
|
||||
});
|
||||
|
||||
QString bin = TestBinDir + "TestQMLWidgets";
|
||||
QString target1 = TestBinDir + "TestOnlyC";
|
||||
QString target1 = TestBinDir + "TestCPPOnly";
|
||||
|
||||
QString target2 = TestBinDir + "TestQMLWidgets";
|
||||
QString target3 = TestBinDir + "QtWidgetsProject";
|
||||
QString target2 = TestBinDir + "TestOnlyC";
|
||||
|
||||
bin = target1;
|
||||
QString bin = target1;
|
||||
bin += "," + target2;
|
||||
bin += "," + target3;
|
||||
|
||||
auto packageString = "/package1/;" + QFileInfo(target1).absoluteFilePath() + ",/package2/;" + QFileInfo(target2).absoluteFilePath();
|
||||
runTestParams({"-bin", bin, "force-clear",
|
||||
"-binOut", "/lol",
|
||||
"-libOut", "/lolLib",
|
||||
"-trOut", "/lolTr",
|
||||
"-pluginOut", "/p",
|
||||
"-qmlOut", "/q",
|
||||
"-qmlDir", "package2;" + TestBinDir + "/../TestQMLWidgets",
|
||||
"-targetPackage", packageString,
|
||||
"deb"}, &comapareTreeMulti, true);
|
||||
#endif
|
||||
@ -830,9 +685,7 @@ void deploytest::testDEBCustom() {
|
||||
|
||||
TestUtils utils;
|
||||
|
||||
QString bin = TestBinDir + "TestQMLWidgets";
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake";
|
||||
QString bin = TestBinDir + "TestOnlyC";
|
||||
|
||||
auto comapareTreeCustom = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/chrome.deb",
|
||||
@ -841,8 +694,6 @@ void deploytest::testDEBCustom() {
|
||||
});
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"-qmlDir", TestBinDir + "/../TestQMLWidgets",
|
||||
"-deb", TestBinDir + "/../../UnitTests/testRes/DEBCustomTemplate",
|
||||
"-name", "chrome"},
|
||||
&comapareTreeCustom, true);
|
||||
@ -855,22 +706,18 @@ void deploytest::testMultiPacking() {
|
||||
#ifdef Q_OS_UNIX
|
||||
|
||||
auto comapareTree = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.zip",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.deb",
|
||||
"./" + DISTRO_DIR + "/InstallerTestQMLWidgets.run",
|
||||
"./" + DISTRO_DIR + "/InstallerTestQMLWidgets.run.md5",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.zip.md5",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.deb.md5",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.zip",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.deb",
|
||||
"./" + DISTRO_DIR + "/InstallerTestOnlyC.run",
|
||||
"./" + DISTRO_DIR + "/InstallerTestOnlyC.run.md5",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.zip.md5",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.deb.md5",
|
||||
|
||||
});
|
||||
|
||||
QString bin = TestBinDir + "TestQMLWidgets";
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake";
|
||||
QString bin = TestBinDir + "TestOnlyC";
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"-qmlDir", TestBinDir + "/../TestQMLWidgets",
|
||||
"zip",
|
||||
"qif", "qifFromSystem",
|
||||
"deb",
|
||||
@ -878,18 +725,14 @@ void deploytest::testMultiPacking() {
|
||||
|
||||
#else
|
||||
auto comapareTree = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.zip",
|
||||
"./" + DISTRO_DIR + "/InstallerTestQMLWidgets.exe",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.zip.md5",
|
||||
"./" + DISTRO_DIR + "/InstallerTestQMLWidgets.exe.md5",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.zip",
|
||||
"./" + DISTRO_DIR + "/InstallerTestOnlyC.exe",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.zip.md5",
|
||||
"./" + DISTRO_DIR + "/InstallerTestOnlyC.exe.md5",
|
||||
});
|
||||
QString bin = TestBinDir + "TestQMLWidgets.exe";
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake.exe";
|
||||
QString bin = TestBinDir + "TestOnlyC.exe";
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"-qmlDir", TestBinDir + "/../TestQMLWidgets",
|
||||
"zip",
|
||||
"qif", "qifFromSystem",
|
||||
"verbose"}, &comapareTree, true);
|
||||
@ -1120,46 +963,6 @@ void deploytest::testEmptyPackages() {
|
||||
"-libDir", TestQtDir + "bin",
|
||||
"-prefix", "package;prefix",
|
||||
"allowEmptyPackages"}, &comapareTree);
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
bin = TestBinDir + "QtWidgetsProject";
|
||||
|
||||
comapareTree = utils.createTree(
|
||||
{
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.zip",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.deb",
|
||||
"./" + DISTRO_DIR + "/InstallerQtWidgetsProject.run",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.zip.md5",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.deb.md5",
|
||||
"./" + DISTRO_DIR + "/InstallerQtWidgetsProject.run.md5",
|
||||
});
|
||||
|
||||
runTestParams({"-bin", bin, "force-clear",
|
||||
"-targetPackage", "/package/;NONE",
|
||||
"-prefix", "package;prefix",
|
||||
"allowEmptyPackages",
|
||||
"qif", "qifFromSystem",
|
||||
"zip",
|
||||
"deb"}, &comapareTree);
|
||||
#else
|
||||
bin = TestBinDir + "QtWidgetsProject.exe";
|
||||
|
||||
comapareTree = utils.createTree(
|
||||
{
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.zip",
|
||||
"./" + DISTRO_DIR + "/InstallerQtWidgetsProject.exe",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.zip.md5",
|
||||
"./" + DISTRO_DIR + "/InstallerQtWidgetsProject.exe.md5",
|
||||
});
|
||||
|
||||
runTestParams({"-bin", bin, "force-clear",
|
||||
"-targetPackage", "/package/;NONE",
|
||||
"-prefix", "package;prefix",
|
||||
"allowEmptyPackages",
|
||||
"qif", "qifFromSystem",
|
||||
"zip"
|
||||
}, &comapareTree);
|
||||
#endif
|
||||
}
|
||||
|
||||
void deploytest::testRunScripts() {
|
||||
@ -1212,7 +1015,7 @@ void deploytest::testOverridingDefaultTemplateDEB()
|
||||
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "TestOnlyC" + "," + TestBinDir + "QtWidgetsProject";
|
||||
QString bin = TestBinDir + "TestOnlyC" + "," + TestBinDir + "TestCPPOnly";
|
||||
QString qmake = TestQtDir + "bin/qmake";
|
||||
|
||||
QDir tempalteDir("temaplate");
|
||||
@ -1276,11 +1079,11 @@ void deploytest::testOverridingDefaultTemplateQIF() {
|
||||
TestUtils utils;
|
||||
// Prepare bin and qmake values
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "TestOnlyC" + "," + TestBinDir + "QtWidgetsProject";
|
||||
QString bin = TestBinDir + "TestOnlyC" + "," + TestBinDir + "TestCPPOnly";
|
||||
QString qmake = TestQtDir + "bin/qmake";
|
||||
|
||||
#else
|
||||
QString bin = TestBinDir + "TestOnlyC.exe" + "," + TestBinDir + "QtWidgetsProject.exe";
|
||||
QString bin = TestBinDir + "TestOnlyC.exe" + "," + TestBinDir + "TestCPPOnly.exe";
|
||||
QString qmake = TestQtDir + "bin/qmake.exe";
|
||||
|
||||
#endif
|
||||
@ -1430,13 +1233,11 @@ void deploytest::testIcons() {
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "TestOnlyC";
|
||||
QStringList binMulti = {TestBinDir + "TestOnlyC" , TestBinDir + "TestQMLWidgets",
|
||||
TestBinDir + "QtWidgetsProject"};
|
||||
QStringList binMulti = {TestBinDir + "TestOnlyC" , TestBinDir + "TestCPPOnly"};
|
||||
|
||||
#else
|
||||
QString bin = TestBinDir + "TestOnlyC.exe";
|
||||
QStringList binMulti = {TestBinDir + "TestOnlyC.exe" , TestBinDir + "TestQMLWidgets.exe",
|
||||
TestBinDir + "QtWidgetsProject.exe"};
|
||||
QStringList binMulti = {TestBinDir + "TestOnlyC.exe" , TestBinDir + "TestCPPOnly.exe"};
|
||||
|
||||
#endif
|
||||
|
||||
@ -2100,10 +1901,10 @@ void deploytest::testOverwriteWithPacking() {
|
||||
TestUtils utils;
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "TestOnlyC," + TestBinDir + "QtWidgetsProject";
|
||||
QString bin = TestBinDir + "TestOnlyC," + TestBinDir + "TestCPPOnly";
|
||||
|
||||
#else
|
||||
QString bin = TestBinDir + "TestOnlyC.exe," + TestBinDir + "QtWidgetsProject.exe";
|
||||
QString bin = TestBinDir + "TestOnlyC.exe," + TestBinDir + "TestCPPOnly.exe";
|
||||
|
||||
#endif
|
||||
#ifdef Q_OS_UNIX
|
||||
@ -2137,6 +1938,7 @@ void deploytest::testextraData() {
|
||||
#ifdef Q_OS_UNIX
|
||||
auto comapareTree = utils.createTree(
|
||||
{"./" + DISTRO_DIR + "/build/TestOnlyC",
|
||||
"./" + DISTRO_DIR + "/build/TestCPPOnly",
|
||||
"./" + DISTRO_DIR + "/build/QtWidgetsProject",
|
||||
"./" + DISTRO_DIR + "/build/TestQMLWidgets",
|
||||
"./" + DISTRO_DIR + "/build/basic",
|
||||
@ -2145,6 +1947,7 @@ void deploytest::testextraData() {
|
||||
#else
|
||||
auto comapareTree = utils.createTree(
|
||||
{"./" + DISTRO_DIR + "/build/TestOnlyC.exe",
|
||||
"./" + DISTRO_DIR + "/build/TestCPPOnly.exe",
|
||||
"./" + DISTRO_DIR + "/build/QtWidgetsProject.exe",
|
||||
"./" + DISTRO_DIR + "/build/TestQMLWidgets.exe",
|
||||
"./" + DISTRO_DIR + "/build/basic.exe"});
|
||||
@ -2175,54 +1978,39 @@ void deploytest::testConfFile() {
|
||||
auto comapareTree = utils.createTree(
|
||||
{"./" + DISTRO_DIR + "/bin/TestOnlyC",
|
||||
"./" + DISTRO_DIR + "/bin/qt.conf",
|
||||
"./" + DISTRO_DIR + "/bin/QtWidgetsProject",
|
||||
"./" + DISTRO_DIR + "/bin/TestQMLWidgets",
|
||||
"./" + DISTRO_DIR + "/bin/basic",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.sh",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.sh",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.sh",
|
||||
"./" + DISTRO_DIR + "/basic.sh"});
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.sh"});
|
||||
#else
|
||||
auto comapareTree = utils.createTree(
|
||||
{"./" + DISTRO_DIR + "/TestOnlyC.exe",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.bat",
|
||||
"./" + DISTRO_DIR + "/qt.conf",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.exe",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.bat",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.exe",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.bat",
|
||||
"./" + DISTRO_DIR + "/basic.exe",
|
||||
"./" + DISTRO_DIR + "/basic.bat",
|
||||
"./" + DISTRO_DIR + "/qt.conf"});
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
comapareTree += utils.createTree(
|
||||
{"./" + DISTRO_DIR + "/bin/quicknanobrowser",
|
||||
"./" + DISTRO_DIR + "/quicknanobrowser.sh",
|
||||
"./" + DISTRO_DIR + "/bin/webui",
|
||||
"./" + DISTRO_DIR + "/webui.sh"});
|
||||
#endif
|
||||
|
||||
runTestParams({"-bin", TestBinDir, "clear" , "noCheckRPATH", "noCheckPATH", "noQt",
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC", "clear" , "noCheckRPATH", "noCheckPATH", "noQt",
|
||||
"-confFile", TestBinDir + "/TestConf.json"}, &comapareTree);
|
||||
|
||||
|
||||
QVERIFY(QFile::exists(TestBinDir + "/TestConf.json"));
|
||||
QFile::remove(TestBinDir + "/TestConf.json");
|
||||
|
||||
comapareTree -= utils.createTree(
|
||||
{"./" + DISTRO_DIR + "/bin/quicknanobrowser",
|
||||
"./" + DISTRO_DIR + "/quicknanobrowser.sh",
|
||||
"./" + DISTRO_DIR + "/bin/webui",
|
||||
"./" + DISTRO_DIR + "/webui.sh"});
|
||||
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC," + TestBinDir + "QtWidgetsProject," + TestBinDir + "TestQMLWidgets",
|
||||
comapareTree += utils.createTree(
|
||||
{"./" + DISTRO_DIR + "/bin/TestCPPOnly",
|
||||
"./" + DISTRO_DIR + "/TestCPPOnly.sh"});
|
||||
#else
|
||||
comapareTree += utils.createTree(
|
||||
{"./" + DISTRO_DIR + "/bin/TestCPPOnly.exe",
|
||||
"./" + DISTRO_DIR + "/TestCPPOnly.bat"});
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC," + TestBinDir + "TestCPPOnly",
|
||||
"clear", "noCheckRPATH", "noCheckPATH", "noQt",
|
||||
"-confFile", TestBinDir + "/TestConf.json"}, &comapareTree);
|
||||
#else
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC.exe," + TestBinDir + "QtWidgetsProject.exe," + TestBinDir + "TestQMLWidgets.exe",
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC.exe," + TestBinDir + "TestCPPOnly.exe",
|
||||
"clear" , "-libDir", "L:/never/absalut/path", "noCheckPATH", "noQt",
|
||||
"-confFile", TestBinDir + "/TestConf.json"}, &comapareTree);
|
||||
#endif
|
||||
@ -2241,9 +2029,7 @@ void deploytest::testConfFile() {
|
||||
|
||||
QVERIFY(data.contains("\"bin\": ["));
|
||||
QVERIFY(data.contains("./TestOnlyC"));
|
||||
QVERIFY(data.contains("./QtWidgetsProject"));
|
||||
QVERIFY(data.contains("./TestQMLWidgets"));
|
||||
// QVERIFY(data.contains("\"libDir\": \"/never/absalut/path/\""));
|
||||
QVERIFY(data.contains("./TestCPPOnly"));
|
||||
|
||||
QVERIFY(data.contains("\"clear\": true"));
|
||||
|
||||
@ -2258,8 +2044,7 @@ void deploytest::testConfFile() {
|
||||
|
||||
QVERIFY(data.contains("\"bin\": ["));
|
||||
QVERIFY(data.contains("./TestOnlyC.exe"));
|
||||
QVERIFY(data.contains("./QtWidgetsProject.exe"));
|
||||
QVERIFY(data.contains("./TestQMLWidgets.exe"));
|
||||
QVERIFY(data.contains("./TestCPPOnly.exe"));
|
||||
QVERIFY(data.contains("\"libDir\": \"L:/never/absalut/path\""));
|
||||
|
||||
QVERIFY(data.contains("\"clear\": true"));
|
||||
@ -2280,11 +2065,11 @@ void deploytest::testConfFile() {
|
||||
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC," + TestBinDir + "QtWidgetsProject," + TestBinDir + "TestQMLWidgets",
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC," + TestBinDir + "TestCPPOnly",
|
||||
"clear" , "noCheckRPATH", "noCheckPATH", "noQt",
|
||||
"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"}, &comapareTree);
|
||||
#else
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC.exe," + TestBinDir + "QtWidgetsProject.exe," + TestBinDir + "TestQMLWidgets.exe",
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC.exe," + TestBinDir + "TestCPPOnly.exe",
|
||||
"clear" , "noCheckPATH", "noQt",
|
||||
"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"}, &comapareTree);
|
||||
#endif
|
||||
@ -2302,8 +2087,7 @@ void deploytest::testConfFile() {
|
||||
|
||||
QVERIFY(data.contains("\"bin\": ["));
|
||||
QVERIFY(data.contains("./../../../../../build/TestOnlyC"));
|
||||
QVERIFY(data.contains("./../../../../../build/QtWidgetsProject"));
|
||||
QVERIFY(data.contains("./../../../../../build/TestQMLWidgets"));
|
||||
QVERIFY(data.contains("./../../../../../build/TestCPPOnly"));
|
||||
|
||||
QVERIFY(data.contains("\"clear\": true"));
|
||||
QString qmake = TestQtDir + "bin/qmake";
|
||||
@ -2312,8 +2096,7 @@ void deploytest::testConfFile() {
|
||||
|
||||
QVERIFY(data.contains("\"bin\": ["));
|
||||
QVERIFY(data.contains("./../../../../../build/TestOnlyC.exe"));
|
||||
QVERIFY(data.contains("./../../../../../build/QtWidgetsProject.exe"));
|
||||
QVERIFY(data.contains("./../../../../../build/TestQMLWidgets.exe"));
|
||||
QVERIFY(data.contains("./../../../../../build/TestCPPOnly.exe"));
|
||||
|
||||
QVERIFY(data.contains("\"clear\": true"));
|
||||
QString qmake = TestQtDir + "bin/qmake.exe";
|
||||
@ -2324,17 +2107,6 @@ void deploytest::testConfFile() {
|
||||
QVERIFY(QuasarAppUtils::Params::isEndable("clear"));
|
||||
QVERIFY(QuasarAppUtils::Params::isEndable("bin"));
|
||||
|
||||
comapareTree += TestModule.qtLibs();
|
||||
comapareTree += TestModule.qmlLibs();
|
||||
|
||||
runTestParams({"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json",
|
||||
"-qmake", qmake,
|
||||
"-qmlDir", TestBinDir + "/../TestQMLWidgets",
|
||||
}, &comapareTree);
|
||||
|
||||
QVERIFY(QuasarAppUtils::Params::isEndable("clear"));
|
||||
QVERIFY(QuasarAppUtils::Params::isEndable("bin"));
|
||||
|
||||
QFile::remove(TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json");
|
||||
|
||||
// Test generar string in confFile
|
||||
|
10
tests/TestCPPOnly/TestCPPOnly.pro
Normal file
10
tests/TestCPPOnly/TestCPPOnly.pro
Normal file
@ -0,0 +1,10 @@
|
||||
TEMPLATE = app
|
||||
CONFIG += console c++11
|
||||
CONFIG -= app_bundle
|
||||
CONFIG -= qt
|
||||
CONFIG += release
|
||||
|
||||
SOURCES += \
|
||||
main.cpp
|
||||
|
||||
DESTDIR="$$PWD/../build"
|
5
tests/TestCPPOnly/conf.qrc
Normal file
5
tests/TestCPPOnly/conf.qrc
Normal file
@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/qt/etc">
|
||||
<file>qt.conf</file>
|
||||
</qresource>
|
||||
</RCC>
|
9
tests/TestCPPOnly/main.cpp
Normal file
9
tests/TestCPPOnly/main.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
cout << "TEST DONE (ONLY_C)" << endl;
|
||||
return 0;
|
||||
}
|
0
tests/TestCPPOnly/qt.conf
Normal file
0
tests/TestCPPOnly/qt.conf
Normal file
Loading…
x
Reference in New Issue
Block a user