summaryrefslogtreecommitdiffstats
path: root/tests/packagecreator/tst_packagecreator.cpp
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@pelagicore.com>2016-09-26 02:35:54 +0200
committerRobert Griebl <robert.griebl@pelagicore.com>2016-10-17 21:43:52 +0000
commit21ae572d2152bd52096aef759534a803b98eb50d (patch)
treee8c7c6c4136f8348f312c0f450c3932e07df9a18 /tests/packagecreator/tst_packagecreator.cpp
parentd475d73d9f292cf26e6cd1c6284a0da3efd69d09 (diff)
Reimplemented build-system as a real Qt module
This should help with doc generation and actually running the unit-tests in the CI system. Please note that the binaries are now installed into $$[QT_INSTALL_BINS] Change-Id: I6f27ba39f8e5d923e1aeff550ba11c1fbd8ac5cf Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'tests/packagecreator/tst_packagecreator.cpp')
-rw-r--r--tests/packagecreator/tst_packagecreator.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/packagecreator/tst_packagecreator.cpp b/tests/packagecreator/tst_packagecreator.cpp
index 9450df15..942b535f 100644
--- a/tests/packagecreator/tst_packagecreator.cpp
+++ b/tests/packagecreator/tst_packagecreator.cpp
@@ -35,6 +35,7 @@
#include "../error-checking.h"
+AM_USE_NAMESPACE
class tst_PackageCreator : public QObject
{
@@ -61,12 +62,13 @@ tst_PackageCreator::tst_PackageCreator()
void tst_PackageCreator::initTestCase()
{
// check if tar command is available at all
-
QProcess tar;
tar.start(qSL("tar"), { qSL("--version") });
m_tarAvailable = tar.waitForStarted(3000)
&& tar.waitForFinished(3000)
&& (tar.exitStatus() == QProcess::NormalExit);
+
+ QVERIFY(checkCorrectLocale());
}
void tst_PackageCreator::createAndVerify_data()
@@ -111,7 +113,7 @@ void tst_PackageCreator::createAndVerify()
QSKIP("No tar command found in PATH - skipping the verification part of the test!");
QProcess tar;
- tar.start(qSL("tar"), { qSL("-taf"), output.fileName() });
+ tar.start(qSL("tar"), { qSL("-tzf"), output.fileName() });
QVERIFY2(tar.waitForStarted(3000) &&
tar.waitForFinished(3000) &&
(tar.exitStatus() == QProcess::NormalExit) &&
@@ -130,7 +132,7 @@ void tst_PackageCreator::createAndVerify()
QVERIFY2(src.open(QFile::ReadOnly), qPrintable(src.errorString()));
QByteArray data = src.readAll();
- tar.start(qSL("tar"), { qSL("-xaOf"), output.fileName(), file });
+ tar.start(qSL("tar"), { qSL("-xzOf"), output.fileName(), file });
QVERIFY2(tar.waitForStarted(3000) &&
tar.waitForFinished(3000) &&
(tar.exitStatus() == QProcess::NormalExit) &&
@@ -140,6 +142,14 @@ void tst_PackageCreator::createAndVerify()
}
}
-QTEST_GUILESS_MAIN(tst_PackageCreator)
+int main(int argc, char *argv[])
+{
+ ensureCorrectLocale();
+ QCoreApplication app(argc, argv);
+ app.setAttribute(Qt::AA_Use96Dpi, true);
+ tst_PackageCreator tc;
+ QTEST_SET_MAIN_SOURCE_PATH
+ return QTest::qExec(&tc, argc, argv);
+}
#include "tst_packagecreator.moc"