Test openning measurement files.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-09-28 13:42:26 +03:00
parent 25561858f0
commit e236757d57
10 changed files with 459 additions and 13 deletions

View File

@ -54,5 +54,5 @@ int main(int argc, char *argv[])
} }
app.InitOptions(); app.InitOptions();
app.ParseCommandLine(app.arguments()); app.ParseCommandLine(app.arguments());
return app.exec(); return app.IsTestMode() ? 0 : app.exec(); // single return point is always better than more
} }

View File

@ -99,7 +99,7 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
switch (type) switch (type)
{ {
case QtDebugMsg: case QtDebugMsg:
std::cerr << msg.toUtf8().constData() << std::endl; std::cout << msg.toUtf8().constData() << std::endl;
return; return;
case QtWarningMsg: case QtWarningMsg:
messageBox.setIcon(QMessageBox::Warning); messageBox.setIcon(QMessageBox::Warning);
@ -116,13 +116,20 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
if (type == QtWarningMsg || type == QtCriticalMsg || type == QtFatalMsg) if (type == QtWarningMsg || type == QtCriticalMsg || type == QtFatalMsg)
{ {
if (topWinAllowsPop) if (not qApp->IsTestMode())
{ {
messageBox.setInformativeText(msg); if (topWinAllowsPop)
messageBox.setStandardButtons(QMessageBox::Ok); {
messageBox.setWindowModality(Qt::ApplicationModal); messageBox.setInformativeText(msg);
messageBox.setModal(true); messageBox.setStandardButtons(QMessageBox::Ok);
messageBox.exec(); messageBox.setWindowModality(Qt::ApplicationModal);
messageBox.setModal(true);
messageBox.exec();
}
}
else
{
std::cerr << msg.toUtf8().constData() << std::endl;
} }
} }
@ -146,7 +153,8 @@ MApplication::MApplication(int &argc, char **argv)
mainWindows(), mainWindows(),
localServer(nullptr), localServer(nullptr),
trVars(nullptr), trVars(nullptr),
dataBase(QPointer<DialogMDataBase>()) dataBase(QPointer<DialogMDataBase>()),
testMode(false)
{ {
setApplicationDisplayName(VER_PRODUCTNAME_STR); setApplicationDisplayName(VER_PRODUCTNAME_STR);
setApplicationName(VER_INTERNALNAME_STR); setApplicationName(VER_INTERNALNAME_STR);
@ -256,6 +264,12 @@ bool MApplication::notify(QObject *receiver, QEvent *event)
return false; return false;
} }
//---------------------------------------------------------------------------------------------------------------------
bool MApplication::IsTestMode() const
{
return testMode;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
bool MApplication::IsTheOnly() const bool MApplication::IsTheOnly() const
{ {
@ -496,6 +510,11 @@ void MApplication::ParseCommandLine(const QStringList &arguments)
QCoreApplication::translate("main", "The pattern unit")); QCoreApplication::translate("main", "The pattern unit"));
parser.addOption(unitOption); parser.addOption(unitOption);
//----- //-----
QCommandLineOption testOption(QStringList() << "test",
QCoreApplication::translate("main", "Use for unit testing. Run the program and open a file without showing a "
"window."));
parser.addOption(testOption);
//-----
parser.process(arguments); parser.process(arguments);
bool flagHeight = false; bool flagHeight = false;
@ -568,9 +587,18 @@ void MApplication::ParseCommandLine(const QStringList &arguments)
} }
} }
testMode = parser.isSet(testOption);
const QStringList args = parser.positionalArguments(); const QStringList args = parser.positionalArguments();
if (args.count() > 0) if (args.count() > 0)
{ {
if (testMode && args.count() > 1)
{
fprintf(stderr, "%s\n", qPrintable(QCoreApplication::translate("main",
"Error: Test mode doesn't support openning several files.")));
parser.showHelp(1);
}
for (int i = 0; i < args.size(); ++i) for (int i = 0; i < args.size(); ++i)
{ {
NewMainWindow(); NewMainWindow();
@ -594,7 +622,10 @@ void MApplication::ParseCommandLine(const QStringList &arguments)
} }
else else
{ {
NewMainWindow(); if (not testMode)
{
NewMainWindow();
}
} }
} }
@ -629,7 +660,10 @@ TMainWindow *MApplication::NewMainWindow()
{ {
TMainWindow *tape = new TMainWindow(); TMainWindow *tape = new TMainWindow();
mainWindows.prepend(tape); mainWindows.prepend(tape);
tape->show(); if (not qApp->IsTestMode())
{
tape->show();
}
return tape; return tape;
} }

