added minimal tests of init CQtDeployer.json

This commit is contained in:
Andrei Yankovich 2020-01-24 18:43:59 +03:00
parent f61d971de0
commit e5796a7392
2 changed files with 27 additions and 3 deletions

View File

@ -68,9 +68,20 @@ bool ConfigParser::parseParams() {
}
auto path = QuasarAppUtils::Params::getStrArg("confFile");
bool createFile = !QFile::exists(path);
bool createFile = !QFile::exists(path) &&
QuasarAppUtils::Params::isEndable("confFile");
if (path.isEmpty() &&
QuasarAppUtils::Params::customParamasSize() <= 0) {
path = DEFAULT_COFIGURATION_FILE;
}
if (QFile::exists(path)) {
loadFromFile(path);
if (!loadFromFile(path)) {
QuasarAppUtils::Params::verboseLog("failed to parse " + path,
QuasarAppUtils::Error);
return false;
}
}
switch (DeployCore::getMode()) {
@ -527,7 +538,7 @@ bool ConfigParser::parseInfoMode() {
bool ConfigParser::parseInitMode() {
QFile configFile(DEFAULT_COFIGURATION_FILE);
QFile source("");
QFile source(":/Distro/Distributions/configures/InitConfiguration.json");
if (configFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
if (source.open(QIODevice::ReadOnly)) {

View File

@ -136,6 +136,9 @@ private slots:
// qif flags
void testQIF();
// init flags
void testInit();
void testDependencyMap();
};
@ -622,6 +625,16 @@ void deploytest::testQIF() {
}
void deploytest::testInit()
{
TestUtils utils;
runTestParams({"init"});
runTestParams({});
}
void deploytest::testDependencyMap() {
DependencyMap dep1, dep2, dep3;