aboutsummaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorAndres Mejia <amejia004@gmail.com>2012-06-19 11:18:58 -0400
committerAndres Mejia <amejia004@gmail.com>2012-09-05 15:07:36 -0400
commitec9ed53fc1c67ae26133490704e39a3f7f7e3cee (patch)
treeba3318e8964877fa8643562db31996568f54d411 /Makefile.in
parentcda15bbd46de0884b663df156e9ccab1a056ff2f (diff)
[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.
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in22
1 files changed, 20 insertions, 2 deletions
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