From ec9ed53fc1c67ae26133490704e39a3f7f7e3cee Mon Sep 17 00:00:00 2001 From: Andres Mejia Date: Tue, 19 Jun 2012 11:18:58 -0400 Subject: [GSOC] Have the testsuite built when the 'check' target is invoked. Support a separate target named 'testsuite' which builds the test suite without running it. Also note that a configure option (--enable-gtest) must explicitely be set in order to configure the Google Test Framework. If it is not set, running the 'check,' 'testsuite,' or 'testframework,' make targets will simply display a message saying the framework has not been configured. --- Makefile.in | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index cef82b880a..2b25695a01 100644 --- a/Makefile.in +++ b/Makefile.in @@ -241,6 +241,7 @@ FINAL_TARGETS=xbmc.bin skins xbmc-xrandr endif FINAL_TARGETS+=Makefile externals +GTEST_DIR = lib/gtest CHECK_DIRS = xbmc/utils/test \ xbmc/threads/test @@ -252,7 +253,8 @@ all : $(FINAL_TARGETS) include Makefile.include .PHONY : dllloader exports visualizations screensavers eventclients papcodecs \ - dvdpcodecs imagelib codecs externals force skins libaddon + dvdpcodecs imagelib codecs externals force skins libaddon check \ + testframework testsuite # hack targets to keep build system up to date Makefile : config.status $(addsuffix .in, $(AUTOGENERATED_MAKEFILES)) @@ -573,5 +575,21 @@ clean-codecs: clean-dvdpcodecs clean-papcodecs clean-externals: clean-codecs clean-eventclients clean-xbmctex clean-libs \ clean-screensavers clean-visualisations clean-libaddons -check: +ifeq (1,@GTEST_CONFIGURED@) +check: testsuite for d in $(CHECK_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d $@; fi; done + +testsuite: testframework + for d in $(CHECK_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d $@; fi; done + +testframework: $(GTEST_DIR)/lib/.libs/libgtest.a $(GTEST_DIR)/lib/.libs/libgtest_main.a + +$(GTEST_DIR)/lib/.libs/libgtest.a $(GTEST_DIR)/lib/.libs/libgtest_main.a: $(GTEST_DIR)/Makefile + +$(GTEST_DIR)/Makefile: force + $(MAKE) -C $(GTEST_DIR) +else +# Give a message that the framework is not configured, but don't fail. +check testsuite testframework: + @echo "Google Test Framework not configured, skipping testsuite check." +endif -- cgit v1.2.3