diff --git a/.travis.yml b/.travis.yml index 726ae4c..76e9979 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,9 @@ dist: trusty sudo: false language: c +git: + depth: false + before_install: - pip install --user cpp-coveralls diff --git a/src/dunst.c b/src/dunst.c index 0be3d8f..d94db41 100644 --- a/src/dunst.c +++ b/src/dunst.c @@ -22,10 +22,6 @@ #include "x11/screen.h" #include "x11/x.h" -#ifndef VERSION -#define VERSION "version info needed" -#endif - /* index of colors fit to urgency level */ GMainLoop *mainloop = NULL; diff --git a/test/misc.c b/test/misc.c new file mode 100644 index 0000000..a61b82f --- /dev/null +++ b/test/misc.c @@ -0,0 +1,21 @@ +#include "greatest.h" + +// This actually tests the buildsystem to make sure, +// the build system hands over a correct version number +// This is not testable via macros +TEST assert_version_number(void) +{ + ASSERTm("Version number is empty", + 0 != strcmp(VERSION, "")); + + ASSERTm("Version number is not seeded by git", + NULL == strstr(VERSION, "non-git")); + PASS(); +} + +SUITE(suite_misc) +{ + RUN_TEST(assert_version_number); +} + +/* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/test/test.c b/test/test.c index 09835fd..57133a5 100644 --- a/test/test.c +++ b/test/test.c @@ -8,6 +8,7 @@ SUITE_EXTERN(suite_utils); SUITE_EXTERN(suite_option_parser); SUITE_EXTERN(suite_notification); SUITE_EXTERN(suite_markup); +SUITE_EXTERN(suite_misc); SUITE_EXTERN(suite_icon); GREATEST_MAIN_DEFS(); @@ -21,6 +22,7 @@ int main(int argc, char *argv[]) { RUN_SUITE(suite_option_parser); RUN_SUITE(suite_notification); RUN_SUITE(suite_markup); + RUN_SUITE(suite_misc); RUN_SUITE(suite_icon); GREATEST_MAIN_END(); }