diff --git a/.travis.yml b/.travis.yml index 512e03aa..c4f960a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,6 @@ before_install: - sudo apt-get install -y libxinerama-dev autoconf automake make libxft-dev libx11-dev libpango1.0-dev - sudo pip install cpp-coveralls -script: autoreconf -i && ./configure && make && make -C test/ test +script: autoreconf -i && ./configure --enable-gcov && make && make -C test/ test after_success: - coveralls --exclude lib --gcov-options '\-lp' diff --git a/Makefile.am b/Makefile.am index ab195361..78e06a10 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS=test + ## # Rofi the program ## diff --git a/configure.ac b/configure.ac index 2d261341..1e6eeb3f 100644 --- a/configure.ac +++ b/configure.ac @@ -44,5 +44,5 @@ PKG_CHECK_MODULES([xinerama], [xinerama]) PKG_CHECK_MODULES([pango], [pango pangoxft]) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile test/Makefile]) AC_OUTPUT diff --git a/test/Makefile b/test/Makefile deleted file mode 100644 index 26bb0aea..00000000 --- a/test/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -CC=gcc -CFLAGS=-I../include/ -I../ -std=c99 -fprofile-arcs -ftest-coverage -g3 -SOURCES=\ - history-test.c\ - ../config/config.c\ - ../source/history.c - -history-test: $(SOURCES) - $(CC) -o $@ $^ `pkg-config --libs --cflags glib-2.0` $(CFLAGS) - - -test: history-test - ./$^ diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 00000000..0b4be914 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,31 @@ +## +# Rofi the program +## +bin_PROGRAMS=rofi_test + +LIBS=\ + @xft_LIBS@\ + @x11_LIBS@\ + @xinerama_LIBS@\ + @pango_LIBS@ + +AM_CFLAGS=\ + @xft_CFLAGS@\ + @x11_CFLAGS@\ + @xinerama_CFLAGS@\ + @pango_CFLAGS@\ + -DMANPAGE_PATH="\"$(mandir)/man1/rofi.1\""\ + -I$(top_srcdir)/include/\ + -I$(top_srcdir)/config/\ + -I$(top_builddir)/ + +rofi_test_SOURCES=\ + ../source/history.c\ + ../config/config.c\ + ../include/rofi.h\ + ../include/history.h\ + history-test.c + +.PHONY: test +test: rofi_test + ./$^