CQtDeployer/tests/units/linux/runscriptstest.cpp

62 lines
1.7 KiB
C++
Raw Normal View History

2022-08-10 16:46:14 +03:00
//#
2023-12-31 09:24:12 +01:00
//# Copyright (C) 2020-2024 QuasarApp.
2022-08-10 16:46:14 +03:00
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "runscriptstest.h"
2022-08-13 20:34:51 +03:00
#include "modules.h"
2022-08-10 16:46:14 +03:00
#include <configparser.h>
#include <dependenciesscanner.h>
#include <filemanager.h>
#include <packing.h>
#include <pluginsparser.h>
void RunScriptsTest::test() {
TestUtils utils;
auto comapareTree = TestModule.onlyC();
#ifdef Q_OS_UNIX
QString bin = TestBinDir + "TestOnlyC";
QFile f(":/testResurces/testRes/customRunScript.sh");
QVERIFY(f.open(QIODevice::ReadOnly));
auto etalonData = f.readAll();
f.close();
runTestParams({"-bin", bin,
"force-clear",
"-libOut", "lib",
"-runScript", "TestOnlyC;:/testResurces/testRes/customRunScript.sh"}, &comapareTree);
f.setFileName(DISTRO_DIR + "/TestOnlyC.sh");
QVERIFY(f.open(QIODevice::ReadOnly));
auto deployData = f.readAll();
QVERIFY(deployData == etalonData);
#else
QString bin = TestBinDir + "TestOnlyC.exe";
QFile f(":/testResurces/testRes/customRunScript.sh");
QVERIFY(f.open(QIODevice::ReadOnly));
auto etalonData = f.readAll();
f.close();
runTestParams({"-bin", bin,
"force-clear",
"-libOut", "lib",
"-runScript", "TestOnlyC.exe;:/testResurces/testRes/customRunScript.sh"}, nullptr);
f.setFileName(DISTRO_DIR + "/TestOnlyC.bat");
QVERIFY(f.open(QIODevice::ReadOnly));
auto deployData = f.readAll();
QVERIFY(deployData == etalonData);
#endif
}