View File

@ -54,6 +54,7 @@ public:
virtual bool notify(QObject * receiver, QEvent * event) Q_DECL_OVERRIDE; virtual bool notify(QObject * receiver, QEvent * event) Q_DECL_OVERRIDE;
bool IsTestMode() const;
bool IsTheOnly() const; bool IsTheOnly() const;
TMainWindow *MainWindow(); TMainWindow *MainWindow();
QList<TMainWindow*> MainWindows(); QList<TMainWindow*> MainWindows();
@ -94,6 +95,7 @@ private:
QLocalServer *localServer; QLocalServer *localServer;
VTranslateVars *trVars; VTranslateVars *trVars;
QPointer<DialogMDataBase> dataBase; QPointer<DialogMDataBase> dataBase;
bool testMode;
void Clean(); void Clean();
}; };

View File

@ -43,7 +43,8 @@ SOURCES += \
tst_vlayoutdetail.cpp \ tst_vlayoutdetail.cpp \
tst_varc.cpp \ tst_varc.cpp \
stable.cpp \ stable.cpp \
tst_measurementregexp.cpp tst_measurementregexp.cpp \
tst_tapecommandline.cpp
HEADERS += \ HEADERS += \
tst_vposter.h \ tst_vposter.h \
@ -54,7 +55,8 @@ HEADERS += \
tst_vlayoutdetail.h \ tst_vlayoutdetail.h \
tst_varc.h \ tst_varc.h \
stable.h \ stable.h \
tst_measurementregexp.h tst_measurementregexp.h \
tst_tapecommandline.h
# Set using ccache. Function enable_ccache() defined in common.pri. # Set using ccache. Function enable_ccache() defined in common.pri.
$$enable_ccache() $$enable_ccache()
@ -169,3 +171,23 @@ else:unix: LIBS += -L$${OUT_PWD}/../../libs/qmuparser/$${DESTDIR} -lqmuparser
INCLUDEPATH += $${PWD}/../../libs/qmuparser INCLUDEPATH += $${PWD}/../../libs/qmuparser
DEPENDPATH += $${PWD}/../../libs/qmuparser DEPENDPATH += $${PWD}/../../libs/qmuparser
# Only for adding path to LD_LIBRARY_PATH
# VPropertyExplorer library
win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer
else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer
else:unix: LIBS += -L$${OUT_PWD}/../../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer
INCLUDEPATH += $${PWD}/../../libs/vpropertyexplorer
DEPENDPATH += $${PWD}/../../libs/vpropertyexplorer
TAPE_TEST_FILES += \
tst_tape/keiko.vit
for(DIR, TAPE_TEST_FILES) {
#add these absolute paths to a variable which
#ends up as 'mkcommands = path1 path2 path3 ...'
tape_path += $${PWD}/$$DIR
}
copyToDestdir($$tape_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tst_tape))

View File

