Refactoring AbstractTest::Run.

To be able to see more appropriate warnings we should compare only exit codes.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-11-04 15:15:11 +02:00
parent e6c85fa47a
commit 4c3f65b0ab
4 changed files with 42 additions and 103 deletions

View File

@ -99,8 +99,7 @@ QString AbstractTest::TranslationsPath() const
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
bool AbstractTest::Run(bool showWarn, int exit, int &exitCode, const QString &program, const QStringList &arguments, int AbstractTest::Run(int exit, const QString &program, const QStringList &arguments, int msecs)
int msecs)
{ {
const QString parameters = QString("Program: %1 \nArguments: %2.").arg(program).arg(arguments.join(", ")); const QString parameters = QString("Program: %1 \nArguments: %2.").arg(program).arg(arguments.join(", "));
@ -109,8 +108,7 @@ bool AbstractTest::Run(bool showWarn, int exit, int &exitCode, const QString &pr
{ {
const QString msg = QString("Can't find binary.\n%1").arg(parameters); const QString msg = QString("Can't find binary.\n%1").arg(parameters);
QWARN(qUtf8Printable(msg)); QWARN(qUtf8Printable(msg));
exitCode = TST_EX_BIN; return TST_EX_BIN;
return false;
} }
QScopedPointer<QProcess> process(new QProcess()); QScopedPointer<QProcess> process(new QProcess());
@ -121,9 +119,8 @@ bool AbstractTest::Run(bool showWarn, int exit, int &exitCode, const QString &pr
{ {
const QString msg = QString("The operation timed out or an error occurred.\n%1").arg(parameters); const QString msg = QString("The operation timed out or an error occurred.\n%1").arg(parameters);
QWARN(qUtf8Printable(msg)); QWARN(qUtf8Printable(msg));
exitCode = TST_EX_TIME_OUT;
process->kill(); process->kill();
return false; return TST_EX_TIME_OUT;
} }
if (process->exitStatus() == QProcess::CrashExit) if (process->exitStatus() == QProcess::CrashExit)
@ -131,23 +128,17 @@ bool AbstractTest::Run(bool showWarn, int exit, int &exitCode, const QString &pr
const QString msg = QString("Program crashed.\n%1\n%2").arg(parameters) const QString msg = QString("Program crashed.\n%1\n%2").arg(parameters)
.arg(QString(process->readAllStandardError())); .arg(QString(process->readAllStandardError()));
QWARN(qUtf8Printable(msg)); QWARN(qUtf8Printable(msg));
exitCode = TST_EX_CRASH; return TST_EX_CRASH;
return false;
} }
if (process->exitCode() != V_EX_OK) if (process->exitCode() != exit)
{ {
if (showWarn || process->exitCode() != exit) const QString msg = QString("Unexpected finish.\n%1").arg(QString(process->readAllStandardError()));
{ QWARN(qUtf8Printable(msg));
const QString msg = QString("\n%1").arg(QString(process->readAllStandardError())); return process->exitCode();
QWARN(qUtf8Printable(msg));
}
exitCode = process->exitCode();
return false;
} }
exitCode = process->exitCode(); return process->exitCode();
return true;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -69,8 +69,7 @@ protected:
QString TapePath() const; QString TapePath() const;
QString TranslationsPath() const; QString TranslationsPath() const;
bool Run(bool showWarn, int exit, int &exitCode, const QString &program, const QStringList &arguments, int Run(int exit, const QString &program, const QStringList &arguments, int msecs = 30000);
int msecs = 30000);
bool CopyRecursively(const QString &srcFilePath, const QString &tgtFilePath) const; bool CopyRecursively(const QString &srcFilePath, const QString &tgtFilePath) const;
}; };

View File

@ -59,68 +59,52 @@ void TST_TapeCommandLine::initTestCase()
void TST_TapeCommandLine::OpenMeasurements_data() const void TST_TapeCommandLine::OpenMeasurements_data() const
{ {
QTest::addColumn<QString>("file"); QTest::addColumn<QString>("file");
QTest::addColumn<bool>("result");
QTest::addColumn<int>("exitCode"); QTest::addColumn<int>("exitCode");
// The file doesn't exist! // The file doesn't exist!
QTest::newRow("Send wrong path to a file") << "wrongPath.vit" QTest::newRow("Send wrong path to a file") << "wrongPath.vit"
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
QTest::newRow("Old individual format to new version") << "keiko.vit" QTest::newRow("Old individual format to new version") << "keiko.vit"
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Open empty file") << "empty.vit" QTest::newRow("Open empty file") << "empty.vit"
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Open the VIT file with all know measurements (v0.3.0)") << "all_measurements_v0.3.0.vit" QTest::newRow("Open the VIT file with all know measurements (v0.3.0)") << "all_measurements_v0.3.0.vit"
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Open the VST file with all know measurements (v0.4.0)") << "all_measurements_v0.4.0.vst" QTest::newRow("Open the VST file with all know measurements (v0.4.0)") << "all_measurements_v0.4.0.vst"
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Open the VST file for man ru GOST (v0.3.0).") << "GOST_man_ru_v0.3.0.vst" QTest::newRow("Open the VST file for man ru GOST (v0.3.0).") << "GOST_man_ru_v0.3.0.vst"
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Open the VIT file with all know measurements (v0.3.3)") << "all_measurements_v0.3.3.vit" QTest::newRow("Open the VIT file with all know measurements (v0.3.3)") << "all_measurements_v0.3.3.vit"
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Open the VST file with all know measurements (v0.4.2)") << "all_measurements_v0.4.2.vst" QTest::newRow("Open the VST file with all know measurements (v0.4.2)") << "all_measurements_v0.4.2.vst"
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Open the VST file for man ru GOST (v0.4.2).") << "GOST_man_ru_v0.4.2.vst" QTest::newRow("Open the VST file for man ru GOST (v0.4.2).") << "GOST_man_ru_v0.4.2.vst"
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Broken file. Not unique name.") << "broken1.vit" QTest::newRow("Broken file. Not unique name.") << "broken1.vit"
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
QTest::newRow("Broken file. Measurement name can't be empty.") << "broken1.vit" QTest::newRow("Broken file. Measurement name can't be empty.") << "broken1.vit"
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
QTest::newRow("Broken file. An empty value shouldn't break a file.") << "broken3.vit" QTest::newRow("Broken file. An empty value shouldn't break a file.") << "broken3.vit"
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Broken file. Invalid measurement name.") << "broken4.vit" QTest::newRow("Broken file. Invalid measurement name.") << "broken4.vit"
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
QTest::newRow("Empty text VIT file.") << "text.vit" QTest::newRow("Empty text VIT file.") << "text.vit"
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
QTest::newRow("Empty text VST file.") << "text.vst" QTest::newRow("Empty text VST file.") << "text.vst"
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
} }
@ -128,15 +112,12 @@ void TST_TapeCommandLine::OpenMeasurements_data() const
void TST_TapeCommandLine::OpenMeasurements() void TST_TapeCommandLine::OpenMeasurements()
{ {
QFETCH(QString, file); QFETCH(QString, file);
QFETCH(bool, result);
QFETCH(int, exitCode); QFETCH(int, exitCode);
int exit; const int exit = Run(exitCode, TapePath(), QStringList() << "--test"
const bool res = Run(result, exitCode, exit, TapePath(), QStringList() << "--test" << QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder + QDir::separator() +
<< QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder + QDir::separator() +
file); file);
QCOMPARE(res, result);
QCOMPARE(exit, exitCode); QCOMPARE(exit, exitCode);
} }

View File

@ -79,24 +79,19 @@ void TST_ValentinaCommandLine::initTestCase()
void TST_ValentinaCommandLine::OpenPatterns_data() const void TST_ValentinaCommandLine::OpenPatterns_data() const
{ {
QTest::addColumn<QString>("file"); QTest::addColumn<QString>("file");
QTest::addColumn<bool>("result");
QTest::addColumn<int>("exitCode"); QTest::addColumn<int>("exitCode");
// The file doesn't exist! // The file doesn't exist!
QTest::newRow("Send wrong path to a file") << "wrongPath.val" QTest::newRow("Send wrong path to a file") << "wrongPath.val"
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
QTest::newRow("Measurement independent empty file") << "empty.val" QTest::newRow("Measurement independent empty file") << "empty.val"
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("File with invalid object type") << "wrong_obj_type.val" QTest::newRow("File with invalid object type") << "wrong_obj_type.val"
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
QTest::newRow("Empty text VAL file") << "txt.val" QTest::newRow("Empty text VAL file") << "txt.val"
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
} }
@ -105,15 +100,12 @@ void TST_ValentinaCommandLine::OpenPatterns_data() const
void TST_ValentinaCommandLine::OpenPatterns() void TST_ValentinaCommandLine::OpenPatterns()
{ {
QFETCH(QString, file); QFETCH(QString, file);
QFETCH(bool, result);
QFETCH(int, exitCode); QFETCH(int, exitCode);
int exit;
const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder; const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder;
const bool res = Run(result, exitCode, exit, ValentinaPath(), QStringList() << "--test" const int exit = Run(exitCode, ValentinaPath(), QStringList() << "--test"
<< tmp + QDir::separator() + file); << tmp + QDir::separator() + file);
QCOMPARE(res, result);
QCOMPARE(exit, exitCode); QCOMPARE(exit, exitCode);
} }
@ -123,38 +115,32 @@ void TST_ValentinaCommandLine::ExportMode_data() const
{ {
QTest::addColumn<QString>("file"); QTest::addColumn<QString>("file");
QTest::addColumn<QString>("arguments"); QTest::addColumn<QString>("arguments");
QTest::addColumn<bool>("result");
QTest::addColumn<int>("exitCode"); QTest::addColumn<int>("exitCode");
const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder; const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder;
QTest::newRow("Issue #372")<< "issue_372.val" QTest::newRow("Issue #372")<< "issue_372.val"
<< QString("-p;;0;;-d;;%1;;-b;;output").arg(tmp) << QString("-p;;0;;-d;;%1;;-b;;output").arg(tmp)
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("A file with limited gradation. Standard measurements. Wrong data.") QTest::newRow("A file with limited gradation. Standard measurements. Wrong data.")
<< "glimited_vst.val" << "glimited_vst.val"
<< QString("-p;;0;;-d;;%1;;--gsize;;46;;--gheight;;164;;-b;;output").arg(tmp) << QString("-p;;0;;-d;;%1;;--gsize;;46;;--gheight;;164;;-b;;output").arg(tmp)
<< false
<< V_EX_DATAERR; << V_EX_DATAERR;
QTest::newRow("A file with limited gradation. Standard measurements. Correct data.") QTest::newRow("A file with limited gradation. Standard measurements. Correct data.")
<< "glimited_vst.val" << "glimited_vst.val"
<< QString("-p;;0;;-d;;%1;;--gsize;;40;;--gheight;;134;;-b;;output").arg(tmp) << QString("-p;;0;;-d;;%1;;--gsize;;40;;--gheight;;134;;-b;;output").arg(tmp)
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("A file with limited gradation. Individual measurements.") QTest::newRow("A file with limited gradation. Individual measurements.")
<< "glimited_vit.val" << "glimited_vit.val"
<< QString("-p;;0;;-d;;%1;;--gsize;;40;;--gheight;;134;;-b;;output").arg(tmp) << QString("-p;;0;;-d;;%1;;--gsize;;40;;--gheight;;134;;-b;;output").arg(tmp)
<< false
<< V_EX_DATAERR; << V_EX_DATAERR;
QTest::newRow("A file with limited gradation. No measurements.") QTest::newRow("A file with limited gradation. No measurements.")
<< "glimited_no_m.val" << "glimited_no_m.val"
<< QString("-p;;0;;-d;;%1;;--gsize;;40;;--gheight;;134;;-b;;output").arg(tmp) << QString("-p;;0;;-d;;%1;;--gsize;;40;;--gheight;;134;;-b;;output").arg(tmp)
<< false
<< V_EX_DATAERR; << V_EX_DATAERR;
} }
@ -164,16 +150,13 @@ void TST_ValentinaCommandLine::ExportMode()
{ {
QFETCH(QString, file); QFETCH(QString, file);
QFETCH(QString, arguments); QFETCH(QString, arguments);
QFETCH(bool, result);
QFETCH(int, exitCode); QFETCH(int, exitCode);
int exit;
const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder; const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder;
const QStringList arg = QStringList() << tmp + QDir::separator() + file const QStringList arg = QStringList() << tmp + QDir::separator() + file
<< arguments.split(";;"); << arguments.split(";;");
const bool res = Run(result, exitCode, exit, ValentinaPath(), arg); const int exit = Run(exitCode, ValentinaPath(), arg);
QCOMPARE(res, result);
QCOMPARE(exit, exitCode); QCOMPARE(exit, exitCode);
} }
@ -182,48 +165,40 @@ void TST_ValentinaCommandLine::TestMode_data() const
{ {
QTest::addColumn<QString>("file"); QTest::addColumn<QString>("file");
QTest::addColumn<QString>("arguments"); QTest::addColumn<QString>("arguments");
QTest::addColumn<bool>("result");
QTest::addColumn<int>("exitCode"); QTest::addColumn<int>("exitCode");
const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder; const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder;
QTest::newRow("Issue #256. Correct path.")<< "issue_256.val" QTest::newRow("Issue #256. Correct path.")<< "issue_256.val"
<< QString("--test") << QString("--test")
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Issue #256. Wrong path.")<< "issue_256_wrong_path.vit" QTest::newRow("Issue #256. Wrong path.")<< "issue_256_wrong_path.vit"
<< QString("--test") << QString("--test")
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
QTest::newRow("Issue #256. Correct individual measurements.")<< "issue_256.val" QTest::newRow("Issue #256. Correct individual measurements.")<< "issue_256.val"
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() + << QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
QLatin1String("issue_256_correct.vit")) QLatin1String("issue_256_correct.vit"))
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Issue #256. Wrong individual measurements.")<< "issue_256.val" QTest::newRow("Issue #256. Wrong individual measurements.")<< "issue_256.val"
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() + << QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
QLatin1String("issue_256_wrong.vit")) QLatin1String("issue_256_wrong.vit"))
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
QTest::newRow("Issue #256. Correct standard measurements.")<< "issue_256.val" QTest::newRow("Issue #256. Correct standard measurements.")<< "issue_256.val"
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() + << QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
QLatin1String("issue_256_correct.vst")) QLatin1String("issue_256_correct.vst"))
<< true
<< V_EX_OK; << V_EX_OK;
QTest::newRow("Issue #256. Wrong standard measurements.")<< "issue_256.val" QTest::newRow("Issue #256. Wrong standard measurements.")<< "issue_256.val"
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() + << QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
QLatin1String("issue_256_wrong.vst")) QLatin1String("issue_256_wrong.vst"))
<< false
<< V_EX_NOINPUT; << V_EX_NOINPUT;
QTest::newRow("Wrong formula.")<< "wrong_formula.val" QTest::newRow("Wrong formula.")<< "wrong_formula.val"
<< QString("--test") << QString("--test")
<< false
<< V_EX_DATAERR; << V_EX_DATAERR;
} }
@ -232,16 +207,13 @@ void TST_ValentinaCommandLine::TestMode()
{ {
QFETCH(QString, file); QFETCH(QString, file);
QFETCH(QString, arguments); QFETCH(QString, arguments);
QFETCH(bool, result);
QFETCH(int, exitCode); QFETCH(int, exitCode);
int exit;
const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder; const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder;
const QStringList arg = QStringList() << tmp + QDir::separator() + file const QStringList arg = QStringList() << tmp + QDir::separator() + file
<< arguments.split(";;"); << arguments.split(";;");
const bool res = Run(result, exitCode, exit, ValentinaPath(), arg); const int exit = Run(exitCode, ValentinaPath(), arg);
QCOMPARE(res, result);
QCOMPARE(exit, exitCode); QCOMPARE(exit, exitCode);
} }
@ -250,43 +222,42 @@ void TST_ValentinaCommandLine::TestOpenCollection_data() const
{ {
QTest::addColumn<QString>("file"); QTest::addColumn<QString>("file");
QTest::addColumn<QString>("arguments"); QTest::addColumn<QString>("arguments");
QTest::addColumn<bool>("result");
QTest::addColumn<int>("exitCode"); QTest::addColumn<int>("exitCode");
const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestCollectionFolder; const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestCollectionFolder;
const QString testGOST = QString("--test;;-m;;%1").arg(tmp + QDir::separator() + QLatin1String("GOST_man_ru.vst")); const QString testGOST = QString("--test;;-m;;%1").arg(tmp + QDir::separator() + QLatin1String("GOST_man_ru.vst"));
const QString keyTest = QStringLiteral("--test"); const QString keyTest = QStringLiteral("--test");
QTest::newRow("bra") << "bra.val" << keyTest << true << V_EX_OK; QTest::newRow("bra") << "bra.val" << keyTest << V_EX_OK;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
Q_UNUSED(testGOST) Q_UNUSED(testGOST)
#else #else
QTest::newRow("jacketМ1_52-176") << "jacketМ1_52-176.val" << testGOST << true << V_EX_OK; 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 << true << 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 << true << 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 << true << 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 << true << 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 << true << 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 << true << 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 << true << 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 << true << V_EX_OK; QTest::newRow("pantsМ7") << "pantsМ7.val" << testGOST << V_EX_OK;
#endif #endif
QTest::newRow("TShirt_test") << "TShirt_test.val" << keyTest << true << V_EX_OK; QTest::newRow("TShirt_test") << "TShirt_test.val" << keyTest << V_EX_OK;
QTest::newRow("TestDart") << "TestDart.val" << keyTest << true << V_EX_OK; QTest::newRow("TestDart") << "TestDart.val" << keyTest << V_EX_OK;
QTest::newRow("MaleShirt") << "MaleShirt.val" << keyTest << true << V_EX_OK; QTest::newRow("MaleShirt") << "MaleShirt.val" << keyTest << V_EX_OK;
QTest::newRow("Trousers") << "Trousers.val" << keyTest << true << V_EX_OK; QTest::newRow("Trousers") << "Trousers.val" << keyTest << V_EX_OK;
QTest::newRow("Basic block women") << "Basic_block_women-2016.val" << keyTest << true << 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 << true << 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 << true << V_EX_OK; QTest::newRow("Steampunk_trousers") << "Steampunk_trousers.val" << keyTest << V_EX_OK;
#ifndef Q_OS_WIN #ifndef Q_OS_WIN
QTest::newRow("patrón_blusa") << "patrón_blusa.val" << keyTest << true << V_EX_OK; QTest::newRow("patrón_blusa") << "patrón_blusa.val" << keyTest << V_EX_OK;
QTest::newRow("PajamaTopWrap2") << "PajamaTopWrap2.val" << keyTest << true << V_EX_OK; QTest::newRow("PajamaTopWrap2") << "PajamaTopWrap2.val" << keyTest << V_EX_OK;
QTest::newRow("Keiko_skirt") << "Keiko_skirt.val" << keyTest << true << V_EX_OK; QTest::newRow("Keiko_skirt") << "Keiko_skirt.val" << keyTest << V_EX_OK;
QTest::newRow("pantalon_base_Eli") << "pantalon_base_Eli.val" << keyTest << true << V_EX_OK; QTest::newRow("pantalon_base_Eli") << "pantalon_base_Eli.val" << keyTest << V_EX_OK;
QTest::newRow("modell_2") << "modell_2.val" << keyTest << true << V_EX_OK; QTest::newRow("modell_2") << "modell_2.val" << keyTest << V_EX_OK;
QTest::newRow("IMK_Zhaketa") << "IMK_Zhaketa_poluprilegayuschego_silueta.val" << keyTest << true << 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 << true << 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 << true << V_EX_OK; QTest::newRow("0.7_Armhole_adjustment_0.10") << "0.7_Armhole_adjustment_0.10.val" << keyTest << V_EX_OK;
#endif #endif
// We have a problem with encoding in Windows when we try to open some files in terminal // We have a problem with encoding in Windows when we try to open some files in terminal
} }
@ -296,16 +267,13 @@ void TST_ValentinaCommandLine::TestOpenCollection()
{ {
QFETCH(QString, file); QFETCH(QString, file);
QFETCH(QString, arguments); QFETCH(QString, arguments);
QFETCH(bool, result);
QFETCH(int, exitCode); QFETCH(int, exitCode);
int exit;
const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestCollectionFolder; const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestCollectionFolder;
const QStringList arg = QStringList() << tmp + QDir::separator() + file const QStringList arg = QStringList() << tmp + QDir::separator() + file
<< arguments.split(";;"); << arguments.split(";;");
const bool res = Run(result, exitCode, exit, ValentinaPath(), arg); const int exit = Run(exitCode, ValentinaPath(), arg);
QCOMPARE(res, result);
QCOMPARE(exit, exitCode); QCOMPARE(exit, exitCode);
} }