diff options
author | tezeb <tezeb+github@outoftheblue.pl> | 2017-03-02 16:14:19 +0100 |
---|---|---|
committer | tezeb <tezeb+github@outoftheblue.pl> | 2017-03-10 20:27:07 +0100 |
commit | 00683f2c47458756e396279a0efb66b86bb0c7b3 (patch) | |
tree | 08e2e7d7b5cc3962a382b1e71afba0a83033dcc8 | |
parent | 896d8fb9f4e81b13d574d44c30ddf7b3f2949795 (diff) |
Codecov working
-rw-r--r-- | .codecov.yml | 3 | ||||
-rw-r--r-- | .travis.yml | 12 | ||||
-rw-r--r-- | qtpass.pri | 11 | ||||
-rw-r--r-- | qtpass.pro | 24 | ||||
-rw-r--r-- | src/src.pro | 7 | ||||
-rw-r--r-- | tests/auto/auto.pri | 2 | ||||
-rw-r--r-- | tests/auto/util/util.pro | 19 | ||||
-rw-r--r-- | tests/tests.pri | 3 | ||||
-rw-r--r-- | tests/tests.pro | 4 |
9 files changed, 60 insertions, 25 deletions
diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..db333ac5 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,3 @@ +coverage: + ignore: + - tests/* diff --git a/.travis.yml b/.travis.yml index efe5aed9..cce4ac15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,12 @@ install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then npm install -g appdmg; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq update; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq install qt58base qt58tools qt58svg; fi +- if [ "$TRAVIS_OS_NAME" = "linux" ]; then pip install --user codecov; fi before_script: - if [ "$TRAVIS_OS_NAME" = "linux" ]; then source /opt/qt58/bin/qt58-env.sh; fi script: - qmake -v -- qmake -Wall qtpass.pro +- qmake CONFIG+=debug -Wall qtpass.pro - make -j$(nproc) - if [ "$TRAVIS_OS_NAME" = "osx" ]; then macdeployqt src/QtPass.app; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sed 's/FAQ\.md/https:\/\/qtpass.org\/docs\/md_FAQ.html/' < README.md > README.faq; fi @@ -43,13 +44,8 @@ script: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then pandoc --standalone --from=markdown_github --to=rtf --output=README.rtf README.clean; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then appdmg appdmg.json qtpass-$(grep ^VERSION qtpass.pri | cut -d " " -f 6).dmg; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then export VERSION=$(grep ^VERSION qtpass.pri | cut -d " " -f 6); fi -- export QT_QPA_PLATFORM=offscreen -- cd tests -- qmake -- make -- if [ "$TRAVIS_OS_NAME" != "osx" ]; then ./auto/util/tst_util; fi -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then ./auto/util/tst_util.app/Contents/MacOS/tst_util; fi -- cd - +- if [ "$TRAVIS_OS_NAME" = "osx" ]; then make -j$(nproc) check ; fi +- if [ "$TRAVIS_OS_NAME" = "linux" ]; then make -j$(nproc) codecov TESTARGS="--platform offscreen"; fi notifications: irc: channels: @@ -1,2 +1,13 @@ VERSION = 1.2.0-pre +TEMPLATE = subdirs + +CONFIG(debug, debug|release) { + DESTDIR = debug + OBJECTS_DIR = debug + MOC_DIR = debug + QMAKE_CXXFLAGS += --coverage + QMAKE_LFLAGS += --coverage + QMAKE_DISTCLEAN += -r $$OBJECTS_DIR +} + @@ -1,9 +1,10 @@ -TEMPLATE = subdirs +!include(qtpass.pri) { error("Couldn't find the qtpass.pri file!") } SUBDIRS += src CONFIG(debug, debug|release) { SUBDIRS += tests + tests.depends = src } OTHER_FILES += LICENSE \ @@ -12,3 +13,24 @@ OTHER_FILES += LICENSE \ RESOURCES += resources.qrc +# add Makefile target to generate code coverage +coverage.target = coverage +coverage.commands = @echo "Coverage DONE!" $$escape_expand(\\n\\t) +coverage.commands += cd src/debug && gcov "*.gcda" 1>/dev/null $$escape_expand(\\n\\t) +coverage.commands += $$escape_expand(\\n) + +coverage.depends = check + +# add Makefile target to generate code coverage using codecov +codecov.target = codecov +codecov.commands = @echo "Starting Codecov!" $$escape_expand(\\n\\t) +coverage.commands += cd src/ && gcov "*.cpp *.h debug/*.gcda" 1>/dev/null $$escape_expand(\\n\\t) +codecov.commands += codecov $$escape_expand(\\n\\t) +codecov.commands += $$escape_expand(\\n) + +codecov.depends = check + +CONFIG(debug, debug|release) { + QMAKE_EXTRA_TARGETS += coverage codecov + QMAKE_CLEAN += 'src/debug/*.gc??' 'src/*.gcov' +} diff --git a/src/src.pro b/src/src.pro index bfd2b678..041843ad 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,4 +1,4 @@ -!include(../qtpass.pri) { error("Couldn't find the auto.pri file!") } +!include(../qtpass.pri) { error("Couldn't find the qtpass.pri file!") } TEMPLATE = app QT += core gui @@ -8,9 +8,8 @@ CONFIG += c++11 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG(debug, debug|release) { - QMAKE_CXXFLAGS += -g -c -Wall -coverage -O0 - QMAKE_LFLAGS += -coverage -O0 - SUBDIRS += tests + QMAKE_CXXFLAGS += -g -c -Wall -O0 + QMAKE_LFLAGS += -O0 } macx { diff --git a/tests/auto/auto.pri b/tests/auto/auto.pri index e391d44f..2c2ed402 100644 --- a/tests/auto/auto.pri +++ b/tests/auto/auto.pri @@ -1,3 +1,5 @@ !include(../tests.pri) { error("Couldn't find the tests.pri file!") } +TEMPLATE = app + !contains(TARGET, ^tst_.*):TARGET = $$join(TARGET,,"tst_") diff --git a/tests/auto/util/util.pro b/tests/auto/util/util.pro index 1c8ba7cf..54d78b18 100644 --- a/tests/auto/util/util.pro +++ b/tests/auto/util/util.pro @@ -1,14 +1,15 @@ !include(../auto.pri) { error("Couldn't find the auto.pri file!") } SOURCES += tst_util.cpp \ - util.cpp \ - qtpasssettings.cpp \ - settingsconstants.cpp \ - pass.cpp \ - realpass.cpp \ - imitatepass.cpp \ - executor.cpp \ - simpletransaction.cpp + +OBJECTS += ../../../src/$$OBJECTS_DIR/util.o \ + ../../../src/$$OBJECTS_DIR/qtpasssettings.o \ + ../../../src/$$OBJECTS_DIR/settingsconstants.o \ + ../../../src/$$OBJECTS_DIR/pass.o \ + ../../../src/$$OBJECTS_DIR/realpass.o \ + ../../../src/$$OBJECTS_DIR/imitatepass.o \ + ../../../src/$$OBJECTS_DIR/executor.o \ + ../../../src/$$OBJECTS_DIR/simpletransaction.o HEADERS += util.h \ qtpasssettings.h \ @@ -19,6 +20,8 @@ HEADERS += util.h \ executor.h \ simpletransaction.h +OBJ_PATH += ../../../src/$$OBJECTS_DIR + VPATH += ../../../src INCLUDEPATH += ../../../src diff --git a/tests/tests.pri b/tests/tests.pri index 951bc957..ae8302b2 100644 --- a/tests/tests.pri +++ b/tests/tests.pri @@ -1,8 +1,7 @@ -TEMPLATE = app +!include(../qtpass.pri) { error("Couldn't find the qtpass.pri file!") } CONFIG += testcase qt warn_on depend_includepath testcase QT += testlib widgets target.path = $$[QT_INSTALL_TESTS]/qtpass/$$TARGET INSTALLS += target - diff --git a/tests/tests.pro b/tests/tests.pro index 65126941..da7ad3ec 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,5 +1,5 @@ -QT += widgets testlib +!include(tests.pri) { error("Couldn't find the tests.pri file!") } + CONFIG += no_docs_target -TEMPLATE = subdirs SUBDIRS += auto exists(manual): SUBDIRS += manual |