Test that all command line option names are unique.
--HG-- branch : develop
This commit is contained in:
parent
9c38e65b45
commit
9545db280d
|
@ -3,81 +3,10 @@
|
||||||
#include "dialogs/dialogsavelayout.h"
|
#include "dialogs/dialogsavelayout.h"
|
||||||
#include "xml/vdomdocument.h"
|
#include "xml/vdomdocument.h"
|
||||||
#include "../vformat/vmeasurements.h"
|
#include "../vformat/vmeasurements.h"
|
||||||
|
#include "../vmisc/commandoptions.h"
|
||||||
|
|
||||||
VCommandLinePtr VCommandLine::instance = nullptr;
|
VCommandLinePtr VCommandLine::instance = nullptr;
|
||||||
|
|
||||||
const static auto LONG_OPTION_BASENAME = QStringLiteral("basename");
|
|
||||||
const static auto SINGLE_OPTION_BASENAME = QStringLiteral("b");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_DESTINATION = QStringLiteral("destination");
|
|
||||||
const static auto SINGLE_OPTION_DESTINATION = QStringLiteral("d");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_MEASUREFILE = QStringLiteral("mfile");
|
|
||||||
const static auto SINGLE_OPTION_MEASUREFILE = QStringLiteral("m");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_PAGETEMPLATE = QStringLiteral("pageformat");
|
|
||||||
const static auto SINGLE_OPTION_PAGETEMPLATE = QStringLiteral("p");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_EXP2FORMAT = QStringLiteral("format");
|
|
||||||
const static auto SINGLE_OPTION_EXP2FORMAT = QStringLiteral("f");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_ROTATE = QStringLiteral("rotate");
|
|
||||||
const static auto SINGLE_OPTION_ROTATE = QStringLiteral("r");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_CROP = QStringLiteral("crop");
|
|
||||||
const static auto SINGLE_OPTION_CROP = QStringLiteral("c");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_UNITE = QStringLiteral("unite");
|
|
||||||
const static auto SINGLE_OPTION_UNITE = QStringLiteral("u");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_PAGEW = QStringLiteral("pagew");
|
|
||||||
const static auto SINGLE_OPTION_PAGEW = QStringLiteral("W");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_PAGEH = QStringLiteral("pageh");
|
|
||||||
const static auto SINGLE_OPTION_PAGEH = QStringLiteral("H");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_PAGEUNITS = QStringLiteral("pageunits");
|
|
||||||
const static auto SINGLE_OPTION_PAGEUNITS = QStringLiteral("U");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_SAVELENGTH = QStringLiteral("savelen");
|
|
||||||
const static auto SINGLE_OPTION_SAVELENGTH = QStringLiteral("S");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_SHIFTLENGTH = QStringLiteral("shiftlen");
|
|
||||||
const static auto SINGLE_OPTION_SHIFTLENGTH = QStringLiteral("s");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_SHIFTUNITS = QStringLiteral("layounits");
|
|
||||||
const static auto SINGLE_OPTION_SHIFTUNITS = QStringLiteral("l");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_GAPWIDTH = QStringLiteral("gapwidth");
|
|
||||||
const static auto SINGLE_OPTION_GAPWIDTH = QStringLiteral("G");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_GROUPPING = QStringLiteral("groups");
|
|
||||||
const static auto SINGLE_OPTION_GROUPPING = QStringLiteral("g");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_TEST = QStringLiteral("test");
|
|
||||||
const static auto SINGLE_OPTION_TEST = QStringLiteral("t");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_GRADATIONSIZE = QStringLiteral("gsize");
|
|
||||||
const static auto SINGLE_OPTION_GRADATIONSIZE = QStringLiteral("x");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_GRADATIONHEIGHT = QStringLiteral("gheight");
|
|
||||||
const static auto SINGLE_OPTION_GRADATIONHEIGHT = QStringLiteral("e");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_IGNORE_MARGINS = QStringLiteral("ignoremargins");
|
|
||||||
const static auto SINGLE_OPTION_IGNORE_MARGINS = QStringLiteral("i");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_LEFT_MARGIN = QStringLiteral("lmargin");
|
|
||||||
const static auto SINGLE_OPTION_LEFT_MARGIN = QStringLiteral("L");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_RIGHT_MARGIN = QStringLiteral("rmargin");
|
|
||||||
const static auto SINGLE_OPTION_RIGHT_MARGIN = QStringLiteral("R");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_TOP_MARGIN = QStringLiteral("tmargin");
|
|
||||||
const static auto SINGLE_OPTION_TOP_MARGIN = QStringLiteral("T");
|
|
||||||
|
|
||||||
const static auto LONG_OPTION_BOTTOM_MARGIN = QStringLiteral("bmargin");
|
|
||||||
const static auto SINGLE_OPTION_BOTTOM_MARGIN = QStringLiteral("B");
|
|
||||||
|
|
||||||
#define translate(context, source) QCoreApplication::translate((context), (source))
|
#define translate(context, source) QCoreApplication::translate((context), (source))
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
135
src/libs/vmisc/commandoptions.cpp
Normal file
135
src/libs/vmisc/commandoptions.cpp
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file commandoptions.cpp
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 9 11, 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 "commandoptions.h"
|
||||||
|
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
|
const QString LONG_OPTION_BASENAME = QStringLiteral("basename");
|
||||||
|
const QString SINGLE_OPTION_BASENAME = QStringLiteral("b");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_DESTINATION = QStringLiteral("destination");
|
||||||
|
const QString SINGLE_OPTION_DESTINATION = QStringLiteral("d");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_MEASUREFILE = QStringLiteral("mfile");
|
||||||
|
const QString SINGLE_OPTION_MEASUREFILE = QStringLiteral("m");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_PAGETEMPLATE = QStringLiteral("pageformat");
|
||||||
|
const QString SINGLE_OPTION_PAGETEMPLATE = QStringLiteral("p");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_EXP2FORMAT = QStringLiteral("format");
|
||||||
|
const QString SINGLE_OPTION_EXP2FORMAT = QStringLiteral("f");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_ROTATE = QStringLiteral("rotate");
|
||||||
|
const QString SINGLE_OPTION_ROTATE = QStringLiteral("r");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_CROP = QStringLiteral("crop");
|
||||||
|
const QString SINGLE_OPTION_CROP = QStringLiteral("c");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_UNITE = QStringLiteral("unite");
|
||||||
|
const QString SINGLE_OPTION_UNITE = QStringLiteral("u");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_PAGEW = QStringLiteral("pagew");
|
||||||
|
const QString SINGLE_OPTION_PAGEW = QStringLiteral("W");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_PAGEH = QStringLiteral("pageh");
|
||||||
|
const QString SINGLE_OPTION_PAGEH = QStringLiteral("H");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_PAGEUNITS = QStringLiteral("pageunits");
|
||||||
|
const QString SINGLE_OPTION_PAGEUNITS = QStringLiteral("U");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_SAVELENGTH = QStringLiteral("savelen");
|
||||||
|
const QString SINGLE_OPTION_SAVELENGTH = QStringLiteral("S");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_SHIFTLENGTH = QStringLiteral("shiftlen");
|
||||||
|
const QString SINGLE_OPTION_SHIFTLENGTH = QStringLiteral("s");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_SHIFTUNITS = QStringLiteral("layounits");
|
||||||
|
const QString SINGLE_OPTION_SHIFTUNITS = QStringLiteral("l");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_GAPWIDTH = QStringLiteral("gapwidth");
|
||||||
|
const QString SINGLE_OPTION_GAPWIDTH = QStringLiteral("G");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_GROUPPING = QStringLiteral("groups");
|
||||||
|
const QString SINGLE_OPTION_GROUPPING = QStringLiteral("g");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_TEST = QStringLiteral("test");
|
||||||
|
const QString SINGLE_OPTION_TEST = QStringLiteral("t");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_GRADATIONSIZE = QStringLiteral("gsize");
|
||||||
|
const QString SINGLE_OPTION_GRADATIONSIZE = QStringLiteral("x");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_GRADATIONHEIGHT = QStringLiteral("gheight");
|
||||||
|
const QString SINGLE_OPTION_GRADATIONHEIGHT = QStringLiteral("e");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_IGNORE_MARGINS = QStringLiteral("ignoremargins");
|
||||||
|
const QString SINGLE_OPTION_IGNORE_MARGINS = QStringLiteral("i");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_LEFT_MARGIN = QStringLiteral("lmargin");
|
||||||
|
const QString SINGLE_OPTION_LEFT_MARGIN = QStringLiteral("L");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_RIGHT_MARGIN = QStringLiteral("rmargin");
|
||||||
|
const QString SINGLE_OPTION_RIGHT_MARGIN = QStringLiteral("R");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_TOP_MARGIN = QStringLiteral("tmargin");
|
||||||
|
const QString SINGLE_OPTION_TOP_MARGIN = QStringLiteral("T");
|
||||||
|
|
||||||
|
const QString LONG_OPTION_BOTTOM_MARGIN = QStringLiteral("bmargin");
|
||||||
|
const QString SINGLE_OPTION_BOTTOM_MARGIN = QStringLiteral("B");
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QStringList AllKeys()
|
||||||
|
{
|
||||||
|
QStringList list;
|
||||||
|
list << LONG_OPTION_BASENAME << SINGLE_OPTION_BASENAME
|
||||||
|
<< LONG_OPTION_DESTINATION << SINGLE_OPTION_DESTINATION
|
||||||
|
<< LONG_OPTION_MEASUREFILE << SINGLE_OPTION_MEASUREFILE
|
||||||
|
<< LONG_OPTION_PAGETEMPLATE << SINGLE_OPTION_PAGETEMPLATE
|
||||||
|
<< LONG_OPTION_EXP2FORMAT << SINGLE_OPTION_EXP2FORMAT
|
||||||
|
<< LONG_OPTION_ROTATE << SINGLE_OPTION_ROTATE
|
||||||
|
<< LONG_OPTION_CROP << SINGLE_OPTION_CROP
|
||||||
|
<< LONG_OPTION_UNITE << SINGLE_OPTION_UNITE
|
||||||
|
<< LONG_OPTION_PAGEW << SINGLE_OPTION_PAGEW
|
||||||
|
<< LONG_OPTION_PAGEH << SINGLE_OPTION_PAGEH
|
||||||
|
<< LONG_OPTION_PAGEUNITS << SINGLE_OPTION_PAGEUNITS
|
||||||
|
<< LONG_OPTION_SAVELENGTH << SINGLE_OPTION_SAVELENGTH
|
||||||
|
<< LONG_OPTION_SHIFTLENGTH << SINGLE_OPTION_SHIFTLENGTH
|
||||||
|
<< LONG_OPTION_SHIFTUNITS << SINGLE_OPTION_SHIFTUNITS
|
||||||
|
<< LONG_OPTION_GAPWIDTH << SINGLE_OPTION_GAPWIDTH
|
||||||
|
<< LONG_OPTION_GROUPPING << SINGLE_OPTION_GROUPPING
|
||||||
|
<< LONG_OPTION_TEST << SINGLE_OPTION_TEST
|
||||||
|
<< LONG_OPTION_GRADATIONSIZE << SINGLE_OPTION_GRADATIONSIZE
|
||||||
|
<< LONG_OPTION_GRADATIONHEIGHT << SINGLE_OPTION_GRADATIONHEIGHT
|
||||||
|
<< LONG_OPTION_IGNORE_MARGINS << SINGLE_OPTION_IGNORE_MARGINS
|
||||||
|
<< LONG_OPTION_LEFT_MARGIN << SINGLE_OPTION_LEFT_MARGIN
|
||||||
|
<< LONG_OPTION_RIGHT_MARGIN << SINGLE_OPTION_RIGHT_MARGIN
|
||||||
|
<< LONG_OPTION_TOP_MARGIN << SINGLE_OPTION_TOP_MARGIN
|
||||||
|
<< LONG_OPTION_BOTTOM_MARGIN << SINGLE_OPTION_BOTTOM_MARGIN;
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
110
src/libs/vmisc/commandoptions.h
Normal file
110
src/libs/vmisc/commandoptions.h
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file commandoptions.h
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 9 11, 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 COMMANDOPTIONS_H
|
||||||
|
#define COMMANDOPTIONS_H
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
class QStringList;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_BASENAME;
|
||||||
|
extern const QString SINGLE_OPTION_BASENAME;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_DESTINATION;
|
||||||
|
extern const QString SINGLE_OPTION_DESTINATION;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_MEASUREFILE;
|
||||||
|
extern const QString SINGLE_OPTION_MEASUREFILE;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_PAGETEMPLATE;
|
||||||
|
extern const QString SINGLE_OPTION_PAGETEMPLATE;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_EXP2FORMAT;
|
||||||
|
extern const QString SINGLE_OPTION_EXP2FORMAT;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_ROTATE;
|
||||||
|
extern const QString SINGLE_OPTION_ROTATE;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_CROP;
|
||||||
|
extern const QString SINGLE_OPTION_CROP;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_UNITE;
|
||||||
|
extern const QString SINGLE_OPTION_UNITE;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_PAGEW;
|
||||||
|
extern const QString SINGLE_OPTION_PAGEW;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_PAGEH;
|
||||||
|
extern const QString SINGLE_OPTION_PAGEH;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_PAGEUNITS;
|
||||||
|
extern const QString SINGLE_OPTION_PAGEUNITS;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_SAVELENGTH;
|
||||||
|
extern const QString SINGLE_OPTION_SAVELENGTH;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_SHIFTLENGTH;
|
||||||
|
extern const QString SINGLE_OPTION_SHIFTLENGTH;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_SHIFTUNITS;
|
||||||
|
extern const QString SINGLE_OPTION_SHIFTUNITS;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_GAPWIDTH;
|
||||||
|
extern const QString SINGLE_OPTION_GAPWIDTH;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_GROUPPING;
|
||||||
|
extern const QString SINGLE_OPTION_GROUPPING;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_TEST;
|
||||||
|
extern const QString SINGLE_OPTION_TEST;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_GRADATIONSIZE;
|
||||||
|
extern const QString SINGLE_OPTION_GRADATIONSIZE;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_GRADATIONHEIGHT;
|
||||||
|
extern const QString SINGLE_OPTION_GRADATIONHEIGHT;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_IGNORE_MARGINS;
|
||||||
|
extern const QString SINGLE_OPTION_IGNORE_MARGINS;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_LEFT_MARGIN;
|
||||||
|
extern const QString SINGLE_OPTION_LEFT_MARGIN;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_RIGHT_MARGIN;
|
||||||
|
extern const QString SINGLE_OPTION_RIGHT_MARGIN;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_TOP_MARGIN;
|
||||||
|
extern const QString SINGLE_OPTION_TOP_MARGIN;
|
||||||
|
|
||||||
|
extern const QString LONG_OPTION_BOTTOM_MARGIN;
|
||||||
|
extern const QString SINGLE_OPTION_BOTTOM_MARGIN;
|
||||||
|
|
||||||
|
QStringList AllKeys();
|
||||||
|
|
||||||
|
#endif // COMMANDOPTIONS_H
|
|
@ -11,7 +11,8 @@ SOURCES += \
|
||||||
$$PWD/projectversion.cpp \
|
$$PWD/projectversion.cpp \
|
||||||
$$PWD/vcommonsettings.cpp \
|
$$PWD/vcommonsettings.cpp \
|
||||||
$$PWD/vtapesettings.cpp \
|
$$PWD/vtapesettings.cpp \
|
||||||
$$PWD/backport/qmarginsf.cpp
|
$$PWD/backport/qmarginsf.cpp \
|
||||||
|
$$PWD/commandoptions.cpp
|
||||||
|
|
||||||
win32-msvc*:SOURCES += $$PWD/stable.cpp
|
win32-msvc*:SOURCES += $$PWD/stable.cpp
|
||||||
|
|
||||||
|
@ -32,4 +33,5 @@ HEADERS += \
|
||||||
$$PWD/vlockguard.h \
|
$$PWD/vlockguard.h \
|
||||||
$$PWD/vsysexits.h \
|
$$PWD/vsysexits.h \
|
||||||
$$PWD/backport/qmarginsf.h \
|
$$PWD/backport/qmarginsf.h \
|
||||||
$$PWD/vmargins.h
|
$$PWD/vmargins.h \
|
||||||
|
$$PWD/commandoptions.h
|
||||||
|
|
|
@ -50,7 +50,8 @@ SOURCES += \
|
||||||
tst_vmeasurements.cpp \
|
tst_vmeasurements.cpp \
|
||||||
tst_qmuparsererrormsg.cpp \
|
tst_qmuparsererrormsg.cpp \
|
||||||
tst_vlockguard.cpp \
|
tst_vlockguard.cpp \
|
||||||
tst_misc.cpp
|
tst_misc.cpp \
|
||||||
|
tst_vcommandline.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
tst_vposter.h \
|
tst_vposter.h \
|
||||||
|
@ -68,7 +69,8 @@ HEADERS += \
|
||||||
tst_vmeasurements.h \
|
tst_vmeasurements.h \
|
||||||
tst_qmuparsererrormsg.h \
|
tst_qmuparsererrormsg.h \
|
||||||
tst_vlockguard.h \
|
tst_vlockguard.h \
|
||||||
tst_misc.h
|
tst_misc.h \
|
||||||
|
tst_vcommandline.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()
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "tst_qmuparsererrormsg.h"
|
#include "tst_qmuparsererrormsg.h"
|
||||||
#include "tst_vlockguard.h"
|
#include "tst_vlockguard.h"
|
||||||
#include "tst_misc.h"
|
#include "tst_misc.h"
|
||||||
|
#include "tst_vcommandline.h"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
@ -70,6 +71,7 @@ int main(int argc, char** argv)
|
||||||
ASSERT_TEST(new TST_QmuParserErrorMsg());
|
ASSERT_TEST(new TST_QmuParserErrorMsg());
|
||||||
ASSERT_TEST(new TST_VLockGuard());
|
ASSERT_TEST(new TST_VLockGuard());
|
||||||
ASSERT_TEST(new TST_Misc());
|
ASSERT_TEST(new TST_Misc());
|
||||||
|
ASSERT_TEST(new TST_VCommandLine());
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
54
src/test/ValentinaTest/tst_vcommandline.cpp
Normal file
54
src/test/ValentinaTest/tst_vcommandline.cpp
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file tst_vcommandline.cpp
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 9 11, 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_vcommandline.h"
|
||||||
|
#include "../vmisc/commandoptions.h"
|
||||||
|
#include "../vmisc/logging.h"
|
||||||
|
|
||||||
|
#include <QtTest>
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
TST_VCommandLine::TST_VCommandLine(QObject *parent)
|
||||||
|
:QObject(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
// cppcheck-suppress unusedFunction
|
||||||
|
void TST_VCommandLine::UniqueKeys()
|
||||||
|
{
|
||||||
|
const QStringList options = AllKeys();
|
||||||
|
QSet<QString> unique;
|
||||||
|
|
||||||
|
foreach(const QString &str, options)
|
||||||
|
{
|
||||||
|
const QString message = QString("Options '%1' is not unique!").arg(str);
|
||||||
|
QVERIFY2(not unique.contains(str), qUtf8Printable(message));
|
||||||
|
unique.insert(str);
|
||||||
|
}
|
||||||
|
}
|
47
src/test/ValentinaTest/tst_vcommandline.h
Normal file
47
src/test/ValentinaTest/tst_vcommandline.h
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file tst_vcommandline.h
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 9 11, 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_VCOMMANDLINE_H
|
||||||
|
#define TST_VCOMMANDLINE_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
class TST_VCommandLine : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit TST_VCommandLine(QObject *parent = nullptr);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void UniqueKeys();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY(TST_VCommandLine)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TST_VCOMMANDLINE_H
|
Loading…
Reference in New Issue
Block a user