From 8f78b3171011d25ab239c7b6550b1ef6c65ec1e1 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 4 Aug 2016 19:28:28 +0300 Subject: [PATCH] Translation unit tests moved to separate binary. --HG-- branch : develop --- .../vmisc}/abstracttest.cpp | 4 +- .../vmisc}/abstracttest.h | 0 src/libs/vmisc/vmisc.pri | 6 +- src/libs/vmisc/vmisc.pro | 2 +- src/test/ParserTest/ParserTest.pro | 5 +- .../TranslationsTest/TranslationsTest.pro | 178 ++++++++++++++++++ .../TranslationsTest/qttestmainlambda.cpp | 69 +++++++ src/test/TranslationsTest/stable.cpp | 30 +++ src/test/TranslationsTest/stable.h | 80 ++++++++ .../tst_measurementregexp.cpp | 0 .../tst_measurementregexp.h | 2 +- .../tst_qmuparsererrormsg.cpp | 0 .../tst_qmuparsererrormsg.h | 2 +- .../tst_tstranslation.cpp | 0 .../tst_tstranslation.h | 0 src/test/TranslationsTest/warnings.pri | 49 +++++ src/test/ValentinaTest/ValentinaTest.pro | 13 +- src/test/ValentinaTest/qttestmainlambda.cpp | 21 --- src/test/ValentinaTest/tst_tapecommandline.h | 2 +- src/test/ValentinaTest/tst_vabstractcurve.h | 2 +- src/test/ValentinaTest/tst_vabstractdetail.h | 2 +- .../ValentinaTest/tst_valentinacommandline.h | 2 +- src/test/ValentinaTest/tst_vdetail.h | 2 +- src/test/ValentinaTest/tst_vlayoutdetail.h | 2 +- src/test/ValentinaTest/tst_vspline.h | 2 +- src/test/test.pro | 3 +- 26 files changed, 429 insertions(+), 49 deletions(-) rename src/{test/ValentinaTest => libs/vmisc}/abstracttest.cpp (99%) rename src/{test/ValentinaTest => libs/vmisc}/abstracttest.h (100%) create mode 100644 src/test/TranslationsTest/TranslationsTest.pro create mode 100644 src/test/TranslationsTest/qttestmainlambda.cpp create mode 100644 src/test/TranslationsTest/stable.cpp create mode 100644 src/test/TranslationsTest/stable.h rename src/test/{ValentinaTest => TranslationsTest}/tst_measurementregexp.cpp (100%) rename src/test/{ValentinaTest => TranslationsTest}/tst_measurementregexp.h (98%) rename src/test/{ValentinaTest => TranslationsTest}/tst_qmuparsererrormsg.cpp (100%) rename src/test/{ValentinaTest => TranslationsTest}/tst_qmuparsererrormsg.h (98%) rename src/test/{ValentinaTest => TranslationsTest}/tst_tstranslation.cpp (100%) rename src/test/{ValentinaTest => TranslationsTest}/tst_tstranslation.h (100%) create mode 100644 src/test/TranslationsTest/warnings.pri diff --git a/src/test/ValentinaTest/abstracttest.cpp b/src/libs/vmisc/abstracttest.cpp similarity index 99% rename from src/test/ValentinaTest/abstracttest.cpp rename to src/libs/vmisc/abstracttest.cpp index a8d4ce5c8..5cd46307e 100644 --- a/src/test/ValentinaTest/abstracttest.cpp +++ b/src/libs/vmisc/abstracttest.cpp @@ -27,8 +27,8 @@ *************************************************************************/ #include "abstracttest.h" -#include "../vmisc/logging.h" -#include "../vmisc/vsysexits.h" +#include "logging.h" +#include "vsysexits.h" #include diff --git a/src/test/ValentinaTest/abstracttest.h b/src/libs/vmisc/abstracttest.h similarity index 100% rename from src/test/ValentinaTest/abstracttest.h rename to src/libs/vmisc/abstracttest.h diff --git a/src/libs/vmisc/vmisc.pri b/src/libs/vmisc/vmisc.pri index fbfb5e6d4..5ff9195dc 100644 --- a/src/libs/vmisc/vmisc.pri +++ b/src/libs/vmisc/vmisc.pri @@ -11,7 +11,8 @@ SOURCES += \ $$PWD/vtapesettings.cpp \ $$PWD/commandoptions.cpp \ $$PWD/qxtcsvmodel.cpp \ - $$PWD/vtablesearch.cpp + $$PWD/vtablesearch.cpp \ + $$PWD/abstracttest.cpp win32-msvc*:SOURCES += $$PWD/stable.cpp @@ -31,7 +32,8 @@ HEADERS += \ $$PWD/vsysexits.h \ $$PWD/commandoptions.h \ $$PWD/qxtcsvmodel.h \ - $$PWD/vtablesearch.h + $$PWD/vtablesearch.h \ + $$PWD/abstracttest.h # Qt's versions # 5.0.0, 5.0.1, 5.0.2 diff --git a/src/libs/vmisc/vmisc.pro b/src/libs/vmisc/vmisc.pro index 3f5ccb29b..2a8d84769 100644 --- a/src/libs/vmisc/vmisc.pro +++ b/src/libs/vmisc/vmisc.pro @@ -7,7 +7,7 @@ # File with common stuff for whole project include(../../../common.pri) -QT += widgets printsupport +QT += widgets printsupport testlib # Name of library TARGET = vmisc diff --git a/src/test/ParserTest/ParserTest.pro b/src/test/ParserTest/ParserTest.pro index 0a7a88068..e1fe7c9c2 100644 --- a/src/test/ParserTest/ParserTest.pro +++ b/src/test/ParserTest/ParserTest.pro @@ -42,8 +42,9 @@ HEADERS += \ stable.h SOURCES += \ - main.cpp \ - stable.cpp + main.cpp + +win32-msvc*:SOURCES += stable.cpp # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() diff --git a/src/test/TranslationsTest/TranslationsTest.pro b/src/test/TranslationsTest/TranslationsTest.pro new file mode 100644 index 000000000..a74797712 --- /dev/null +++ b/src/test/TranslationsTest/TranslationsTest.pro @@ -0,0 +1,178 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2016-08-04T16:33:17 +# +#------------------------------------------------- + +QT += testlib widgets xml printsupport + +QT -= gui + +TARGET = TranslationsTest + +# File with common stuff for whole project +include(../../../common.pri) + +# 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 + +TEMPLATE = app + +# 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_measurementregexp.cpp \ + tst_qmuparsererrormsg.cpp \ + tst_tstranslation.cpp + +win32-msvc*:SOURCES += stable.cpp + +HEADERS += \ + stable.h \ + tst_measurementregexp.h \ + tst_qmuparsererrormsg.h \ + tst_tstranslation.h + +# Set using ccache. Function enable_ccache() defined in common.pri. +$$enable_ccache() + +DEFINES += TS_DIR=\\\"$${PWD}/../../../share/translations\\\" + +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 diff --git a/src/test/TranslationsTest/qttestmainlambda.cpp b/src/test/TranslationsTest/qttestmainlambda.cpp new file mode 100644 index 000000000..a8db16c5e --- /dev/null +++ b/src/test/TranslationsTest/qttestmainlambda.cpp @@ -0,0 +1,69 @@ +/************************************************************************ + ** + ** @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_measurementregexp.h" +#include "tst_qmuparsererrormsg.h" +#include "tst_tstranslation.h" + +#include "../vmisc/def.h" + +int main(int argc, char** argv) +{ + QApplication app( argc, argv );// For translation + + int status = 0; + auto ASSERT_TEST = [&status, argc, argv](QObject* obj) + { + status |= QTest::qExec(obj, argc, argv); + delete obj; + }; + + ASSERT_TEST(new TST_TSTranslation()); + + { + const QStringList locales = SupportedLocales(); + for(quint32 s = 0; s < TST_MeasurementRegExp::systemCounts; ++s) + { + for(int l = 0, sz = locales.size(); l < sz; ++l) + { + ASSERT_TEST(new TST_MeasurementRegExp(s, locales.at(l))); + } + } + + for(int l = 0, sz = locales.size(); l < sz; ++l) + { + ASSERT_TEST(new TST_QmuParserErrorMsg(locales.at(l))); + } + } + + + + return status; +} diff --git a/src/test/TranslationsTest/stable.cpp b/src/test/TranslationsTest/stable.cpp new file mode 100644 index 000000000..e291c2801 --- /dev/null +++ b/src/test/TranslationsTest/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/TranslationsTest/stable.h b/src/test/TranslationsTest/stable.h new file mode 100644 index 000000000..93244b24a --- /dev/null +++ b/src/test/TranslationsTest/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 Valentina tests.\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_measurementregexp.cpp b/src/test/TranslationsTest/tst_measurementregexp.cpp similarity index 100% rename from src/test/ValentinaTest/tst_measurementregexp.cpp rename to src/test/TranslationsTest/tst_measurementregexp.cpp diff --git a/src/test/ValentinaTest/tst_measurementregexp.h b/src/test/TranslationsTest/tst_measurementregexp.h similarity index 98% rename from src/test/ValentinaTest/tst_measurementregexp.h rename to src/test/TranslationsTest/tst_measurementregexp.h index b9d3ee668..6a65fa238 100644 --- a/src/test/ValentinaTest/tst_measurementregexp.h +++ b/src/test/TranslationsTest/tst_measurementregexp.h @@ -29,7 +29,7 @@ #ifndef TST_MEASUREMENTREGEXP_H #define TST_MEASUREMENTREGEXP_H -#include "abstracttest.h" +#include "../vmisc/abstracttest.h" #include diff --git a/src/test/ValentinaTest/tst_qmuparsererrormsg.cpp b/src/test/TranslationsTest/tst_qmuparsererrormsg.cpp similarity index 100% rename from src/test/ValentinaTest/tst_qmuparsererrormsg.cpp rename to src/test/TranslationsTest/tst_qmuparsererrormsg.cpp diff --git a/src/test/ValentinaTest/tst_qmuparsererrormsg.h b/src/test/TranslationsTest/tst_qmuparsererrormsg.h similarity index 98% rename from src/test/ValentinaTest/tst_qmuparsererrormsg.h rename to src/test/TranslationsTest/tst_qmuparsererrormsg.h index 22656b2bc..9c3f081da 100644 --- a/src/test/ValentinaTest/tst_qmuparsererrormsg.h +++ b/src/test/TranslationsTest/tst_qmuparsererrormsg.h @@ -29,7 +29,7 @@ #ifndef TST_QMUPARSERERRORMSG_H #define TST_QMUPARSERERRORMSG_H -#include "abstracttest.h" +#include "../vmisc/abstracttest.h" #include "../qmuparser/qmuparsererror.h" #include diff --git a/src/test/ValentinaTest/tst_tstranslation.cpp b/src/test/TranslationsTest/tst_tstranslation.cpp similarity index 100% rename from src/test/ValentinaTest/tst_tstranslation.cpp rename to src/test/TranslationsTest/tst_tstranslation.cpp diff --git a/src/test/ValentinaTest/tst_tstranslation.h b/src/test/TranslationsTest/tst_tstranslation.h similarity index 100% rename from src/test/ValentinaTest/tst_tstranslation.h rename to src/test/TranslationsTest/tst_tstranslation.h diff --git a/src/test/TranslationsTest/warnings.pri b/src/test/TranslationsTest/warnings.pri new file mode 100644 index 000000000..3d7b19eed --- /dev/null +++ b/src/test/TranslationsTest/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/ValentinaTest/ValentinaTest.pro b/src/test/ValentinaTest/ValentinaTest.pro index 8c7272185..10bcde087 100644 --- a/src/test/ValentinaTest/ValentinaTest.pro +++ b/src/test/ValentinaTest/ValentinaTest.pro @@ -38,46 +38,39 @@ SOURCES += \ tst_vposter.cpp \ tst_vabstractdetail.cpp \ tst_vspline.cpp \ - abstracttest.cpp \ tst_nameregexp.cpp \ tst_vlayoutdetail.cpp \ tst_varc.cpp \ - stable.cpp \ - tst_measurementregexp.cpp \ tst_tapecommandline.cpp \ tst_valentinacommandline.cpp \ tst_qmutokenparser.cpp \ tst_vmeasurements.cpp \ - tst_qmuparsererrormsg.cpp \ tst_vlockguard.cpp \ tst_misc.cpp \ tst_vcommandline.cpp \ - tst_tstranslation.cpp \ tst_vdetail.cpp \ tst_vabstractcurve.cpp \ tst_findpoint.cpp \ tst_vellipticalarc.cpp \ tst_vcubicbezierpath.cpp +win32-msvc*:SOURCES += stable.cpp + HEADERS += \ tst_vposter.h \ tst_vabstractdetail.h \ tst_vspline.h \ - abstracttest.h \ tst_nameregexp.h \ tst_vlayoutdetail.h \ tst_varc.h \ stable.h \ - tst_measurementregexp.h \ tst_tapecommandline.h \ tst_valentinacommandline.h \ tst_qmutokenparser.h \ tst_vmeasurements.h \ - tst_qmuparsererrormsg.h \ tst_vlockguard.h \ tst_misc.h \ tst_vcommandline.h \ - tst_tstranslation.h \ tst_vdetail.h \ tst_vabstractcurve.h \ tst_findpoint.h \ @@ -87,8 +80,6 @@ HEADERS += \ # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() -DEFINES += TS_DIR=\\\"$${PWD}/../../../share/translations\\\" - CONFIG(debug, debug|release){ # Debug mode unix { diff --git a/src/test/ValentinaTest/qttestmainlambda.cpp b/src/test/ValentinaTest/qttestmainlambda.cpp index e5e699b4f..6bd06ab19 100644 --- a/src/test/ValentinaTest/qttestmainlambda.cpp +++ b/src/test/ValentinaTest/qttestmainlambda.cpp @@ -35,16 +35,13 @@ #include "tst_vlayoutdetail.h" #include "tst_varc.h" #include "tst_vellipticalarc.h" -#include "tst_measurementregexp.h" #include "tst_tapecommandline.h" #include "tst_valentinacommandline.h" #include "tst_qmutokenparser.h" #include "tst_vmeasurements.h" -#include "tst_qmuparsererrormsg.h" #include "tst_vlockguard.h" #include "tst_misc.h" #include "tst_vcommandline.h" -#include "tst_tstranslation.h" #include "tst_vdetail.h" #include "tst_findpoint.h" #include "tst_vabstractcurve.h" @@ -74,23 +71,6 @@ int main(int argc, char** argv) ASSERT_TEST(new TST_VLayoutDetail()); ASSERT_TEST(new TST_VArc()); ASSERT_TEST(new TST_VEllipticalArc()); - - { - const QStringList locales = SupportedLocales(); - for(quint32 s = 0; s < TST_MeasurementRegExp::systemCounts; ++s) - { - for(int l = 0, sz = locales.size(); l < sz; ++l) - { - ASSERT_TEST(new TST_MeasurementRegExp(s, locales.at(l))); - } - } - - for(int l = 0, sz = locales.size(); l < sz; ++l) - { - ASSERT_TEST(new TST_QmuParserErrorMsg(locales.at(l))); - } - } - ASSERT_TEST(new TST_TapeCommandLine()); ASSERT_TEST(new TST_ValentinaCommandLine()); ASSERT_TEST(new TST_QmuTokenParser()); @@ -98,7 +78,6 @@ int main(int argc, char** argv) ASSERT_TEST(new TST_VLockGuard()); ASSERT_TEST(new TST_Misc()); ASSERT_TEST(new TST_VCommandLine()); - ASSERT_TEST(new TST_TSTranslation()); ASSERT_TEST(new TST_VAbstractCurve()); ASSERT_TEST(new TST_VCubicBezierPath()); diff --git a/src/test/ValentinaTest/tst_tapecommandline.h b/src/test/ValentinaTest/tst_tapecommandline.h index 2cc434706..f936866f4 100644 --- a/src/test/ValentinaTest/tst_tapecommandline.h +++ b/src/test/ValentinaTest/tst_tapecommandline.h @@ -29,7 +29,7 @@ #ifndef TST_TAPECOMMANDLINE_H #define TST_TAPECOMMANDLINE_H -#include "abstracttest.h" +#include "../vmisc/abstracttest.h" class TST_TapeCommandLine : public AbstractTest { diff --git a/src/test/ValentinaTest/tst_vabstractcurve.h b/src/test/ValentinaTest/tst_vabstractcurve.h index 642bb741e..7ffd2d773 100644 --- a/src/test/ValentinaTest/tst_vabstractcurve.h +++ b/src/test/ValentinaTest/tst_vabstractcurve.h @@ -29,7 +29,7 @@ #ifndef TST_VABSTRACTCURVE_H #define TST_VABSTRACTCURVE_H -#include "abstracttest.h" +#include "../vmisc/abstracttest.h" class TST_VAbstractCurve : public AbstractTest { diff --git a/src/test/ValentinaTest/tst_vabstractdetail.h b/src/test/ValentinaTest/tst_vabstractdetail.h index e3e6aee01..f31ceb633 100644 --- a/src/test/ValentinaTest/tst_vabstractdetail.h +++ b/src/test/ValentinaTest/tst_vabstractdetail.h @@ -29,7 +29,7 @@ #ifndef TST_VABSTRACTDETAIL_H #define TST_VABSTRACTDETAIL_H -#include "abstracttest.h" +#include "../vmisc/abstracttest.h" class TST_VAbstractDetail : public AbstractTest { diff --git a/src/test/ValentinaTest/tst_valentinacommandline.h b/src/test/ValentinaTest/tst_valentinacommandline.h index 53c0cb034..03b2b65d4 100644 --- a/src/test/ValentinaTest/tst_valentinacommandline.h +++ b/src/test/ValentinaTest/tst_valentinacommandline.h @@ -29,7 +29,7 @@ #ifndef TST_VALENTINACOMMANDLINE_H #define TST_VALENTINACOMMANDLINE_H -#include "abstracttest.h" +#include "../vmisc/abstracttest.h" class TST_ValentinaCommandLine : public AbstractTest { diff --git a/src/test/ValentinaTest/tst_vdetail.h b/src/test/ValentinaTest/tst_vdetail.h index 3536ea367..ef7034caa 100644 --- a/src/test/ValentinaTest/tst_vdetail.h +++ b/src/test/ValentinaTest/tst_vdetail.h @@ -29,7 +29,7 @@ #ifndef TST_VDETAIL_H #define TST_VDETAIL_H -#include "abstracttest.h" +#include "../vmisc/abstracttest.h" class TST_VDetail : public AbstractTest { diff --git a/src/test/ValentinaTest/tst_vlayoutdetail.h b/src/test/ValentinaTest/tst_vlayoutdetail.h index e67988ccf..eb0eb21c8 100644 --- a/src/test/ValentinaTest/tst_vlayoutdetail.h +++ b/src/test/ValentinaTest/tst_vlayoutdetail.h @@ -29,7 +29,7 @@ #ifndef TST_VLAYOUTDETAIL_H #define TST_VLAYOUTDETAIL_H -#include "abstracttest.h" +#include "../vmisc/abstracttest.h" class TST_VLayoutDetail : public AbstractTest { diff --git a/src/test/ValentinaTest/tst_vspline.h b/src/test/ValentinaTest/tst_vspline.h index d0b96b5fc..7e910baf9 100644 --- a/src/test/ValentinaTest/tst_vspline.h +++ b/src/test/ValentinaTest/tst_vspline.h @@ -29,7 +29,7 @@ #ifndef TST_VSPLINE_H #define TST_VSPLINE_H -#include "abstracttest.h" +#include "../vmisc/abstracttest.h" class VSpline; diff --git a/src/test/test.pro b/src/test/test.pro index c6011dc86..8070d6122 100644 --- a/src/test/test.pro +++ b/src/test/test.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs SUBDIRS = \ ParserTest \ - ValentinaTest + ValentinaTest \ + TranslationsTest