From 533f47f4c6e7269b4d2be7bfa74df0866bd32817 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Fri, 9 Mar 2018 18:12:08 +0200 Subject: [PATCH 1/6] Fix coveralls crashing when building with clang Coveralls defaulted to using gcov for all builds even when using clang in which case it should have used llvm-cov. Fix this by specifying different coveralls commands for each compiler. Additionally, move the coverage to commands to the after_success section to avoid sending coverage data when the build failed. --- .travis.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0db5b8e..722d2d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,14 +18,22 @@ addons: dist: trusty sudo: false language: c + before_install: - pip install --user cpp-coveralls + script: - CFLAGS="-fprofile-arcs -ftest-coverage -Werror" make all dunstify test-valgrind doc-doxygen - - coveralls -compiler: - - gcc - - clang + +matrix: + include: + - compiler: gcc + after_success: + - coveralls + - compiler: clang + after_success: + - coveralls --gcov llvm-cov --gcov-options gcov + notifications: irc: channels: From 1831e9d0153dbfc622252ff117fbf92c7b8583f2 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Fri, 9 Mar 2018 18:18:05 +0200 Subject: [PATCH 2/6] Run code coverage tests without optimizations This way the code coverage results also include code paths that are optimized out by the compiler at higher optimization levels. --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 722d2d8..7f31313 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,9 @@ before_install: - pip install --user cpp-coveralls script: - - CFLAGS="-fprofile-arcs -ftest-coverage -Werror" make all dunstify test-valgrind doc-doxygen + - CFLAGS="-Werror" make all dunstify test-valgrind doc-doxygen + - make clean + - CFLAGS="-Werror -fprofile-arcs -ftest-coverage -O0" make test matrix: include: From 764761132f2abc45a41f619813bc909122b8fde9 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Fri, 9 Mar 2018 18:19:35 +0200 Subject: [PATCH 3/6] Drop travis IRC notifications They aren't of much use and I don't think the users on IRC appreciate the occasional notification spam when something breaks. --- .travis.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7f31313..20d6590 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,10 +35,3 @@ matrix: - compiler: clang after_success: - coveralls --gcov llvm-cov --gcov-options gcov - -notifications: - irc: - channels: - - "chat.freenode.net#dunst" - on_success: change - on_failure: always From 8714a66a5bfcf5bab6f3304265f9c1b8adb4a15f Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Fri, 9 Mar 2018 18:28:46 +0200 Subject: [PATCH 4/6] Exclude test directory from code coverage Tests always run almost 100%, and there is no need to test our test suite. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20d6590..101fd93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ matrix: include: - compiler: gcc after_success: - - coveralls + - coveralls --exclude 'test' - compiler: clang after_success: - - coveralls --gcov llvm-cov --gcov-options gcov + - coveralls --exclude 'test' --gcov llvm-cov --gcov-options gcov From 063e29fd1bfffb4e3540aca63ce55e7844306199 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Fri, 9 Mar 2018 19:28:57 +0200 Subject: [PATCH 5/6] Remove parsing of the X11LIB variable X11LIB was introduced along with other similar variables such as X11INC in 1faee75, before dunst used pkg-config to manage libraries. These variables were removed after the introduction of pkg-config in 0de2e17 so theoretically it is safe to remove it. I really hope this doesn't break something... --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.mk b/config.mk index 19cdb48..08808c6 100644 --- a/config.mk +++ b/config.mk @@ -15,7 +15,7 @@ PKG_CONFIG ?= pkg-config # flags CPPFLAGS += -D_DEFAULT_SOURCE -DVERSION=\"${VERSION}\" CFLAGS += -g --std=gnu99 -pedantic -Wall -Wno-overlength-strings -Os ${STATIC} ${CPPFLAGS} -LDFLAGS += -lm -L${X11LIB} +LDFLAGS += -lm CPPFLAGS_DEBUG := -DDEBUG_BUILD CFLAGS_DEBUG := -O0 From 678ea70c88a17162eea3268b37880b85f1d00f7b Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Fri, 9 Mar 2018 19:43:07 +0200 Subject: [PATCH 6/6] Put user CFLAGS after the predefined flags This allows the usage of the CFLAGS variable to override existing parameters (e.g. optimizations) without editing config.mk. --- config.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.mk b/config.mk index 08808c6..ae4844a 100644 --- a/config.mk +++ b/config.mk @@ -14,8 +14,8 @@ PKG_CONFIG ?= pkg-config # flags CPPFLAGS += -D_DEFAULT_SOURCE -DVERSION=\"${VERSION}\" -CFLAGS += -g --std=gnu99 -pedantic -Wall -Wno-overlength-strings -Os ${STATIC} ${CPPFLAGS} -LDFLAGS += -lm +CFLAGS := -g --std=gnu99 -pedantic -Wall -Wno-overlength-strings -Os ${STATIC} ${CPPFLAGS} ${CFLAGS} +LDFLAGS := -lm ${LDFLAGS} CPPFLAGS_DEBUG := -DDEBUG_BUILD CFLAGS_DEBUG := -O0