File: Makefile.tests

package info (click to toggle)
libpeas 1.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,328 kB
  • sloc: sh: 11,723; ansic: 11,717; makefile: 938; python: 54; xml: 27
file content (67 lines) | stat: -rw-r--r-- 1,647 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
GTESTER = gtester

TEST_PROGS =

test: all
	@test -z "$(TEST_PROGS)" || \
	 G_SLICE=debug-blocks $(GTESTER) --verbose $(TEST_PROGS)

if GDB_ENABLED

test-gdb: all
	@test -z "$(TEST_PROGS)" || \
	 for test_prog in $(TEST_PROGS) ; do \
	   G_SLICE=debug-blocks $(GTESTER) --verbose $$test_prog || { \
	     G_SLICE=debug-blocks \
	       libtool --mode=execute gdb --ex "run --verbose" $$test_prog ; \
	     exit 1 ; \
	   } \
	 done

else

test-gdb:
	@echo "You need GDB"

endif # GDB_ENABLED

if VALGRIND_ENABLED

test-valgrind: all
	@test -z "$(TEST_PROGS)" || \
	 for test_prog in $(TEST_PROGS) ; do \
	   if test -e vgdump-$$test_prog; then \
	     unlink vgdump-$$test_prog; \
	   fi ; \
	   G_SLICE=always-malloc G_DEBUG=gc-friendly,resident-modules \
	     libtool --mode=execute valgrind --leak-check=full \
	     --leak-resolution=high --num-callers=20 \
	     --suppressions=$(top_srcdir)/tests/valgrind.suppressions \
	     --log-file=vgdump-$$test_prog $$test_prog || exit 1 ; \
	 done

test-callgrind: all
	@test -z "$(TEST_PROGS)" || \
	 for test_prog in $(TEST_PROGS) ; do \
	   if test -e cgdump-$$test_prog; then \
	     unlink cgdump-$$test_prog; \
	   fi ; \
	   libtool --mode=execute valgrind --tool=callgrind \
	     --callgrind-out-file=cgdump-$$test_prog \
	     --log-file=/dev/null $$test_prog || exit 1 ; \
	 done

else

test-valgrind test-callgrind:
	@echo "You need Valgrind"

endif # VALGRIND_ENABLED

generate-report: all
	@test -z "$(TEST_PROGS)" || \
	 G_SLICE=debug-blocks $(GTESTER) $(GTESTER_ARGS) $(TEST_PROGS)

CLEANFILES = cgdump-* vgdump-*

.PHONY: test test-gdb test-valgrind test-callgrind generate-report