From 9ef1ed4e22ca5c46c50d8b296c81f06256fb292b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 4 Aug 2016 20:10:12 +0300 Subject: [PATCH] Collection unit tests moved to separate binary. --HG-- branch : develop --- src/test/CollectionTest/CollectionTest.pro | 273 ++++++++++++++++++ src/test/CollectionTest/qttestmainlambda.cpp | 49 ++++ src/test/CollectionTest/stable.cpp | 30 ++ src/test/CollectionTest/stable.h | 80 +++++ .../tst_tape/GOST_man_ru_v0.3.0.vst | 0 .../tst_tape/GOST_man_ru_v0.4.2.vst | 0 .../tst_tape/all_measurements_v0.3.0.vit | 0 .../tst_tape/all_measurements_v0.3.3.vit | 0 .../tst_tape/all_measurements_v0.4.0.vst | 0 .../tst_tape/all_measurements_v0.4.2.vst | 0 .../tst_tape/broken1.vit | 0 .../tst_tape/broken2.vit | 0 .../tst_tape/broken3.vit | 0 .../tst_tape/broken4.vit | 0 .../tst_tape/empty.vit | 0 .../tst_tape/keiko.vit | 0 src/test/CollectionTest/tst_tape/text.vit | 0 src/test/CollectionTest/tst_tape/text.vst | 0 .../tst_tapecommandline.cpp | 0 .../tst_tapecommandline.h | 0 .../tst_valentina/empty.val | 0 .../tst_valentina/glimited.vit | 0 .../tst_valentina/glimited.vst | 0 .../tst_valentina/glimited_no_m.val | 0 .../tst_valentina/glimited_vit.val | 0 .../tst_valentina/glimited_vst.val | 0 .../tst_valentina/issue_256.val} | 0 .../tst_valentina/issue_256_correct.vit | 0 .../tst_valentina/issue_256_correct.vst | 0 .../tst_valentina/issue_256_wrong.vit | 0 .../tst_valentina/issue_256_wrong.vst | 0 .../tst_valentina/issue_256_wrong_path.val | 37 +++ .../tst_valentina/issue_372.val | 0 .../CollectionTest/tst_valentina/text.val | 0 .../tst_valentina/wrong_formula.val | 0 .../tst_valentina/wrong_obj_type.val | 0 .../tst_valentinacommandline.cpp | 0 .../tst_valentinacommandline.h | 0 src/test/CollectionTest/warnings.pri | 49 ++++ src/test/TranslationsTest/stable.h | 2 +- src/test/ValentinaTest/ValentinaTest.pro | 103 ------- src/test/ValentinaTest/qttestmainlambda.cpp | 4 - src/test/test.pro | 3 +- 43 files changed, 521 insertions(+), 109 deletions(-) create mode 100644 src/test/CollectionTest/CollectionTest.pro create mode 100644 src/test/CollectionTest/qttestmainlambda.cpp create mode 100644 src/test/CollectionTest/stable.cpp create mode 100644 src/test/CollectionTest/stable.h rename src/test/{ValentinaTest => CollectionTest}/tst_tape/GOST_man_ru_v0.3.0.vst (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tape/GOST_man_ru_v0.4.2.vst (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tape/all_measurements_v0.3.0.vit (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tape/all_measurements_v0.3.3.vit (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tape/all_measurements_v0.4.0.vst (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tape/all_measurements_v0.4.2.vst (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tape/broken1.vit (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tape/broken2.vit (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tape/broken3.vit (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tape/broken4.vit (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tape/empty.vit (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tape/keiko.vit (100%) create mode 100644 src/test/CollectionTest/tst_tape/text.vit create mode 100644 src/test/CollectionTest/tst_tape/text.vst rename src/test/{ValentinaTest => CollectionTest}/tst_tapecommandline.cpp (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_tapecommandline.h (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/empty.val (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/glimited.vit (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/glimited.vst (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/glimited_no_m.val (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/glimited_vit.val (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/glimited_vst.val (100%) rename src/test/{ValentinaTest/tst_valentina/issue_256_wrong_path.val => CollectionTest/tst_valentina/issue_256.val} (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/issue_256_correct.vit (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/issue_256_correct.vst (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/issue_256_wrong.vit (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/issue_256_wrong.vst (100%) create mode 100644 src/test/CollectionTest/tst_valentina/issue_256_wrong_path.val rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/issue_372.val (100%) create mode 100644 src/test/CollectionTest/tst_valentina/text.val rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/wrong_formula.val (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentina/wrong_obj_type.val (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentinacommandline.cpp (100%) rename src/test/{ValentinaTest => CollectionTest}/tst_valentinacommandline.h (100%) create mode 100644 src/test/CollectionTest/warnings.pri diff --git a/src/test/CollectionTest/CollectionTest.pro b/src/test/CollectionTest/CollectionTest.pro new file mode 100644 index 000000000..b5328e852 --- /dev/null +++ b/src/test/CollectionTest/CollectionTest.pro @@ -0,0 +1,273 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2016-08-04T19:29:55 +# +#------------------------------------------------- + +QT += testlib widgets + +QT -= gui + +TARGET = CollectionTest + +# File with common stuff for whole project +include(../../../common.pri) + +TEMPLATE = app + +# CONFIG += testcase adds a 'make check' which is great. But by default it also +# adds a 'make install' that installs the test cases, which we do not want. +# Can configure it not to do that with 'no_testcase_installs' +# We use C++11 standard +CONFIG += c++11 testcase no_testcase_installs + +# Use out-of-source builds (shadow builds) +CONFIG -= app_bundle debug_and_release debug_and_release_target + +# directory for executable file +DESTDIR = bin + +# Directory for files created moc +MOC_DIR = moc + +# objecs files +OBJECTS_DIR = obj + +DEFINES += SRCDIR=\\\"$$PWD/\\\" + +SOURCES += \ + qttestmainlambda.cpp \ + tst_tapecommandline.cpp \ + tst_valentinacommandline.cpp + +win32-msvc*:SOURCES += stable.cpp + +HEADERS += \ + stable.h \ + tst_tapecommandline.h \ + tst_valentinacommandline.h + +# Set using ccache. Function enable_ccache() defined in common.pri. +$$enable_ccache() + +CONFIG(debug, debug|release){ + # Debug mode + unix { + include(warnings.pri) + } else { + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + } + } +}else{ + # Release mode + !win32-msvc*:CONFIG += silent + DEFINES += V_NO_ASSERT + !unix:*-g++{ + QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll + } + + checkWarnings{ + unix:include(warnings.pri) + } + + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols + # do nothing + } else { + # Turn on debug symbols in release mode on Unix systems. + # On Mac OS X temporarily disabled. Need find way how to strip binary file. + !macx:!win32-msvc*{ + QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_LFLAGS_RELEASE = + } + } +} + +##VTools static library (depend on VWidgets, VMisc, VPatternDB) +#unix|win32: LIBS += -L$$OUT_PWD/../../libs/vtools/$${DESTDIR}/ -lvtools + +#INCLUDEPATH += $$PWD/../../libs/vtools +#DEPENDPATH += $$PWD/../../libs/vtools + +#win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vtools/$${DESTDIR}/vtools.lib +#else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vtools/$${DESTDIR}/libvtools.a + +##VWidgets static library +#unix|win32: LIBS += -L$$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/ -lvwidgets + +#INCLUDEPATH += $$PWD/../../libs/vwidgets +#DEPENDPATH += $$PWD/../../libs/vwidgets + +#win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/vwidgets.lib +#else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/libvwidgets.a + +## VFormat static library (depend on VPatternDB, IFC) +#unix|win32: LIBS += -L$$OUT_PWD/../../libs/vformat/$${DESTDIR}/ -lvformat + +#INCLUDEPATH += $$PWD/../../libs/vformat +#DEPENDPATH += $$PWD/../../libs/vformat + +#win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vformat/$${DESTDIR}/vformat.lib +#else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vformat/$${DESTDIR}/libvformat.a + +#VPatternDB static library (depend on vgeometry, vmisc, VLayout) +#unix|win32: LIBS += -L$$OUT_PWD/../../libs/vpatterndb/$${DESTDIR} -lvpatterndb + +#INCLUDEPATH += $$PWD/../../libs/vpatterndb +#DEPENDPATH += $$PWD/../../libs/vpatterndb + +#win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib +#else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/libvpatterndb.a + +#VMisc static library +unix|win32: LIBS += -L$$OUT_PWD/../../libs/vmisc/$${DESTDIR} -lvmisc + +INCLUDEPATH += $$PWD/../../libs/vmisc +DEPENDPATH += $$PWD/../../libs/vmisc + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/vmisc.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/libvmisc.a + +## VGeometry static library (depend on ifc) +#unix|win32: LIBS += -L$$OUT_PWD/../../libs/vgeometry/$${DESTDIR} -lvgeometry + +#INCLUDEPATH += $$PWD/../../libs/vgeometry +#DEPENDPATH += $$PWD/../../libs/vgeometry + +#win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/vgeometry.lib +#else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/libvgeometry.a + +# IFC static library (depend on QMuParser) +#unix|win32: LIBS += -L$$OUT_PWD/../../libs/ifc/$${DESTDIR}/ -lifc + +#INCLUDEPATH += $$PWD/../../libs/ifc +#DEPENDPATH += $$PWD/../../libs/ifc + +#win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/ifc.lib +#else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/libifc.a + +## VLayout static library +#unix|win32: LIBS += -L$$OUT_PWD/../../libs/vlayout/$${DESTDIR} -lvlayout + +#INCLUDEPATH += $$PWD/../../libs/vlayout +#DEPENDPATH += $$PWD/../../libs/vlayout + +#win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vlayout/$${DESTDIR}/vlayout.lib +#else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vlayout/$${DESTDIR}/libvlayout.a + +# QMuParser library +#win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../../libs/qmuparser/$${DESTDIR} -lqmuparser2 +#else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../../libs/qmuparser/$${DESTDIR} -lqmuparser2 +#else:unix: LIBS += -L$${OUT_PWD}/../../libs/qmuparser/$${DESTDIR} -lqmuparser + +#INCLUDEPATH += $${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 \ + tst_tape/empty.vit \ + tst_tape/all_measurements_v0.3.0.vit \ + tst_tape/all_measurements_v0.4.0.vst \ + tst_tape/GOST_man_ru_v0.3.0.vst \ + tst_tape/all_measurements_v0.3.3.vit \ + tst_tape/all_measurements_v0.4.2.vst \ + tst_tape/GOST_man_ru_v0.4.2.vst \ + tst_tape/broken1.vit \ + tst_tape/broken2.vit \ + tst_tape/broken3.vit \ + tst_tape/broken4.vit \ + tst_tape/text.vit \ + tst_tape/text.vst + +VALENTINA_TEST_FILES += \ + tst_valentina/empty.val \ + tst_valentina/issue_372.val \ + tst_valentina/wrong_obj_type.val \ + tst_valentina/text.val \ + tst_valentina/glimited_no_m.val \ + tst_valentina/glimited_vit.val \ + tst_valentina/glimited.vit \ + tst_valentina/glimited_vst.val \ + tst_valentina/glimited.vst \ + tst_valentina/issue_256.val \ + tst_valentina/issue_256_wrong_path.val \ + tst_valentina/issue_256_correct.vit \ + tst_valentina/issue_256_wrong.vit \ + tst_valentina/issue_256_correct.vst \ + tst_valentina/issue_256_wrong.vit \ + tst_valentina/wrong_formula.val + +COLLECTION_FILES += \ + $${PWD}/../../app/share/tables/standard/GOST_man_ru.vst \ + $${PWD}/../../app/share/collection/bra.val \ + $${PWD}/../../app/share/collection/bra.vit \ + $${PWD}/../../app/share/collection/jacketМ1_52-176.val \ + $${PWD}/../../app/share/collection/jacketМ2_40-146.val \ + $${PWD}/../../app/share/collection/jacketМ3_40-146.val \ + $${PWD}/../../app/share/collection/jacketМ4_40-146.val \ + $${PWD}/../../app/share/collection/jacketМ5_30-110.val \ + $${PWD}/../../app/share/collection/jacketМ6_30-110.val \ + $${PWD}/../../app/share/collection/pantsМ1_52-176.val \ + $${PWD}/../../app/share/collection/pantsМ2_40-146.val \ + $${PWD}/../../app/share/collection/pantsМ7.val \ + $${PWD}/../../app/share/collection/TShirt_test.val \ + $${PWD}/../../app/share/collection/TestDart.val \ + $${PWD}/../../app/share/collection/patrón_blusa.val \ + $${PWD}/../../app/share/collection/blusa.vit \ + $${PWD}/../../app/share/collection/PajamaTopWrap2.val \ + $${PWD}/../../app/share/collection/Susan.vit \ + $${PWD}/../../app/share/collection/Moulage_0.5_armhole_neckline.val \ + $${PWD}/../../app/share/collection/0.7_Armhole_adjustment_0.10.val \ + $${PWD}/../../app/share/collection/my_calculated_measurements_for_val.vit \ + $${PWD}/../../app/share/collection/Keiko_skirt.val \ + $${PWD}/../../app/share/collection/keiko.vit \ + $${PWD}/../../app/share/collection/medidas_eli2015.vit \ + $${PWD}/../../app/share/collection/pantalon_base_Eli.val \ + $${PWD}/../../app/share/collection/Razmernye_priznaki_dlya_zhenskogo_zhaketa.vit \ + $${PWD}/../../app/share/collection/IMK_Zhaketa_poluprilegayuschego_silueta.val \ + $${PWD}/../../app/share/collection/Lara_Jil.vit \ + $${PWD}/../../app/share/collection/modell_2.val \ + $${PWD}/../../app/share/collection/MaleShirt/MaleShirt.val \ + $${PWD}/../../app/share/collection/MaleShirt/MaleShirt.vit \ + $${PWD}/../../app/share/collection/Trousers/Trousers.val \ + $${PWD}/../../app/share/collection/Trousers/trousers.vit + +# Compilation will fail without this files after we added them to this section. +OTHER_FILES += \ + $$TAPE_TEST_FILES \ + $$VALENTINA_TEST_FILES \ + $$COLLECTION_FILES + +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)) + +for(DIR, VALENTINA_TEST_FILES) { + #add these absolute paths to a variable which + #ends up as 'mkcommands = path1 path2 path3 ...' + valentina_path += $${PWD}/$$DIR +} + +copyToDestdir($$valentina_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tst_valentina)) + +for(DIR, COLLECTION_FILES) { + #add these absolute paths to a variable which + #ends up as 'mkcommands = path1 path2 path3 ...' + collection_path += $$DIR +} + +copyToDestdir($$collection_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tst_valentina_collection)) diff --git a/src/test/CollectionTest/qttestmainlambda.cpp b/src/test/CollectionTest/qttestmainlambda.cpp new file mode 100644 index 000000000..98e8a6e11 --- /dev/null +++ b/src/test/CollectionTest/qttestmainlambda.cpp @@ -0,0 +1,49 @@ +/************************************************************************ + ** + ** @file qttestmainlambda.cpp + ** @author Roman Telezhynskyi + ** @date 31 3, 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 + ** 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 . + ** + *************************************************************************/ + +#include + +#include "tst_tapecommandline.h" +#include "tst_valentinacommandline.h" + +int main(int argc, char** argv) +{ + QApplication app( argc, argv ); + + int status = 0; + auto ASSERT_TEST = [&status, argc, argv](QObject* obj) + { + status |= QTest::qExec(obj, argc, argv); + delete obj; + }; + + ASSERT_TEST(new TST_TapeCommandLine()); + ASSERT_TEST(new TST_ValentinaCommandLine()); + + return status; +} diff --git a/src/test/CollectionTest/stable.cpp b/src/test/CollectionTest/stable.cpp new file mode 100644 index 000000000..e291c2801 --- /dev/null +++ b/src/test/CollectionTest/stable.cpp @@ -0,0 +1,30 @@ +/************************************************************************ + ** + ** @file stable.cpp + ** @author Roman Telezhynskyi + ** @date November 15, 2013 + ** + ** @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) 2013-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +// Build the precompiled headers. +#include "stable.h" diff --git a/src/test/CollectionTest/stable.h b/src/test/CollectionTest/stable.h new file mode 100644 index 000000000..5958f1c16 --- /dev/null +++ b/src/test/CollectionTest/stable.h @@ -0,0 +1,80 @@ +/************************************************************************ + ** + ** @file stable.h + ** @author Roman Telezhynskyi + ** @date November 15, 2013 + ** + ** @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) 2013-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef STABLE_H +#define STABLE_H + +/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ +#pragma message("Compiling precompiled headers for Collection Test.\n") + +/* Add C includes here */ + +#if defined __cplusplus +/* Add C++ includes here */ +#include + +/*In all cases we need include core header for getting defined values*/ +#ifdef QT_CORE_LIB +# include +#endif + +#ifdef QT_GUI_LIB +# include +#endif + +#ifdef QT_XML_LIB +# include +#endif + +//In Windows you can't use same header in all modes. +#if !defined(Q_OS_WIN) +# ifdef QT_WIDGETS_LIB +# include +# endif + +# ifdef QT_SVG_LIB +# include +# endif + +# ifdef QT_PRINTSUPPORT_LIB +# include +# endif + + //Build doesn't work, if include this headers on Windows. +# ifdef QT_XMLPATTERNS_LIB +# include +# endif + +# ifdef QT_NETWORK_LIB +# include +# endif +#endif/*Q_OS_WIN*/ + +#endif /*__cplusplus*/ + +#endif // STABLE_H diff --git a/src/test/ValentinaTest/tst_tape/GOST_man_ru_v0.3.0.vst b/src/test/CollectionTest/tst_tape/GOST_man_ru_v0.3.0.vst similarity index 100% rename from src/test/ValentinaTest/tst_tape/GOST_man_ru_v0.3.0.vst rename to src/test/CollectionTest/tst_tape/GOST_man_ru_v0.3.0.vst diff --git a/src/test/ValentinaTest/tst_tape/GOST_man_ru_v0.4.2.vst b/src/test/CollectionTest/tst_tape/GOST_man_ru_v0.4.2.vst similarity index 100% rename from src/test/ValentinaTest/tst_tape/GOST_man_ru_v0.4.2.vst rename to src/test/CollectionTest/tst_tape/GOST_man_ru_v0.4.2.vst diff --git a/src/test/ValentinaTest/tst_tape/all_measurements_v0.3.0.vit b/src/test/CollectionTest/tst_tape/all_measurements_v0.3.0.vit similarity index 100% rename from src/test/ValentinaTest/tst_tape/all_measurements_v0.3.0.vit rename to src/test/CollectionTest/tst_tape/all_measurements_v0.3.0.vit diff --git a/src/test/ValentinaTest/tst_tape/all_measurements_v0.3.3.vit b/src/test/CollectionTest/tst_tape/all_measurements_v0.3.3.vit similarity index 100% rename from src/test/ValentinaTest/tst_tape/all_measurements_v0.3.3.vit rename to src/test/CollectionTest/tst_tape/all_measurements_v0.3.3.vit diff --git a/src/test/ValentinaTest/tst_tape/all_measurements_v0.4.0.vst b/src/test/CollectionTest/tst_tape/all_measurements_v0.4.0.vst similarity index 100% rename from src/test/ValentinaTest/tst_tape/all_measurements_v0.4.0.vst rename to src/test/CollectionTest/tst_tape/all_measurements_v0.4.0.vst diff --git a/src/test/ValentinaTest/tst_tape/all_measurements_v0.4.2.vst b/src/test/CollectionTest/tst_tape/all_measurements_v0.4.2.vst similarity index 100% rename from src/test/ValentinaTest/tst_tape/all_measurements_v0.4.2.vst rename to src/test/CollectionTest/tst_tape/all_measurements_v0.4.2.vst diff --git a/src/test/ValentinaTest/tst_tape/broken1.vit b/src/test/CollectionTest/tst_tape/broken1.vit similarity index 100% rename from src/test/ValentinaTest/tst_tape/broken1.vit rename to src/test/CollectionTest/tst_tape/broken1.vit diff --git a/src/test/ValentinaTest/tst_tape/broken2.vit b/src/test/CollectionTest/tst_tape/broken2.vit similarity index 100% rename from src/test/ValentinaTest/tst_tape/broken2.vit rename to src/test/CollectionTest/tst_tape/broken2.vit diff --git a/src/test/ValentinaTest/tst_tape/broken3.vit b/src/test/CollectionTest/tst_tape/broken3.vit similarity index 100% rename from src/test/ValentinaTest/tst_tape/broken3.vit rename to src/test/CollectionTest/tst_tape/broken3.vit diff --git a/src/test/ValentinaTest/tst_tape/broken4.vit b/src/test/CollectionTest/tst_tape/broken4.vit similarity index 100% rename from src/test/ValentinaTest/tst_tape/broken4.vit rename to src/test/CollectionTest/tst_tape/broken4.vit diff --git a/src/test/ValentinaTest/tst_tape/empty.vit b/src/test/CollectionTest/tst_tape/empty.vit similarity index 100% rename from src/test/ValentinaTest/tst_tape/empty.vit rename to src/test/CollectionTest/tst_tape/empty.vit diff --git a/src/test/ValentinaTest/tst_tape/keiko.vit b/src/test/CollectionTest/tst_tape/keiko.vit similarity index 100% rename from src/test/ValentinaTest/tst_tape/keiko.vit rename to src/test/CollectionTest/tst_tape/keiko.vit diff --git a/src/test/CollectionTest/tst_tape/text.vit b/src/test/CollectionTest/tst_tape/text.vit new file mode 100644 index 000000000..e69de29bb diff --git a/src/test/CollectionTest/tst_tape/text.vst b/src/test/CollectionTest/tst_tape/text.vst new file mode 100644 index 000000000..e69de29bb diff --git a/src/test/ValentinaTest/tst_tapecommandline.cpp b/src/test/CollectionTest/tst_tapecommandline.cpp similarity index 100% rename from src/test/ValentinaTest/tst_tapecommandline.cpp rename to src/test/CollectionTest/tst_tapecommandline.cpp diff --git a/src/test/ValentinaTest/tst_tapecommandline.h b/src/test/CollectionTest/tst_tapecommandline.h similarity index 100% rename from src/test/ValentinaTest/tst_tapecommandline.h rename to src/test/CollectionTest/tst_tapecommandline.h diff --git a/src/test/ValentinaTest/tst_valentina/empty.val b/src/test/CollectionTest/tst_valentina/empty.val similarity index 100% rename from src/test/ValentinaTest/tst_valentina/empty.val rename to src/test/CollectionTest/tst_valentina/empty.val diff --git a/src/test/ValentinaTest/tst_valentina/glimited.vit b/src/test/CollectionTest/tst_valentina/glimited.vit similarity index 100% rename from src/test/ValentinaTest/tst_valentina/glimited.vit rename to src/test/CollectionTest/tst_valentina/glimited.vit diff --git a/src/test/ValentinaTest/tst_valentina/glimited.vst b/src/test/CollectionTest/tst_valentina/glimited.vst similarity index 100% rename from src/test/ValentinaTest/tst_valentina/glimited.vst rename to src/test/CollectionTest/tst_valentina/glimited.vst diff --git a/src/test/ValentinaTest/tst_valentina/glimited_no_m.val b/src/test/CollectionTest/tst_valentina/glimited_no_m.val similarity index 100% rename from src/test/ValentinaTest/tst_valentina/glimited_no_m.val rename to src/test/CollectionTest/tst_valentina/glimited_no_m.val diff --git a/src/test/ValentinaTest/tst_valentina/glimited_vit.val b/src/test/CollectionTest/tst_valentina/glimited_vit.val similarity index 100% rename from src/test/ValentinaTest/tst_valentina/glimited_vit.val rename to src/test/CollectionTest/tst_valentina/glimited_vit.val diff --git a/src/test/ValentinaTest/tst_valentina/glimited_vst.val b/src/test/CollectionTest/tst_valentina/glimited_vst.val similarity index 100% rename from src/test/ValentinaTest/tst_valentina/glimited_vst.val rename to src/test/CollectionTest/tst_valentina/glimited_vst.val diff --git a/src/test/ValentinaTest/tst_valentina/issue_256_wrong_path.val b/src/test/CollectionTest/tst_valentina/issue_256.val similarity index 100% rename from src/test/ValentinaTest/tst_valentina/issue_256_wrong_path.val rename to src/test/CollectionTest/tst_valentina/issue_256.val diff --git a/src/test/ValentinaTest/tst_valentina/issue_256_correct.vit b/src/test/CollectionTest/tst_valentina/issue_256_correct.vit similarity index 100% rename from src/test/ValentinaTest/tst_valentina/issue_256_correct.vit rename to src/test/CollectionTest/tst_valentina/issue_256_correct.vit diff --git a/src/test/ValentinaTest/tst_valentina/issue_256_correct.vst b/src/test/CollectionTest/tst_valentina/issue_256_correct.vst similarity index 100% rename from src/test/ValentinaTest/tst_valentina/issue_256_correct.vst rename to src/test/CollectionTest/tst_valentina/issue_256_correct.vst diff --git a/src/test/ValentinaTest/tst_valentina/issue_256_wrong.vit b/src/test/CollectionTest/tst_valentina/issue_256_wrong.vit similarity index 100% rename from src/test/ValentinaTest/tst_valentina/issue_256_wrong.vit rename to src/test/CollectionTest/tst_valentina/issue_256_wrong.vit diff --git a/src/test/ValentinaTest/tst_valentina/issue_256_wrong.vst b/src/test/CollectionTest/tst_valentina/issue_256_wrong.vst similarity index 100% rename from src/test/ValentinaTest/tst_valentina/issue_256_wrong.vst rename to src/test/CollectionTest/tst_valentina/issue_256_wrong.vst diff --git a/src/test/CollectionTest/tst_valentina/issue_256_wrong_path.val b/src/test/CollectionTest/tst_valentina/issue_256_wrong_path.val new file mode 100644 index 000000000..73728c7ca --- /dev/null +++ b/src/test/CollectionTest/tst_valentina/issue_256_wrong_path.val @@ -0,0 +1,37 @@ + + + + 0.2.2 + cm + + + + issue_256_correct.vit + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+
+
diff --git a/src/test/ValentinaTest/tst_valentina/issue_372.val b/src/test/CollectionTest/tst_valentina/issue_372.val similarity index 100% rename from src/test/ValentinaTest/tst_valentina/issue_372.val rename to src/test/CollectionTest/tst_valentina/issue_372.val diff --git a/src/test/CollectionTest/tst_valentina/text.val b/src/test/CollectionTest/tst_valentina/text.val new file mode 100644 index 000000000..e69de29bb diff --git a/src/test/ValentinaTest/tst_valentina/wrong_formula.val b/src/test/CollectionTest/tst_valentina/wrong_formula.val similarity index 100% rename from src/test/ValentinaTest/tst_valentina/wrong_formula.val rename to src/test/CollectionTest/tst_valentina/wrong_formula.val diff --git a/src/test/ValentinaTest/tst_valentina/wrong_obj_type.val b/src/test/CollectionTest/tst_valentina/wrong_obj_type.val similarity index 100% rename from src/test/ValentinaTest/tst_valentina/wrong_obj_type.val rename to src/test/CollectionTest/tst_valentina/wrong_obj_type.val diff --git a/src/test/ValentinaTest/tst_valentinacommandline.cpp b/src/test/CollectionTest/tst_valentinacommandline.cpp similarity index 100% rename from src/test/ValentinaTest/tst_valentinacommandline.cpp rename to src/test/CollectionTest/tst_valentinacommandline.cpp diff --git a/src/test/ValentinaTest/tst_valentinacommandline.h b/src/test/CollectionTest/tst_valentinacommandline.h similarity index 100% rename from src/test/ValentinaTest/tst_valentinacommandline.h rename to src/test/CollectionTest/tst_valentinacommandline.h diff --git a/src/test/CollectionTest/warnings.pri b/src/test/CollectionTest/warnings.pri new file mode 100644 index 000000000..3d7b19eed --- /dev/null +++ b/src/test/CollectionTest/warnings.pri @@ -0,0 +1,49 @@ +#Turn on compilers warnings. +*-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } + + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer + # do nothing + } else { + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS += -fsanitize=address + } +} + +clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS \ # See common.pri for more details. + -Wno-gnu-zero-variadic-macro-arguments\ # See macros QSKIP + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } +} + +*-icc-*{ + QMAKE_CXXFLAGS += \ + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$ICC_DEBUG_CXXFLAGS + + checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings + QMAKE_CXXFLAGS += -Werror + } +} diff --git a/src/test/TranslationsTest/stable.h b/src/test/TranslationsTest/stable.h index 93244b24a..4cefd21b0 100644 --- a/src/test/TranslationsTest/stable.h +++ b/src/test/TranslationsTest/stable.h @@ -30,7 +30,7 @@ #define STABLE_H /* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ -#pragma message("Compiling precompiled headers for Valentina tests.\n") +#pragma message("Compiling precompiled headers for Translation Tests.\n") /* Add C includes here */ diff --git a/src/test/ValentinaTest/ValentinaTest.pro b/src/test/ValentinaTest/ValentinaTest.pro index 10bcde087..af2d83636 100644 --- a/src/test/ValentinaTest/ValentinaTest.pro +++ b/src/test/ValentinaTest/ValentinaTest.pro @@ -41,8 +41,6 @@ SOURCES += \ tst_nameregexp.cpp \ tst_vlayoutdetail.cpp \ tst_varc.cpp \ - tst_tapecommandline.cpp \ - tst_valentinacommandline.cpp \ tst_qmutokenparser.cpp \ tst_vmeasurements.cpp \ tst_vlockguard.cpp \ @@ -64,8 +62,6 @@ HEADERS += \ tst_vlayoutdetail.h \ tst_varc.h \ stable.h \ - tst_tapecommandline.h \ - tst_valentinacommandline.h \ tst_qmutokenparser.h \ tst_vmeasurements.h \ tst_vlockguard.h \ @@ -202,102 +198,3 @@ else:unix: LIBS += -L$${OUT_PWD}/../../libs/vpropertyexplorer/$${DESTDIR} -lvpro INCLUDEPATH += $${PWD}/../../libs/vpropertyexplorer DEPENDPATH += $${PWD}/../../libs/vpropertyexplorer - -TAPE_TEST_FILES += \ - tst_tape/keiko.vit \ - tst_tape/empty.vit \ - tst_tape/all_measurements_v0.3.0.vit \ - tst_tape/all_measurements_v0.4.0.vst \ - tst_tape/GOST_man_ru_v0.3.0.vst \ - tst_tape/all_measurements_v0.3.3.vit \ - tst_tape/all_measurements_v0.4.2.vst \ - tst_tape/GOST_man_ru_v0.4.2.vst \ - tst_tape/broken1.vit \ - tst_tape/broken2.vit \ - tst_tape/broken3.vit \ - tst_tape/broken4.vit \ - tst_tape/text.vit \ - tst_tape/text.vst - -VALENTINA_TEST_FILES += \ - tst_valentina/empty.val \ - tst_valentina/issue_372.val \ - tst_valentina/wrong_obj_type.val \ - tst_valentina/text.val \ - tst_valentina/glimited_no_m.val \ - tst_valentina/glimited_vit.val \ - tst_valentina/glimited.vit \ - tst_valentina/glimited_vst.val \ - tst_valentina/glimited.vst \ - tst_valentina/issue_256.val \ - tst_valentina/issue_256_wrong_path.val \ - tst_valentina/issue_256_correct.vit \ - tst_valentina/issue_256_wrong.vit \ - tst_valentina/issue_256_correct.vst \ - tst_valentina/issue_256_wrong.vit \ - tst_valentina/wrong_formula.val - -COLLECTION_FILES += \ - $${PWD}/../../app/share/tables/standard/GOST_man_ru.vst \ - $${PWD}/../../app/share/collection/bra.val \ - $${PWD}/../../app/share/collection/bra.vit \ - $${PWD}/../../app/share/collection/jacketМ1_52-176.val \ - $${PWD}/../../app/share/collection/jacketМ2_40-146.val \ - $${PWD}/../../app/share/collection/jacketМ3_40-146.val \ - $${PWD}/../../app/share/collection/jacketМ4_40-146.val \ - $${PWD}/../../app/share/collection/jacketМ5_30-110.val \ - $${PWD}/../../app/share/collection/jacketМ6_30-110.val \ - $${PWD}/../../app/share/collection/pantsМ1_52-176.val \ - $${PWD}/../../app/share/collection/pantsМ2_40-146.val \ - $${PWD}/../../app/share/collection/pantsМ7.val \ - $${PWD}/../../app/share/collection/TShirt_test.val \ - $${PWD}/../../app/share/collection/TestDart.val \ - $${PWD}/../../app/share/collection/patrón_blusa.val \ - $${PWD}/../../app/share/collection/blusa.vit \ - $${PWD}/../../app/share/collection/PajamaTopWrap2.val \ - $${PWD}/../../app/share/collection/Susan.vit \ - $${PWD}/../../app/share/collection/Moulage_0.5_armhole_neckline.val \ - $${PWD}/../../app/share/collection/0.7_Armhole_adjustment_0.10.val \ - $${PWD}/../../app/share/collection/my_calculated_measurements_for_val.vit \ - $${PWD}/../../app/share/collection/Keiko_skirt.val \ - $${PWD}/../../app/share/collection/keiko.vit \ - $${PWD}/../../app/share/collection/medidas_eli2015.vit \ - $${PWD}/../../app/share/collection/pantalon_base_Eli.val \ - $${PWD}/../../app/share/collection/Razmernye_priznaki_dlya_zhenskogo_zhaketa.vit \ - $${PWD}/../../app/share/collection/IMK_Zhaketa_poluprilegayuschego_silueta.val \ - $${PWD}/../../app/share/collection/Lara_Jil.vit \ - $${PWD}/../../app/share/collection/modell_2.val \ - $${PWD}/../../app/share/collection/MaleShirt/MaleShirt.val \ - $${PWD}/../../app/share/collection/MaleShirt/MaleShirt.vit \ - $${PWD}/../../app/share/collection/Trousers/Trousers.val \ - $${PWD}/../../app/share/collection/Trousers/trousers.vit - -# Compilation will fail without this files after we added them to this section. -OTHER_FILES += \ - $$TAPE_TEST_FILES \ - $$VALENTINA_TEST_FILES \ - $$COLLECTION_FILES - -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)) - -for(DIR, VALENTINA_TEST_FILES) { - #add these absolute paths to a variable which - #ends up as 'mkcommands = path1 path2 path3 ...' - valentina_path += $${PWD}/$$DIR -} - -copyToDestdir($$valentina_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tst_valentina)) - -for(DIR, COLLECTION_FILES) { - #add these absolute paths to a variable which - #ends up as 'mkcommands = path1 path2 path3 ...' - collection_path += $$DIR -} - -copyToDestdir($$collection_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tst_valentina_collection)) diff --git a/src/test/ValentinaTest/qttestmainlambda.cpp b/src/test/ValentinaTest/qttestmainlambda.cpp index 6bd06ab19..cbf42dd43 100644 --- a/src/test/ValentinaTest/qttestmainlambda.cpp +++ b/src/test/ValentinaTest/qttestmainlambda.cpp @@ -35,8 +35,6 @@ #include "tst_vlayoutdetail.h" #include "tst_varc.h" #include "tst_vellipticalarc.h" -#include "tst_tapecommandline.h" -#include "tst_valentinacommandline.h" #include "tst_qmutokenparser.h" #include "tst_vmeasurements.h" #include "tst_vlockguard.h" @@ -71,8 +69,6 @@ int main(int argc, char** argv) ASSERT_TEST(new TST_VLayoutDetail()); ASSERT_TEST(new TST_VArc()); ASSERT_TEST(new TST_VEllipticalArc()); - ASSERT_TEST(new TST_TapeCommandLine()); - ASSERT_TEST(new TST_ValentinaCommandLine()); ASSERT_TEST(new TST_QmuTokenParser()); ASSERT_TEST(new TST_VMeasurements()); ASSERT_TEST(new TST_VLockGuard()); diff --git a/src/test/test.pro b/src/test/test.pro index 8070d6122..8f6029161 100644 --- a/src/test/test.pro +++ b/src/test/test.pro @@ -2,4 +2,5 @@ TEMPLATE = subdirs SUBDIRS = \ ParserTest \ ValentinaTest \ - TranslationsTest + TranslationsTest \ + CollectionTest