@ -47,3 +47,103 @@ void AbstractTest::Comparison(const QVector<QPointF> &ekv, const QVector<QPointF
QCOMPARE(ekv.at(i).toPoint(), ekvOrig.at(i).toPoint()); // Don't use comparison float values QCOMPARE(ekv.at(i).toPoint(), ekvOrig.at(i).toPoint()); // Don't use comparison float values
} }
} }
//---------------------------------------------------------------------------------------------------------------------
QString AbstractTest::ValentinaPath() const
{
const QString path = QStringLiteral("/../../../app/valentina/bin/valentina");
#ifdef Q_OS_WIN
return QApplication::applicationDirPath() + path + QStringList(".exe");
#else
return QApplication::applicationDirPath() + path;
#endif
}
//---------------------------------------------------------------------------------------------------------------------
QString AbstractTest::TapePath() const
{
const QString path = QStringLiteral("/../../../app/tape/bin/tape");
#ifdef Q_OS_WIN
return QApplication::applicationDirPath() + path + QStringList(".exe");
#else
return QApplication::applicationDirPath() + path;
#endif
}
//---------------------------------------------------------------------------------------------------------------------
bool AbstractTest::Run(const QString &program, const QStringList &arguments)
{
const QString parameters = QString("Program: %1 \nArguments: %2.").arg(program).arg(arguments.join(", "));
QFileInfo info(program);
if (not info.exists())
{
const QString msg = QString("Can't find binary.\n%1").arg(parameters);
QWARN(msg.toUtf8().constData());
return false;
}
QProcess *process = new QProcess(this);
process->setWorkingDirectory(info.absoluteDir().absolutePath());
process->start(program, arguments);
if (not process->waitForFinished())// 30 sec
{
const QString msg = QString("The operation timed out or an error occurred.\n%1").arg(parameters);
QWARN(msg.toUtf8().constData());
return false;
}
if (process->exitStatus() == QProcess::CrashExit)
{
const QString msg = QString("Program crashed.\n%1\n%2").arg(parameters)
.arg(QString(process->readAllStandardError()));
QWARN(msg.toUtf8().constData());
return false;
}
if (process->exitCode() != 0)
{
const QString msg = QString("Failed.\n%1\n%2").arg(parameters)
.arg(QString(process->readAllStandardError()));
QWARN(msg.toUtf8().constData());
return false;
}
delete process;
return true;
}
//---------------------------------------------------------------------------------------------------------------------
bool AbstractTest::CopyRecursively(const QString &srcFilePath, const QString &tgtFilePath) const
{
QFileInfo srcFileInfo(srcFilePath);
if (srcFileInfo.isDir())
{
QDir targetDir(tgtFilePath);
targetDir.cdUp();
if (not targetDir.mkdir(QFileInfo(tgtFilePath).fileName()))
{
return false;
}
QDir sourceDir(srcFilePath);
QStringList fileNames = sourceDir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden |
QDir::System);
foreach (const QString &fileName, fileNames)
{
const QString newSrcFilePath = srcFilePath + QLatin1Char('/') + fileName;
const QString newTgtFilePath = tgtFilePath + QLatin1Char('/') + fileName;
if (not CopyRecursively(newSrcFilePath, newTgtFilePath))
{
return false;
}
}
} else
{
if (not QFile::copy(srcFilePath, tgtFilePath))
{
return false;
}
}
return true;
}

View File

@ -40,6 +40,11 @@ public:
protected: protected:
void Comparison(const QVector<QPointF> &ekv, const QVector<QPointF> &ekvOrig) const; void Comparison(const QVector<QPointF> &ekv, const QVector<QPointF> &ekvOrig) const;
QString ValentinaPath() const;
QString TapePath() const;
bool Run(const QString &program, const QStringList &arguments);
bool CopyRecursively(const QString &srcFilePath, const QString &tgtFilePath) const;
}; };
#endif // ABSTRACTTEST_H #endif // ABSTRACTTEST_H

View File

@ -35,6 +35,7 @@
#include "tst_vlayoutdetail.h" #include "tst_vlayoutdetail.h"
#include "tst_varc.h" #include "tst_varc.h"
#include "tst_measurementregexp.h" #include "tst_measurementregexp.h"
#include "tst_tapecommandline.h"
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
@ -54,6 +55,7 @@ int main(int argc, char** argv)
ASSERT_TEST(new TST_VLayoutDetail()); ASSERT_TEST(new TST_VLayoutDetail());
ASSERT_TEST(new TST_VArc()); ASSERT_TEST(new TST_VArc());
ASSERT_TEST(new TST_MeasurementRegExp()); ASSERT_TEST(new TST_MeasurementRegExp());
ASSERT_TEST(new TST_TapeCommandLine());
return status; return status;
} }

View File

