diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 60e326c..32e0d4f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,30 +3,68 @@ stages: - build - test +# To clone also submodules +variables: + GIT_SUBMODULE_STRATEGY: recursive + + # ######## # Build ########## -build: # name of task - stage: build # in what stage it will run ( 1. build then test etc ) - tags: # Tags are used to choose correct gitlab-runner - - hw # spaceti-runner server has running runners and one has tag 'hw' - script: # run in bash - - mkdir -p build +build: + stage: build + tags: + - shell + script: + - mkdir -p build - cd build - qmake ../colnod-connector.pro - - make -j8 + - make -j4 cache: paths: - - build/ - + - build # this path will be cached for next stages # ######## # Test ########## -test: # name of task - stage: test # in what stage it will run ( 1. build then test etc ) - tags: # Tags are used to choose correct gitlab-runner - - hw # spaceti-runner server has running runners and one has tag 'hw' - script: # run in bash +test: + stage: test + tags: + - shell + script: - cd build - make check test + +valgrind: + stage: test + tags: + - shell + script: + - cd build + - valgrind make check test + +# Quality of code +cppcheck: + stage: test + tags: + - shell + # Probably needed to allow failure + #allow_failure: true + script: # run in bash + - server-sdk/scripts/cppcheck.sh + + +codecoverage: + stage: test + tags: + - shell + script: + - server-sdk/scripts/codecoverage.sh + coverage: '/^\s+functions..:\s+(\d+\.\d+%).+$/' + +doc: + stage: test + tags: + - shell + script: + - server-sdk/scripts/doc.sh clean # 'clean' better clean before generating documentation diff --git a/colnod-connector.pro b/colnod-connector.pro index 41bdb50..fd56626 100644 --- a/colnod-connector.pro +++ b/colnod-connector.pro @@ -1,5 +1,11 @@ TEMPLATE = subdirs SUBDIRS += \ + server-sdk/src/serversdk/serversdk.pro \ src/app \ test + +OTHER_FILES += \ + doc/* \ + .gitignore \ + .gitlab-ci.yml \ diff --git a/doc/Doxyfile-mcss b/doc/Doxyfile-mcss new file mode 100644 index 0000000..0ef7058 --- /dev/null +++ b/doc/Doxyfile-mcss @@ -0,0 +1,43 @@ +@INCLUDE = ../server-sdk/doc/Doxyfile-init +# Output settings +GENERATE_HTML = NO +GENERATE_XML = YES +GENERATE_LATEX = NO +XML_PROGRAMLISTING = YES + +# Project settings +PROJECT_NAME = example-app +INPUT = ../src \ + pages \ + ../readme.md \ +FILE_PATTERNS += *.md +USE_MDFILE_AS_MAINPAGE = ../readme.md +OUTPUT_DIRECTORY = ../build/doc/ +FULL_PATH_NAMES = NO + +# Attributes settings +RECURSIVE = YES +EXTRACT_PRIVATE = YES +EXTRACT_ALL = YES + +## m.css internal command -> show undocumented +M_SHOW_UNDOCUMENTED = YES + + +## Taken from magnum ( Project from authors of m.css ) +SHOW_USED_FILES = YES +VERBATIM_HEADERS = NO +AUTOLINK_SUPPORT = YES + + +ALIASES += \ + "m_div{1}=@xmlonly@endxmlonly" \ + "m_enddiv=@xmlonly@endxmlonly" \ + "m_span{1}=@xmlonly@endxmlonly" \ + "m_endspan=@xmlonly@endxmlonly" \ + "m_class{1}=@xmlonly@endxmlonly" \ + "m_footernavigation=@xmlonly@endxmlonly" \ + "m_examplenavigation{2}=@xmlonly@endxmlonly" \ + "m_keywords{1}=@xmlonly@endxmlonly" \ + "m_keyword{3}=@xmlonly@endxmlonly" \ + "m_enum_values_as_keywords=@xmlonly@endxmlonly" diff --git a/doc/pages/mainpage.md b/doc/pages/mainpage.md new file mode 100644 index 0000000..73ed06f --- /dev/null +++ b/doc/pages/mainpage.md @@ -0,0 +1 @@ +# Example app documentation diff --git a/server-sdk b/server-sdk index 7ebe6bb..e31b09b 160000 --- a/server-sdk +++ b/server-sdk @@ -1 +1 @@ -Subproject commit 7ebe6bb0ea91e60dbc0a81854a8541135071d247 +Subproject commit e31b09b2a970540a51d4ba8d1d60b55b7b8319e9 diff --git a/src/app/app.pro b/src/app/app.pro index 66c4a04..fb4c204 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -1,8 +1,12 @@ TEMPLATE = app QT += core sql network -CONFIG += debug console +CONFIG += cmdline c++14 +CONFIG += ordered + SOURCES += main.cpp + include(../colnod/colnod.pri) + diff --git a/src/colnod/colnod.pri b/src/colnod/colnod.pri index d5cabe1..bc75877 100644 --- a/src/colnod/colnod.pri +++ b/src/colnod/colnod.pri @@ -1,6 +1,8 @@ INCLUDEPATH += $$PWD -#SRC_DIR = $$PWD -message($$PWD) + +CONFIG += c++14 + + SOURCES += \ $$PWD/databasemanager.cpp \ $$PWD/datamanager.cpp \ @@ -22,4 +24,5 @@ HEADERS += \ $$PWD/subject.h \ $$PWD/syncmanager.h \ $$PWD/token.h -message($$SOURCES) + +include(../../server-sdk/serversdk.pri) diff --git a/src/colnod/databasemanager.h b/src/colnod/databasemanager.h index 1ce4b50..4613e6e 100644 --- a/src/colnod/databasemanager.h +++ b/src/colnod/databasemanager.h @@ -10,7 +10,6 @@ #include "subject.h" #include "token.h" #include -//#include "logger.h" class DatabaseManager : public QObject diff --git a/test/unitTests/unitTests.pro b/test/unitTests/unitTests.pro index a0b7551..829247c 100644 --- a/test/unitTests/unitTests.pro +++ b/test/unitTests/unitTests.pro @@ -10,6 +10,7 @@ SOURCES += \ unittest.cpp include(../../src/colnod/colnod.pri) +include(../../server-sdk/serversdk.pri) # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin