summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-03-17 16:51:29 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-04-19 01:13:08 +0200
commit42fab5fbc85e243b958beff95912c46fb81abcc0 (patch)
tree7d1fac8edb2eb642e7136604fa549e3676b0c18a /test
parentf51401eb51939bfc932519601c43822a0aa5e343 (diff)
demote missing gtest to a buildtime warning
We just need it for unit tests and our debian/rules file actually skips calling them if nocheck is given… but this fails anyhow as we declared a hard-dependency on it. Demoting the error to a warning in configuration and adding a test in the 'make test' path with a friendly message allows nocheck to be useful again. (Running unit tests is fully encouraged of course, but bootstrappers and co do not need to be burdened with this stuff)
Diffstat (limited to 'test')
-rw-r--r--test/libapt/makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/libapt/makefile b/test/libapt/makefile
index 7f23ace46..0f8df291f 100644
--- a/test/libapt/makefile
+++ b/test/libapt/makefile
@@ -8,6 +8,7 @@ APT_DOMAIN=none
include ../../buildlib/defaults.mak
.PHONY: test
+ifeq (file-okay,$(shell $(CC) -M gtest_runner.cc >/dev/null 2>&1 && echo 'file-okay'))
test: $(BIN)/gtest$(BASENAME)
MALLOC_PERTURB_=21 MALLOC_CHECK_=2 LD_LIBRARY_PATH=$(LIB) $(BIN)/gtest$(BASENAME)
@@ -71,3 +72,11 @@ $(LIB)/gtest.a: $(OBJ)/gtest-all.o
echo Building static library $@
-rm -f $@
$(AR) $(ARFLAGS) $@ $^
+
+else
+test:
+ @echo "APT uses Googles C++ testing framework for its unit tests"
+ @echo "On Debian systems this is available in the 'libgtest-dev' package."
+ @echo "Please install it before attempting to run the unit tests."
+ exit 100
+endif