summaryrefslogtreecommitdiff
path: root/test/libapt/makefile
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
committerMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
commit21248c0f00ee71412dbadc6ebf84011cf974346d (patch)
tree7dc1f5904399482d2128765b5b86d57a4ac5b3e1 /test/libapt/makefile
parente5f34ad3b043abf033c1626eb8449b75955d6760 (diff)
parent4fc6b7570c3e97b65c118b58cdf6729fa94c9b03 (diff)
Merge branch 'debian/experimental' into feature/srv-records
Conflicts: cmdline/apt-helper.cc cmdline/makefile
Diffstat (limited to 'test/libapt/makefile')
-rw-r--r--test/libapt/makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/libapt/makefile b/test/libapt/makefile
index 69a13fd92..61a8aaf31 100644
--- a/test/libapt/makefile
+++ b/test/libapt/makefile
@@ -8,14 +8,15 @@ APT_DOMAIN=none
include ../../buildlib/defaults.mak
.PHONY: test
+ifeq (file-okay,$(shell $(CC) -I $(BASE)/build/include -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)
$(BIN)/gtest$(BASENAME): $(LIB)/gtest.a
PROGRAM = gtest${BASENAME}
-SLIBS = -lapt-pkg -pthread $(LIB)/gtest.a
-LIB_MAKES = apt-pkg/makefile
+SLIBS = -lapt-pkg -lapt-private -pthread $(LIB)/gtest.a
+LIB_MAKES = apt-pkg/makefile apt-private/makefile
SOURCE = gtest_runner.cc $(wildcard *-helpers.cc *_test.cc)
include $(PROGRAM_H)
@@ -71,3 +72,12 @@ $(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."
+ $(CC) -I $(BASE)/build/include -M gtest_runner.cc
+ exit 100
+endif