@ -0,0 +1,143 @@
<?xml version='1.0' encoding='UTF-8'?>
<vit>
<!--Measurements created with Valentina (http://www.valentina-project.org/).-->
<version>0.3.0</version>
<read-only>false</read-only>
<notes/>
<unit>cm</unit>
<personal>
<family-name/>
<given-name/>
<birth-date>1900-01-01</birth-date>
<sex>male</sex>
<email>username@example.com</email>
</personal>
<body-measurements>
<m name="across_back_b" value="0" description="" full_name=""/>
<m name="across_chest_f" value="0" description="" full_name=""/>
<m name="arm_armpit_to_wrist" value="0" description="" full_name=""/>
<m name="arm_neck_back_to_wrist_bent" value="0" description="" full_name=""/>
<m name="arm_neck_side_to_finger_tip" value="0" description="" full_name=""/>
<m name="arm_neck_side_to_wrist" value="0" description="" full_name=""/>
<m name="arm_neck_side_to_wrist" value="0" description="" full_name=""/>
<m name="arm_shoulder_tip_to_elbow" value="19.5" description="" full_name=""/>
<m name="arm_shoulder_tip_to_wrist" value="43.5" description="" full_name=""/>
<m name="arm_upper_circ" value="25" description="" full_name=""/>
<m name="arm_wrist_circ" value="14.5" description="" full_name=""/>
<m name="armfold_to_armfold_b" value="32.86" description="" full_name=""/>
<m name="armfold_to_armfold_f" value="31" description="" full_name=""/>
<m name="armfold_to_armfold_f" value="31" description="" full_name=""/>
<m name="armpit_to_waist_side" value="0" description="" full_name=""/>
<m name="armscye_arc" value="0" description="" full_name=""/>
<m name="armscye_circ" value="0" description="" full_name=""/>
<m name="armscye_width" value="0" description="" full_name=""/>
<m name="body_armfold_circ" value="0" description="" full_name=""/>
<m name="body_torso_circ" value="0" description="" full_name=""/>
<m name="bust_arc_f" value="0" description="" full_name=""/>
<m name="bust_circ" value="82" description="" full_name=""/>
<m name="bustpoint_to_bustpoint" value="0" description="" full_name=""/>
<m name="bustpoint_to_bustpoint_halter" value="0" description="" full_name=""/>
<m name="bustpoint_to_neck_side" value="0" description="" full_name=""/>
<m name="crotch_length" value="0" description="" full_name=""/>
<m name="crotch_length" value="0" description="" full_name=""/>
<m name="foot_instep_circ" value="0" description="" full_name=""/>
<m name="foot_length" value="0" description="" full_name=""/>
<m name="foot_width" value="0" description="" full_name=""/>
<m name="hand_circ" value="0" description="" full_name=""/>
<m name="hand_length" value="0" description="" full_name=""/>
<m name="hand_length" value="0" description="" full_name=""/>
<m name="hand_palm_width" value="0" description="" full_name=""/>
<m name="head_chin_to_neck_back" value="0" description="" full_name=""/>
<m name="head_crown_to_neck_back" value="0" description="" full_name=""/>
<m name="head_length" value="0" description="" full_name=""/>
<m name="height_ankle" value="0" description="" full_name=""/>
<m name="height_armpit" value="0" description="" full_name=""/>
<m name="height_bustpoint" value="0" description="" full_name=""/>
<m name="height_highhip" value="0" description="" full_name=""/>
<m name="height_hip" value="0" description="" full_name=""/>
<m name="height_knee" value="50" description="" full_name=""/>
<m name="height_neck_back" value="0" description="" full_name=""/>
<m name="height_neck_back_to_knee" value="0" description="" full_name=""/>
<m name="height_neck_back_to_knee" value="0" description="" full_name=""/>
<m name="height_neck_front" value="0" description="" full_name=""/>
<m name="height_neck_front" value="0" description="" full_name=""/>
<m name="height_neck_side" value="0" description="" full_name=""/>
<m name="height_scapula" value="0" description="" full_name=""/>
<m name="height_shoulder_tip" value="0" description="" full_name=""/>
<m name="height_shoulder_tip" value="0" description="" full_name=""/>
<m name="height_waist_front" value="0" description="" full_name=""/>
<m name="height_waist_side" value="0" description="" full_name=""/>
<m name="height_waist_side_to_hip" value="15" description="" full_name=""/>
<m name="height_waist_side_to_knee" value="0" description="" full_name=""/>
<m name="highbust_arc_b" value="0" description="" full_name=""/>
<m name="highbust_arc_f" value="0" description="" full_name=""/>
<m name="highbust_arc_f" value="0" description="" full_name=""/>
<m name="highbust_b_over_shoulder_to_highbust_f" value="0" description="" full_name=""/>
<m name="highbust_circ" value="0" description="" full_name=""/>
<m name="highbust_to_waist_f" value="0" description="" full_name=""/>
<m name="highhip_arc_b" value="0" description="" full_name=""/>
<m name="highhip_arc_f" value="0" description="" full_name=""/>
<m name="highhip_circ" value="0" description="" full_name=""/>
<m name="hip_arc_b" value="0" description="" full_name=""/>
<m name="hip_arc_f" value="0" description="" full_name=""/>
<m name="hip_arc_f" value="0" description="" full_name=""/>
<m name="hip_circ" value="89" description="" full_name=""/>
<m name="hip_circ" value="89" description="" full_name=""/>
<m name="hip_with_abdomen_arc_f" value="0" description="" full_name=""/>
<m name="indent_neck_back" value="0" description="" full_name=""/>
<m name="leg_ankle_circ" value="19" description="" full_name=""/>
<m name="leg_calf_circ" value="41" description="" full_name=""/>
<m name="leg_crotch_to_floor" value="79.25" description="" full_name=""/>
<m name="leg_knee_circ" value="0" description="" full_name=""/>
<m name="leg_knee_circ_bent" value="0" description="" full_name=""/>
<m name="leg_thigh_mid_circ" value="0" description="" full_name=""/>
<m name="leg_thigh_upper_circ" value="47.02" description="" full_name=""/>
<m name="leg_waist_side_to_floor" value="0" description="" full_name=""/>
<m name="leg_waist_side_to_knee" value="0" description="" full_name=""/>
<m name="lowbust_arc_f" value="0" description="" full_name=""/>
<m name="lowbust_circ" value="67" description="" full_name=""/>
<m name="lowbust_to_waist_f" value="0" description="" full_name=""/>
<m name="neck_arc_b" value="0" description="" full_name=""/>
<m name="neck_arc_f" value="0" description="" full_name=""/>
<m name="neck_arc_f" value="0" description="" full_name=""/>
<m name="neck_back_to_highbust_b" value="0" description="" full_name=""/>
<m name="neck_back_to_waist_b" value="34" description="" full_name=""/>
<m name="neck_back_to_waist_side" value="0" description="" full_name=""/>
<m name="neck_circ" value="29.5" description="" full_name=""/>
<m name="neck_front_to_bust_f" value="0" description="" full_name=""/>
<m name="neck_front_to_highbust_f" value="0" description="" full_name=""/>
<m name="neck_front_to_highbust_f" value="0" description="" full_name=""/>
<m name="neck_front_to_waist_f" value="33.3" description="" full_name=""/>
<m name="neck_front_to_waist_f" value="33.3" description="" full_name=""/>
<m name="neck_front_to_waist_side" value="0" description="" full_name=""/>
<m name="neck_mid_circ" value="0" description="" full_name=""/>
<m name="neck_mid_circ" value="0" description="" full_name=""/>
<m name="neck_side_to_armfold_b" value="0" description="" full_name=""/>
<m name="neck_side_to_armfold_f" value="0" description="" full_name=""/>
<m name="neck_side_to_armfold_f" value="0" description="" full_name=""/>
<m name="neck_side_to_waist_b" value="37" description="" full_name=""/>
<m name="neck_side_to_waist_f" value="38.5" description="" full_name=""/>
<m name="neck_side_to_waist_f" value="38.5" description="" full_name=""/>
<m name="neck_side_to_waist_f" value="38.5" description="" full_name=""/>
<m name="neck_width" value="0" description="" full_name=""/>
<m name="rise_length_side" value="0" description="" full_name=""/>
<m name="rise_length_side" value="0" description="" full_name=""/>
<m name="shoulder_length" value="13.5" description="" full_name=""/>
<m name="shoulder_slope_neck_side_angle" value="0" description="" full_name=""/>
<m name="shoulder_slope_neck_side_length" value="0" description="" full_name=""/>
<m name="shoulder_tip_to_shoulder_tip_b" value="36.65" description="" full_name=""/>
<m name="shoulder_tip_to_shoulder_tip_b" value="36.65" description="" full_name=""/>
<m name="shoulder_tip_to_shoulder_tip_f" value="35.65" description="" full_name=""/>
<m name="shoulder_tip_to_waist_back" value="0" description="" full_name=""/>
<m name="shoulder_tip_to_waist_back" value="0" description="" full_name=""/>
<m name="shoulder_tip_to_waist_front" value="0" description="" full_name=""/>
<m name="shoulder_tip_to_waist_front" value="0" description="" full_name=""/>
<m name="waist_arc_b" value="0" description="" full_name=""/>
<m name="waist_arc_f" value="0" description="" full_name=""/>
<m name="waist_arc_f" value="0" description="" full_name=""/>
<m name="waist_circ" value="59.5" description="" full_name=""/>
<m name="waist_to_highhip_f" value="0" description="" full_name=""/>
<m name="waist_to_hip_f" value="0" description="" full_name=""/>
<m name="waist_to_waist_halter" value="0" description="" full_name=""/>
</body-measurements>
</vit>

View File

@ -0,0 +1,87 @@
/************************************************************************
**
** @file tst_tapecommandline.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 25 9, 2015
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** 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_tapecommandline.h"
#include <QtTest>
const QString tmpTestFolder = QStringLiteral("tst_tape_tmp");
//---------------------------------------------------------------------------------------------------------------------
TST_TapeCommandLine::TST_TapeCommandLine(QObject *parent)
:AbstractTest(parent)
{
}
//---------------------------------------------------------------------------------------------------------------------
void TST_TapeCommandLine::init()
{
QDir tmpDir(tmpTestFolder);
if (not tmpDir.removeRecursively())
{
QFAIL("Fail to remove temp directory.");
}
if (not CopyRecursively(QApplication::applicationDirPath() + QLatin1Char('/') + QStringLiteral("tst_tape"),
QApplication::applicationDirPath() + QLatin1Char('/') + tmpTestFolder))
{
QFAIL("Fail to prepare files for testing.");
}
}
//---------------------------------------------------------------------------------------------------------------------
void TST_TapeCommandLine::OpenMeasurements_data() const
{
QTest::addColumn<QString>("file");
QTest::addColumn<bool>("result");
QTest::newRow("Send wrong path to file") << "wrongPath.vit" << false; // The file doesn't exist!
QTest::newRow("Old individual format to new version") << "keiko.vit" << true;
}
//---------------------------------------------------------------------------------------------------------------------
void TST_TapeCommandLine::OpenMeasurements()
{
QFETCH(QString, file);
QFETCH(bool, result);
const bool res = Run(TapePath(), QStringList() << "--test"
<< QApplication::applicationDirPath() + QLatin1Char('/') + tmpTestFolder + QLatin1Char('/') + file);
QCOMPARE(res, result);
}
//---------------------------------------------------------------------------------------------------------------------
void TST_TapeCommandLine::cleanup()
{
QDir tmpDir(tmpTestFolder);
if (not tmpDir.removeRecursively())
{
QWARN("Fail to remove temp directory.");
}
}

View File

@ -0,0 +1,51 @@
/************************************************************************
**
** @file tst_tapecommandline.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 25 9, 2015
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** 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/>.
**
*************************************************************************/
#ifndef TST_TAPECOMMANDLINE_H
#define TST_TAPECOMMANDLINE_H
#include "abstracttest.h"
class TST_TapeCommandLine : public AbstractTest
{
Q_OBJECT
public:
TST_TapeCommandLine(QObject *parent = 0);
private slots:
void init();
void OpenMeasurements_data() const;
void OpenMeasurements();
void cleanup();
private:
Q_DISABLE_COPY(TST_TapeCommandLine)
};
#endif // TST_TAPECOMMANDLINE_H