2015-10-04 14:20:12 +02:00
|
|
|
|
/************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** @file tst_valentinacommandline.cpp
|
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
|
** @date 4 10, 2015
|
|
|
|
|
**
|
|
|
|
|
** @brief
|
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2015-10-04 14:20:12 +02:00
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
|
** Copyright (C) 2015 Valentina project
|
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
|
**
|
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
** (at your option) any later version.
|
|
|
|
|
**
|
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
|
**
|
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
**
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "tst_valentinacommandline.h"
|
|
|
|
|
#include "../vmisc/vsysexits.h"
|
|
|
|
|
|
|
|
|
|
#include <QtTest>
|
2018-03-14 14:39:15 +01:00
|
|
|
|
#include <QGlobalStatic>
|
2015-10-04 14:20:12 +02:00
|
|
|
|
|
2018-03-14 14:39:15 +01:00
|
|
|
|
namespace
|
|
|
|
|
{
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, tmpTestFolder, (QLatin1String("tst_valentina_tmp")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, tmpTestCollectionFolder, (QLatin1String("tst_valentina_collection_tmp")))
|
|
|
|
|
}
|
2015-10-04 14:20:12 +02:00
|
|
|
|
|
|
|
|
|
TST_ValentinaCommandLine::TST_ValentinaCommandLine(QObject *parent)
|
|
|
|
|
:AbstractTest(parent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// cppcheck-suppress unusedFunction
|
2016-07-25 17:25:13 +02:00
|
|
|
|
void TST_ValentinaCommandLine::initTestCase()
|
2015-10-04 14:20:12 +02:00
|
|
|
|
{
|
2015-12-22 15:42:00 +01:00
|
|
|
|
{// Test files
|
2018-03-14 14:39:15 +01:00
|
|
|
|
QDir tmpDir(*tmpTestFolder);
|
2015-12-22 15:42:00 +01:00
|
|
|
|
if (not tmpDir.removeRecursively())
|
|
|
|
|
{
|
|
|
|
|
QFAIL("Fail to remove test temp directory.");
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-09 08:02:26 +02:00
|
|
|
|
if (not CopyRecursively(QCoreApplication::applicationDirPath() + QDir::separator() +
|
2016-07-20 10:39:15 +02:00
|
|
|
|
QLatin1String("tst_valentina"),
|
2018-03-14 14:39:15 +01:00
|
|
|
|
QCoreApplication::applicationDirPath() + QDir::separator() + *tmpTestFolder))
|
2015-12-22 15:42:00 +01:00
|
|
|
|
{
|
|
|
|
|
QFAIL("Fail to prepare test files for testing.");
|
|
|
|
|
}
|
2015-10-04 14:20:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
2015-12-22 15:42:00 +01:00
|
|
|
|
{// Collection
|
2018-03-14 14:39:15 +01:00
|
|
|
|
QDir tmpDir(*tmpTestCollectionFolder);
|
2015-12-22 15:42:00 +01:00
|
|
|
|
if (not tmpDir.removeRecursively())
|
|
|
|
|
{
|
|
|
|
|
QFAIL("Fail to remove collection temp directory.");
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-09 08:02:26 +02:00
|
|
|
|
if (not CopyRecursively(QCoreApplication::applicationDirPath() + QDir::separator() +
|
2016-07-20 10:39:15 +02:00
|
|
|
|
QLatin1String("tst_valentina_collection"),
|
2018-03-14 14:39:15 +01:00
|
|
|
|
QCoreApplication::applicationDirPath() + QDir::separator() + *tmpTestCollectionFolder))
|
2015-12-22 15:42:00 +01:00
|
|
|
|
{
|
|
|
|
|
QFAIL("Fail to prepare collection files for testing.");
|
|
|
|
|
}
|
2015-10-04 14:20:12 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// cppcheck-suppress unusedFunction
|
|
|
|
|
void TST_ValentinaCommandLine::OpenPatterns_data() const
|
|
|
|
|
{
|
|
|
|
|
QTest::addColumn<QString>("file");
|
2018-07-13 15:18:04 +02:00
|
|
|
|
QTest::addColumn<QString>("arguments");
|
2015-10-04 14:20:12 +02:00
|
|
|
|
QTest::addColumn<int>("exitCode");
|
|
|
|
|
|
|
|
|
|
// The file doesn't exist!
|
|
|
|
|
QTest::newRow("Send wrong path to a file") << "wrongPath.val"
|
2018-07-13 15:18:04 +02:00
|
|
|
|
<< "--test"
|
2015-10-04 14:20:12 +02:00
|
|
|
|
<< V_EX_NOINPUT;
|
|
|
|
|
|
|
|
|
|
QTest::newRow("Measurement independent empty file") << "empty.val"
|
2018-07-13 15:18:04 +02:00
|
|
|
|
<< "--test"
|
2015-10-04 14:20:12 +02:00
|
|
|
|
<< V_EX_OK;
|
2015-10-07 20:50:40 +02:00
|
|
|
|
|
|
|
|
|
QTest::newRow("File with invalid object type") << "wrong_obj_type.val"
|
2018-07-13 15:18:04 +02:00
|
|
|
|
<< "--test"
|
2015-10-07 20:50:40 +02:00
|
|
|
|
<< V_EX_NOINPUT;
|
2015-11-12 12:06:14 +01:00
|
|
|
|
|
|
|
|
|
QTest::newRow("Empty text VAL file") << "txt.val"
|
2018-07-13 15:18:04 +02:00
|
|
|
|
<< "--test"
|
2015-11-12 12:06:14 +01:00
|
|
|
|
<< V_EX_NOINPUT;
|
2018-07-13 15:18:04 +02:00
|
|
|
|
|
|
|
|
|
QTest::newRow("Pattern with a warning") << "test_pedantic.val"
|
|
|
|
|
<< "--test;;--pedantic"
|
|
|
|
|
<< V_EX_DATAERR;
|
2015-10-04 14:20:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// cppcheck-suppress unusedFunction
|
|
|
|
|
void TST_ValentinaCommandLine::OpenPatterns()
|
|
|
|
|
{
|
|
|
|
|
QFETCH(QString, file);
|
2018-07-13 15:18:04 +02:00
|
|
|
|
QFETCH(QString, arguments);
|
2015-10-04 14:20:12 +02:00
|
|
|
|
QFETCH(int, exitCode);
|
|
|
|
|
|
2016-12-03 09:20:45 +01:00
|
|
|
|
QString error;
|
2018-03-14 14:39:15 +01:00
|
|
|
|
const QString tmp = QCoreApplication::applicationDirPath() + QDir::separator() + *tmpTestFolder;
|
2018-07-13 15:18:04 +02:00
|
|
|
|
const int exit = Run(exitCode, ValentinaPath(), QStringList() << arguments.split(";;")
|
2016-12-03 09:20:45 +01:00
|
|
|
|
<< tmp + QDir::separator() + file, error);
|
2015-10-04 14:20:12 +02:00
|
|
|
|
|
2019-02-22 16:54:00 +01:00
|
|
|
|
QVERIFY2(exit == exitCode, qUtf8Printable(error.right(350)));
|
2015-10-04 14:20:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// cppcheck-suppress unusedFunction
|
|
|
|
|
void TST_ValentinaCommandLine::ExportMode_data() const
|
|
|
|
|
{
|
|
|
|
|
QTest::addColumn<QString>("file");
|
|
|
|
|
QTest::addColumn<QString>("arguments");
|
|
|
|
|
QTest::addColumn<int>("exitCode");
|
|
|
|
|
|
2018-03-14 14:39:15 +01:00
|
|
|
|
const QString tmp = QCoreApplication::applicationDirPath() + QDir::separator() + *tmpTestFolder;
|
2015-10-05 15:08:26 +02:00
|
|
|
|
|
2015-10-04 14:20:12 +02:00
|
|
|
|
QTest::newRow("Issue #372")<< "issue_372.val"
|
2019-04-03 12:30:29 +02:00
|
|
|
|
<< QString("-p;;0;;-d;;%1;;-b;;output;;--сoefficient;;1").arg(tmp)
|
2015-10-04 14:20:12 +02:00
|
|
|
|
<< V_EX_OK;
|
2015-12-10 11:19:31 +01:00
|
|
|
|
|
2017-07-12 20:21:48 +02:00
|
|
|
|
QTest::newRow("A file with limited gradation. Multisize measurements. Wrong data.")
|
2015-12-10 11:19:31 +01:00
|
|
|
|
<< "glimited_vst.val"
|
2019-04-03 12:30:29 +02:00
|
|
|
|
<< QString("-p;;0;;-d;;%1;;--gsize;;46;;--gheight;;164;;-b;;output;;--сoefficient;;1").arg(tmp)
|
2015-12-10 11:19:31 +01:00
|
|
|
|
<< V_EX_DATAERR;
|
|
|
|
|
|
2017-07-12 20:21:48 +02:00
|
|
|
|
QTest::newRow("A file with limited gradation. Multisize measurements. Correct data.")
|
2015-12-10 11:19:31 +01:00
|
|
|
|
<< "glimited_vst.val"
|
2019-04-03 12:30:29 +02:00
|
|
|
|
<< QString("-p;;0;;-d;;%1;;--gsize;;40;;--gheight;;134;;-b;;output;;--сoefficient;;1").arg(tmp)
|
2015-12-10 11:19:31 +01:00
|
|
|
|
<< V_EX_OK;
|
|
|
|
|
|
|
|
|
|
QTest::newRow("A file with limited gradation. Individual measurements.")
|
|
|
|
|
<< "glimited_vit.val"
|
2019-04-03 12:30:29 +02:00
|
|
|
|
<< QString("-p;;0;;-d;;%1;;--gsize;;40;;--gheight;;134;;-b;;output;;--сoefficient;;1").arg(tmp)
|
2015-12-10 11:19:31 +01:00
|
|
|
|
<< V_EX_DATAERR;
|
|
|
|
|
|
|
|
|
|
QTest::newRow("A file with limited gradation. No measurements.")
|
|
|
|
|
<< "glimited_no_m.val"
|
2019-04-03 12:30:29 +02:00
|
|
|
|
<< QString("-p;;0;;-d;;%1;;--gsize;;40;;--gheight;;134;;-b;;output;;--сoefficient;;1").arg(tmp)
|
2015-12-10 11:19:31 +01:00
|
|
|
|
<< V_EX_DATAERR;
|
2015-10-04 14:20:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// cppcheck-suppress unusedFunction
|
|
|
|
|
void TST_ValentinaCommandLine::ExportMode()
|
|
|
|
|
{
|
|
|
|
|
QFETCH(QString, file);
|
|
|
|
|
QFETCH(QString, arguments);
|
|
|
|
|
QFETCH(int, exitCode);
|
|
|
|
|
|
2016-12-03 09:20:45 +01:00
|
|
|
|
QString error;
|
2018-03-14 14:39:15 +01:00
|
|
|
|
const QString tmp = QCoreApplication::applicationDirPath() + QDir::separator() + *tmpTestFolder;
|
2015-12-22 15:42:00 +01:00
|
|
|
|
const QStringList arg = QStringList() << tmp + QDir::separator() + file
|
2015-12-22 14:29:16 +01:00
|
|
|
|
<< arguments.split(";;");
|
2016-12-03 09:20:45 +01:00
|
|
|
|
const int exit = Run(exitCode, ValentinaPath(), arg, error);
|
2015-12-22 14:29:16 +01:00
|
|
|
|
|
2019-02-22 16:54:00 +01:00
|
|
|
|
QVERIFY2(exit == exitCode, qUtf8Printable(error.right(350)));
|
2015-12-22 14:29:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void TST_ValentinaCommandLine::TestMode_data() const
|
|
|
|
|
{
|
|
|
|
|
QTest::addColumn<QString>("file");
|
|
|
|
|
QTest::addColumn<QString>("arguments");
|
|
|
|
|
QTest::addColumn<int>("exitCode");
|
|
|
|
|
|
2018-03-14 14:39:15 +01:00
|
|
|
|
const QString tmp = QCoreApplication::applicationDirPath() + QDir::separator() + *tmpTestFolder;
|
2015-12-22 14:29:16 +01:00
|
|
|
|
|
|
|
|
|
QTest::newRow("Issue #256. Correct path.")<< "issue_256.val"
|
|
|
|
|
<< QString("--test")
|
|
|
|
|
<< V_EX_OK;
|
|
|
|
|
|
|
|
|
|
QTest::newRow("Issue #256. Wrong path.")<< "issue_256_wrong_path.vit"
|
|
|
|
|
<< QString("--test")
|
|
|
|
|
<< V_EX_NOINPUT;
|
|
|
|
|
|
|
|
|
|
QTest::newRow("Issue #256. Correct individual measurements.")<< "issue_256.val"
|
|
|
|
|
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
|
2016-07-20 10:39:15 +02:00
|
|
|
|
QLatin1String("issue_256_correct.vit"))
|
2015-12-22 14:29:16 +01:00
|
|
|
|
<< V_EX_OK;
|
|
|
|
|
|
|
|
|
|
QTest::newRow("Issue #256. Wrong individual measurements.")<< "issue_256.val"
|
|
|
|
|
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
|
2016-07-20 10:39:15 +02:00
|
|
|
|
QLatin1String("issue_256_wrong.vit"))
|
2015-12-22 14:29:16 +01:00
|
|
|
|
<< V_EX_NOINPUT;
|
|
|
|
|
|
2017-07-12 20:21:48 +02:00
|
|
|
|
QTest::newRow("Issue #256. Correct multisize measurements.")<< "issue_256.val"
|
2015-12-22 14:29:16 +01:00
|
|
|
|
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
|
2016-07-20 10:39:15 +02:00
|
|
|
|
QLatin1String("issue_256_correct.vst"))
|
2015-12-22 14:29:16 +01:00
|
|
|
|
<< V_EX_OK;
|
|
|
|
|
|
2017-07-12 20:21:48 +02:00
|
|
|
|
QTest::newRow("Issue #256. Wrong multisize measurements.")<< "issue_256.val"
|
2015-12-22 14:29:16 +01:00
|
|
|
|
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
|
2016-07-20 10:39:15 +02:00
|
|
|
|
QLatin1String("issue_256_wrong.vst"))
|
2015-12-22 14:29:16 +01:00
|
|
|
|
<< V_EX_NOINPUT;
|
2015-12-22 19:12:09 +01:00
|
|
|
|
|
|
|
|
|
QTest::newRow("Wrong formula.")<< "wrong_formula.val"
|
|
|
|
|
<< QString("--test")
|
|
|
|
|
<< V_EX_DATAERR;
|
2015-12-22 14:29:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void TST_ValentinaCommandLine::TestMode()
|
|
|
|
|
{
|
|
|
|
|
QFETCH(QString, file);
|
|
|
|
|
QFETCH(QString, arguments);
|
|
|
|
|
QFETCH(int, exitCode);
|
|
|
|
|
|
2016-12-03 09:20:45 +01:00
|
|
|
|
QString error;
|
2018-03-14 14:39:15 +01:00
|
|
|
|
const QString tmp = QCoreApplication::applicationDirPath() + QDir::separator() + *tmpTestFolder;
|
2015-12-22 15:42:00 +01:00
|
|
|
|
const QStringList arg = QStringList() << tmp + QDir::separator() + file
|
|
|
|
|
<< arguments.split(";;");
|
2016-12-03 09:20:45 +01:00
|
|
|
|
const int exit = Run(exitCode, ValentinaPath(), arg, error);
|
2015-12-22 15:42:00 +01:00
|
|
|
|
|
2019-02-22 16:54:00 +01:00
|
|
|
|
QVERIFY2(exit == exitCode, qUtf8Printable(error.right(350)));
|
2015-12-22 15:42:00 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void TST_ValentinaCommandLine::TestOpenCollection_data() const
|
|
|
|
|
{
|
|
|
|
|
QTest::addColumn<QString>("file");
|
|
|
|
|
QTest::addColumn<QString>("arguments");
|
|
|
|
|
QTest::addColumn<int>("exitCode");
|
|
|
|
|
|
2018-03-14 14:39:15 +01:00
|
|
|
|
const QString tmp = QCoreApplication::applicationDirPath() + QDir::separator() + *tmpTestCollectionFolder;
|
2016-07-20 10:39:15 +02:00
|
|
|
|
const QString testGOST = QString("--test;;-m;;%1").arg(tmp + QDir::separator() + QLatin1String("GOST_man_ru.vst"));
|
2016-01-10 16:02:44 +01:00
|
|
|
|
const QString keyTest = QStringLiteral("--test");
|
|
|
|
|
|
2016-11-04 14:15:11 +01:00
|
|
|
|
QTest::newRow("bra") << "bra.val" << keyTest << V_EX_OK;
|
2016-05-19 14:22:27 +02:00
|
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
|
Q_UNUSED(testGOST)
|
|
|
|
|
#else
|
2016-11-04 14:15:11 +01:00
|
|
|
|
QTest::newRow("jacketМ1_52-176") << "jacketМ1_52-176.val" << testGOST << V_EX_OK;
|
|
|
|
|
QTest::newRow("jacketМ2_40-146") << "jacketМ2_40-146.val" << testGOST << V_EX_OK;
|
|
|
|
|
QTest::newRow("jacketМ3_40-146") << "jacketМ3_40-146.val" << testGOST << V_EX_OK;
|
|
|
|
|
QTest::newRow("jacketМ4_40-146") << "jacketМ4_40-146.val" << testGOST << V_EX_OK;
|
|
|
|
|
QTest::newRow("jacketМ5_30-110") << "jacketМ5_30-110.val" << testGOST << V_EX_OK;
|
|
|
|
|
QTest::newRow("jacketМ6_30-110") << "jacketМ6_30-110.val" << testGOST << V_EX_OK;
|
|
|
|
|
QTest::newRow("pantsМ1_52-176") << "pantsМ1_52-176.val" << testGOST << V_EX_OK;
|
|
|
|
|
QTest::newRow("pantsМ2_40-146") << "pantsМ2_40-146.val" << testGOST << V_EX_OK;
|
|
|
|
|
QTest::newRow("pantsМ7") << "pantsМ7.val" << testGOST << V_EX_OK;
|
2016-05-19 14:22:27 +02:00
|
|
|
|
#endif
|
2016-11-04 14:15:11 +01:00
|
|
|
|
QTest::newRow("TShirt_test") << "TShirt_test.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("TestDart") << "TestDart.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("MaleShirt") << "MaleShirt.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("Trousers") << "Trousers.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("Basic block women") << "Basic_block_women-2016.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("Gent Jacket with tummy") << "Gent_Jacket_with_tummy.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("Steampunk_trousers") << "Steampunk_trousers.val" << keyTest << V_EX_OK;
|
2016-06-01 20:59:34 +02:00
|
|
|
|
#ifndef Q_OS_WIN
|
2016-11-04 14:15:11 +01:00
|
|
|
|
QTest::newRow("patrón_blusa") << "patrón_blusa.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("PajamaTopWrap2") << "PajamaTopWrap2.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("Keiko_skirt") << "Keiko_skirt.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("pantalon_base_Eli") << "pantalon_base_Eli.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("modell_2") << "modell_2.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("IMK_Zhaketa") << "IMK_Zhaketa_poluprilegayuschego_silueta.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("Moulage_0.5_armhole_neckline") << "Moulage_0.5_armhole_neckline.val" << keyTest << V_EX_OK;
|
|
|
|
|
QTest::newRow("0.7_Armhole_adjustment_0.10") << "0.7_Armhole_adjustment_0.10.val" << keyTest << V_EX_OK;
|
2016-06-01 20:59:34 +02:00
|
|
|
|
#endif
|
2016-05-19 14:22:27 +02:00
|
|
|
|
// We have a problem with encoding in Windows when we try to open some files in terminal
|
2015-12-22 15:42:00 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void TST_ValentinaCommandLine::TestOpenCollection()
|
|
|
|
|
{
|
|
|
|
|
QFETCH(QString, file);
|
|
|
|
|
QFETCH(QString, arguments);
|
|
|
|
|
QFETCH(int, exitCode);
|
|
|
|
|
|
2016-12-03 09:20:45 +01:00
|
|
|
|
QString error;
|
2018-03-14 14:39:15 +01:00
|
|
|
|
const QString tmp = QCoreApplication::applicationDirPath() + QDir::separator() + *tmpTestCollectionFolder;
|
2015-12-22 15:42:00 +01:00
|
|
|
|
const QStringList arg = QStringList() << tmp + QDir::separator() + file
|
2015-10-04 14:20:12 +02:00
|
|
|
|
<< arguments.split(";;");
|
2016-12-03 09:20:45 +01:00
|
|
|
|
const int exit = Run(exitCode, ValentinaPath(), arg, error);
|
2015-10-04 14:20:12 +02:00
|
|
|
|
|
2019-02-22 16:54:00 +01:00
|
|
|
|
QVERIFY2(exit == exitCode, qUtf8Printable(error.right(350)));
|
2015-10-04 14:20:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// cppcheck-suppress unusedFunction
|
2016-07-25 17:25:13 +02:00
|
|
|
|
void TST_ValentinaCommandLine::cleanupTestCase()
|
2015-10-04 14:20:12 +02:00
|
|
|
|
{
|
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
QDir tmpDir(*tmpTestFolder);
|
2015-12-22 15:42:00 +01:00
|
|
|
|
if (not tmpDir.removeRecursively())
|
|
|
|
|
{
|
|
|
|
|
QWARN("Fail to remove test temp directory.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
QDir tmpDir(*tmpTestCollectionFolder);
|
2015-12-22 15:42:00 +01:00
|
|
|
|
if (not tmpDir.removeRecursively())
|
|
|
|
|
{
|
|
|
|
|
QWARN("Fail to remove collection temp directory.");
|
|
|
|
|
}
|
2015-10-04 14:20:12 +02:00
|
|
|
|
}
|
|
|
|
|
}
|