From 707d2a805eb6e2641908331c34e37c35925dedd4 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 09:26:35 +0000 Subject: [PATCH 01/14] bitbucket-pipelines.yml created online with Bitbucket --HG-- branch : develop --- bitbucket-pipelines.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 bitbucket-pipelines.yml diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml new file mode 100644 index 000000000..e97035636 --- /dev/null +++ b/bitbucket-pipelines.yml @@ -0,0 +1,21 @@ +image: gcc +pipelines: + default: + - step: + script: + - echo "This script runs on all branches that don't have any specific pipeline assigned in 'branches'." + branches: + develop: + - step: + script: + - lsb_release -a + - uname -a + - grep -i processor /proc/cpuinfo | wc -l + - gcc --version + - mkdir build + - cd build + - which qmake + - qmake --version + - qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=no_ccache CONFIG+=checkWarnings + - make + - make check \ No newline at end of file From 25d42004d11dc8bdd92d3f1b015f5162ead13e8b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 09:32:08 +0000 Subject: [PATCH 02/14] Try to fix bitbucket-pipelines.yml --HG-- branch : develop --- bitbucket-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index e97035636..2af04c508 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -8,7 +8,6 @@ pipelines: develop: - step: script: - - lsb_release -a - uname -a - grep -i processor /proc/cpuinfo | wc -l - gcc --version From 952bd66dae5059c432f4c8517701bf907abc62b5 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 09:43:17 +0000 Subject: [PATCH 03/14] bitbucket-pipelines.yml, removed "which qmake". --HG-- branch : develop --- bitbucket-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 2af04c508..8c8e21f5b 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -13,7 +13,6 @@ pipelines: - gcc --version - mkdir build - cd build - - which qmake - qmake --version - qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=no_ccache CONFIG+=checkWarnings - make From d4c1d348f9685c4d3808f55d9813485a49546e50 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 10:07:28 +0000 Subject: [PATCH 04/14] Try to use default image. --HG-- branch : develop --- bitbucket-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 8c8e21f5b..947be7081 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,4 +1,3 @@ -image: gcc pipelines: default: - step: @@ -8,6 +7,7 @@ pipelines: develop: - step: script: + - cat /etc/*-release - uname -a - grep -i processor /proc/cpuinfo | wc -l - gcc --version @@ -15,5 +15,5 @@ pipelines: - cd build - qmake --version - qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=no_ccache CONFIG+=checkWarnings - - make + - make -j4 - make check \ No newline at end of file From f4cb03345919db96d506ee42e0daad066ba640ff Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 10:50:22 +0000 Subject: [PATCH 05/14] Looks like we can use apt-get inside bitbucket-pipelines.yml. --HG-- branch : develop --- bitbucket-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 947be7081..2e1ed2d38 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,3 +1,4 @@ +image: gcc pipelines: default: - step: @@ -11,6 +12,8 @@ pipelines: - uname -a - grep -i processor /proc/cpuinfo | wc -l - gcc --version + - apt-get update # required to install qt + - apt-get install -y qtbase5-dev libqt5svg5-dev qt5-default qttools5-dev-tools libqt5xmlpatterns5-dev libqt5core5a libqt5gui5 libqt5printsupport5 libqt5svg5 libqt5widgets5 libqt5xml5 libqt5xmlpatterns5 xpdf - mkdir build - cd build - qmake --version From cd8297e157cb10836d7bbefc649ab3eea9ff2fc3 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 11:15:24 +0000 Subject: [PATCH 06/14] bitbucket-pipelines.yml. Added export LD_LIBRARY_PATH --HG-- branch : develop --- bitbucket-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 2e1ed2d38..c2ba2703e 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -19,4 +19,5 @@ pipelines: - qmake --version - qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=no_ccache CONFIG+=checkWarnings - make -j4 + - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/opt/atlassian/bitbucketci/agent/build/build/src/libs/vpropertyexplorer/bin:/opt/atlassian/bitbucketci/agent/build/build/src/libs/qmuparser/bin" - make check \ No newline at end of file From 1eb97800f4ec543d3d8de5f2fb5dd202b4f93189 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 11:31:38 +0000 Subject: [PATCH 07/14] bitbucket-pipelines.yml. Used $(nproc). --HG-- branch : develop --- bitbucket-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index c2ba2703e..7f843168e 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -18,6 +18,6 @@ pipelines: - cd build - qmake --version - qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=no_ccache CONFIG+=checkWarnings - - make -j4 + - make -j$(nproc) - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/opt/atlassian/bitbucketci/agent/build/build/src/libs/vpropertyexplorer/bin:/opt/atlassian/bitbucketci/agent/build/build/src/libs/qmuparser/bin" - make check \ No newline at end of file From 1551ee4f71a638deee89a327e309595f7b41fde8 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 11:34:36 +0000 Subject: [PATCH 08/14] bitbucket-pipelines.yml. Fixing error: QXcbConnection: Could not connect to display. --HG-- branch : develop --- bitbucket-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 7f843168e..e5955a409 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -20,4 +20,4 @@ pipelines: - qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=no_ccache CONFIG+=checkWarnings - make -j$(nproc) - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/opt/atlassian/bitbucketci/agent/build/build/src/libs/vpropertyexplorer/bin:/opt/atlassian/bitbucketci/agent/build/build/src/libs/qmuparser/bin" - - make check \ No newline at end of file + - DISPLAY=:99.0 make check \ No newline at end of file From 0b86fac946addc77006c03389331f54258387d88 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 11:35:41 +0000 Subject: [PATCH 09/14] bitbucket-pipelines.yml. QTestLib require GUI support for some tests. --HG-- branch : develop --- bitbucket-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index e5955a409..b564e1755 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -14,6 +14,9 @@ pipelines: - gcc --version - apt-get update # required to install qt - apt-get install -y qtbase5-dev libqt5svg5-dev qt5-default qttools5-dev-tools libqt5xmlpatterns5-dev libqt5core5a libqt5gui5 libqt5printsupport5 libqt5svg5 libqt5widgets5 libqt5xml5 libqt5xmlpatterns5 xpdf + # QTestLib require GUI support for some tests + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" - mkdir build - cd build - qmake --version From b4c22a00967db142acf400a93dbbe0b151c44226 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 12:04:13 +0000 Subject: [PATCH 10/14] bitbucket-pipelines.yml. Probably we already have root rights. --HG-- branch : develop --- bitbucket-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index b564e1755..e600333b8 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -15,8 +15,8 @@ pipelines: - apt-get update # required to install qt - apt-get install -y qtbase5-dev libqt5svg5-dev qt5-default qttools5-dev-tools libqt5xmlpatterns5-dev libqt5core5a libqt5gui5 libqt5printsupport5 libqt5svg5 libqt5widgets5 libqt5xml5 libqt5xmlpatterns5 xpdf # QTestLib require GUI support for some tests - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" + - export DISPLAY=:99.0 + - /etc/init.d/xvfb start - mkdir build - cd build - qmake --version From 3476e071cdc0014f5da0530b7b6816ed79de70f9 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 12:12:09 +0000 Subject: [PATCH 11/14] bitbucket-pipelines.yml. My last hope is "xvfb-run". --HG-- branch : develop --- bitbucket-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index e600333b8..d84bf0cc6 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -14,13 +14,11 @@ pipelines: - gcc --version - apt-get update # required to install qt - apt-get install -y qtbase5-dev libqt5svg5-dev qt5-default qttools5-dev-tools libqt5xmlpatterns5-dev libqt5core5a libqt5gui5 libqt5printsupport5 libqt5svg5 libqt5widgets5 libqt5xml5 libqt5xmlpatterns5 xpdf - # QTestLib require GUI support for some tests - - export DISPLAY=:99.0 - - /etc/init.d/xvfb start - mkdir build - cd build - qmake --version - qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=no_ccache CONFIG+=checkWarnings - make -j$(nproc) - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/opt/atlassian/bitbucketci/agent/build/build/src/libs/vpropertyexplorer/bin:/opt/atlassian/bitbucketci/agent/build/build/src/libs/qmuparser/bin" - - DISPLAY=:99.0 make check \ No newline at end of file + # QTestLib require GUI support for some tests + - xvfb-run -a make check \ No newline at end of file From 14376c4fe1c1b0797a35860f91868007312bcefc Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 12:28:13 +0000 Subject: [PATCH 12/14] bitbucket-pipelines.yml. Error: xvfb-run: command not found. --HG-- branch : develop --- bitbucket-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index d84bf0cc6..280d44d27 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -13,7 +13,7 @@ pipelines: - grep -i processor /proc/cpuinfo | wc -l - gcc --version - apt-get update # required to install qt - - apt-get install -y qtbase5-dev libqt5svg5-dev qt5-default qttools5-dev-tools libqt5xmlpatterns5-dev libqt5core5a libqt5gui5 libqt5printsupport5 libqt5svg5 libqt5widgets5 libqt5xml5 libqt5xmlpatterns5 xpdf + - apt-get install -y xvfb qtbase5-dev libqt5svg5-dev qt5-default qttools5-dev-tools libqt5xmlpatterns5-dev libqt5core5a libqt5gui5 libqt5printsupport5 libqt5svg5 libqt5widgets5 libqt5xml5 libqt5xmlpatterns5 xpdf - mkdir build - cd build - qmake --version From 439b1577f557606050d50e5d1a47dc8c91f68edf Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 18:22:42 +0300 Subject: [PATCH 13/14] Disable warning Wunsafe-loop-optimizations. --HG-- branch : develop --- common.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.pri b/common.pri index c96667d56..e7cc828b0 100644 --- a/common.pri +++ b/common.pri @@ -240,7 +240,7 @@ GCC_DEBUG_CXXFLAGS += \ -Wredundant-decls \ # -Winline \ -Winvalid-pch \ - -Wunsafe-loop-optimizations \ +# -Wunsafe-loop-optimizations \ -Wlong-long \ -Wmissing-format-attribute \ -Wswitch-default \ From c793f869e56b0636913b77f4645570c822cf916a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jul 2016 18:25:13 +0300 Subject: [PATCH 14/14] More warnings in AbstractTest::CopyRecursively. Do copy files before all test run. --HG-- branch : develop --- src/test/ValentinaTest/abstracttest.cpp | 5 ++++- src/test/ValentinaTest/tst_tapecommandline.cpp | 4 ++-- src/test/ValentinaTest/tst_tapecommandline.h | 4 ++-- src/test/ValentinaTest/tst_valentinacommandline.cpp | 4 ++-- src/test/ValentinaTest/tst_valentinacommandline.h | 4 ++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/test/ValentinaTest/abstracttest.cpp b/src/test/ValentinaTest/abstracttest.cpp index aca37f533..c671f4d9f 100644 --- a/src/test/ValentinaTest/abstracttest.cpp +++ b/src/test/ValentinaTest/abstracttest.cpp @@ -140,6 +140,7 @@ bool AbstractTest::CopyRecursively(const QString &srcFilePath, const QString &tg targetDir.cdUp(); if (not targetDir.mkdir(QFileInfo(tgtFilePath).fileName())) { + QWARN("Can't create subdir./n"); return false; } QDir sourceDir(srcFilePath); @@ -154,10 +155,12 @@ bool AbstractTest::CopyRecursively(const QString &srcFilePath, const QString &tg return false; } } - } else + } + else { if (not QFile::copy(srcFilePath, tgtFilePath)) { + QWARN("Can't copy file./n"); return false; } } diff --git a/src/test/ValentinaTest/tst_tapecommandline.cpp b/src/test/ValentinaTest/tst_tapecommandline.cpp index f4842fb39..1e9f7728c 100644 --- a/src/test/ValentinaTest/tst_tapecommandline.cpp +++ b/src/test/ValentinaTest/tst_tapecommandline.cpp @@ -40,7 +40,7 @@ TST_TapeCommandLine::TST_TapeCommandLine(QObject *parent) } //--------------------------------------------------------------------------------------------------------------------- -void TST_TapeCommandLine::init() +void TST_TapeCommandLine::initTestCase() { QDir tmpDir(tmpTestFolder); if (not tmpDir.removeRecursively()) @@ -141,7 +141,7 @@ void TST_TapeCommandLine::OpenMeasurements() } //--------------------------------------------------------------------------------------------------------------------- -void TST_TapeCommandLine::cleanup() +void TST_TapeCommandLine::cleanupTestCase() { QDir tmpDir(tmpTestFolder); if (not tmpDir.removeRecursively()) diff --git a/src/test/ValentinaTest/tst_tapecommandline.h b/src/test/ValentinaTest/tst_tapecommandline.h index 0206497e4..2cc434706 100644 --- a/src/test/ValentinaTest/tst_tapecommandline.h +++ b/src/test/ValentinaTest/tst_tapecommandline.h @@ -38,10 +38,10 @@ public: explicit TST_TapeCommandLine(QObject *parent = nullptr); private slots: - void init(); + void initTestCase(); void OpenMeasurements_data() const; void OpenMeasurements(); - void cleanup(); + void cleanupTestCase(); private: Q_DISABLE_COPY(TST_TapeCommandLine) diff --git a/src/test/ValentinaTest/tst_valentinacommandline.cpp b/src/test/ValentinaTest/tst_valentinacommandline.cpp index b1885dd11..2319118a7 100644 --- a/src/test/ValentinaTest/tst_valentinacommandline.cpp +++ b/src/test/ValentinaTest/tst_valentinacommandline.cpp @@ -41,7 +41,7 @@ TST_ValentinaCommandLine::TST_ValentinaCommandLine(QObject *parent) //--------------------------------------------------------------------------------------------------------------------- // cppcheck-suppress unusedFunction -void TST_ValentinaCommandLine::init() +void TST_ValentinaCommandLine::initTestCase() { {// Test files QDir tmpDir(tmpTestFolder); @@ -308,7 +308,7 @@ void TST_ValentinaCommandLine::TestOpenCollection() //--------------------------------------------------------------------------------------------------------------------- // cppcheck-suppress unusedFunction -void TST_ValentinaCommandLine::cleanup() +void TST_ValentinaCommandLine::cleanupTestCase() { { QDir tmpDir(tmpTestFolder); diff --git a/src/test/ValentinaTest/tst_valentinacommandline.h b/src/test/ValentinaTest/tst_valentinacommandline.h index 92c3db54a..53c0cb034 100644 --- a/src/test/ValentinaTest/tst_valentinacommandline.h +++ b/src/test/ValentinaTest/tst_valentinacommandline.h @@ -38,7 +38,7 @@ public: explicit TST_ValentinaCommandLine(QObject *parent = nullptr); private slots: - void init(); + void initTestCase(); void OpenPatterns_data() const; void OpenPatterns(); void ExportMode_data() const; @@ -47,7 +47,7 @@ private slots: void TestMode(); void TestOpenCollection_data() const; void TestOpenCollection(); - void cleanup(); + void cleanupTestCase(); private: Q_DISABLE_COPY(TST_ValentinaCommandLine)