mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-29 19:24:33 +00:00
added minimal tests of init CQtDeployer.json
This commit is contained in:
parent
f61d971de0
commit
e5796a7392
@ -68,9 +68,20 @@ bool ConfigParser::parseParams() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto path = QuasarAppUtils::Params::getStrArg("confFile");
|
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)) {
|
if (QFile::exists(path)) {
|
||||||
loadFromFile(path);
|
if (!loadFromFile(path)) {
|
||||||
|
QuasarAppUtils::Params::verboseLog("failed to parse " + path,
|
||||||
|
QuasarAppUtils::Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (DeployCore::getMode()) {
|
switch (DeployCore::getMode()) {
|
||||||
@ -527,7 +538,7 @@ bool ConfigParser::parseInfoMode() {
|
|||||||
bool ConfigParser::parseInitMode() {
|
bool ConfigParser::parseInitMode() {
|
||||||
|
|
||||||
QFile configFile(DEFAULT_COFIGURATION_FILE);
|
QFile configFile(DEFAULT_COFIGURATION_FILE);
|
||||||
QFile source("");
|
QFile source(":/Distro/Distributions/configures/InitConfiguration.json");
|
||||||
if (configFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
if (configFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
||||||
|
|
||||||
if (source.open(QIODevice::ReadOnly)) {
|
if (source.open(QIODevice::ReadOnly)) {
|
||||||
|
@ -136,6 +136,9 @@ private slots:
|
|||||||
// qif flags
|
// qif flags
|
||||||
void testQIF();
|
void testQIF();
|
||||||
|
|
||||||
|
// init flags
|
||||||
|
void testInit();
|
||||||
|
|
||||||
void testDependencyMap();
|
void testDependencyMap();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -622,6 +625,16 @@ void deploytest::testQIF() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void deploytest::testInit()
|
||||||
|
{
|
||||||
|
|
||||||
|
TestUtils utils;
|
||||||
|
|
||||||
|
runTestParams({"init"});
|
||||||
|
runTestParams({});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void deploytest::testDependencyMap() {
|
void deploytest::testDependencyMap() {
|
||||||
DependencyMap dep1, dep2, dep3;
|
DependencyMap dep1, dep2, dep3;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user