CQtDeployer/tests/units/linux/ignoreenvtest.cpp

60 lines
1.3 KiB
C++
Raw Normal View History

2022-08-13 12:36:41 +03:00
//#
2023-12-31 09:24:12 +01:00
//# Copyright (C) 2020-2024 QuasarApp.
2022-08-13 12:36:41 +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 "ignoreenvtest.h"
#include <configparser.h>
#include <dependenciesscanner.h>
#include <filemanager.h>
#include <packing.h>
#include <pluginsparser.h>
void IgnoreEnvTest::test() {
Envirement env;
QDir("./testTree").removeRecursively();
QStringList ignoreTree = {
"./testTree/test",
"./testTree/",
"./testTree/test1/1",
"./testTree/test2/1/",
};
QStringList testTree = {
2022-10-05 17:05:38 +03:00
"./testTree/test/s",
"./testTree/s",
"./testTree/test1/1s",
"./testTree/test2/1/s",
2022-08-13 12:36:41 +03:00
};
2022-10-05 17:05:38 +03:00
deployTree(ignoreTree);
deployTree(testTree);
2022-08-13 12:36:41 +03:00
env.setIgnoreEnvList(ignoreTree);
env.addEnv(ignoreTree);
// must be empty becouse all pathes is ignored
QVERIFY(env.size() == 0);
env.addEnv(testTree);
// must be equals 4 becouse all pathes is not ignored
QVERIFY(env.size() == 4);
// try add dublicate
env.addEnv(testTree);
// must be equals 4 becouse all dublicates must be ignored
QVERIFY(env.size() == 4);
QVERIFY(QDir("./testTree").removeRecursively());
}