-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.tests.am
87 lines (74 loc) · 2.5 KB
/
Makefile.tests.am
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
if BUILD_CHECK_TESTS
TESTS_BIN = gst_buzztrax
else
TESTS_BIN =
endif
TESTS = \
$(TESTS_BIN)
# prevent endless loops, this requires bash, see idea in bt-check.c
# ulimit -St20;
#
TESTS_ENVIRONMENT = \
CK_DEFAULT_TIMEOUT=20 \
LANG=C \
$(LIBTOOL) --mode=execute
if BUILD_CHECK_TESTS
noinst_PROGRAMS=$(TESTS_BIN)
gst_buzztrax_LDADD = \
libgstbuzztrax.la \
$(BASE_DEPS_LIBS) $(CHECK_LIBS)
gst_buzztrax_CFLAGS = \
-I$(srcdir) -I$(top_srcdir) \
-DG_LOG_DOMAIN=\"gst-buzztrax-check\" \
$(BASE_DEPS_CFLAGS) $(CHECK_CFLAGS)
gst_buzztrax_SOURCES = \
tests/m-gst-buzztrax.c tests/m-gst-buzztrax.h \
tests/s-gst-note2frequency.c tests/e-gst-note2frequency.c tests/t-gst-note2frequency.c \
tests/s-elements.c tests/t-elements.c
endif
# make check -- run all checks
# make (test).check -- run the given check once
# make (test).check BT_CHECKS="test5*" -- run the given testcase(s) only
%.check: %
@$(TESTS_ENVIRONMENT) \
./$*
# make (test).gdb -- start up gdb for the given test
%.gdb: %
@CK_FORK=no \
$(TESTS_ENVIRONMENT) \
gdb ./$*
# make (test).refdbg -- start up refdbg for the given test
%.refdbg: %
@CK_FORK=no \
$(TESTS_ENVIRONMENT) \
refdbg -c "btnum=20 ; logobjs=0 ; $(REFDBG_RULE)" \
./$*
if USE_VALGRIND
VALPREFIX = \
CK_FORK=no CK_DEFAULT_TIMEOUT=500 \
LANG=C XDG_CACHE_HOME=$(abs_builddir) \
G_SLICE=always-malloc G_DEBUG=gc-friendly \
GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1
VALDEFAULT = @VALGRIND@/bin/valgrind
VALSUPP = @VALGRIND@/lib/valgrind
VALSUPPRESSIONDEF = --suppressions=$(VALSUPP)/default.supp
VALSUPPRESSIONOWN = --suppressions=$(top_builddir)/buzztrax.supp \
--suppressions=$(top_builddir)/gst.supp \
--suppressions=$(top_builddir)/gtk.supp
VALSUPPRESSION = $(VALSUPPRESSIONDEF) $(VALSUPPRESSIONOWN)
VALOPTIONS = --trace-children=yes --num-callers=30 --read-var-info=yes \
--tool=memcheck --leak-check=full --leak-resolution=high --track-origins=yes
VALCMD = $(VALPREFIX) $(VALDEFAULT) $(VALOPTIONS) $(VALSUPPRESSION)
## for file in /tmp/bt_core.valgrind.pid*; do grep -q "ERROR SUMMARY: 0 errors from 0 contexts" $file ; if test $? == 0; then rm $file; fi; done
## grep -H "ERROR SUMMARY: " /tmp/bt_core.valgrind.pid* | uniq
# make valgrind -- valgrind all tests
valgrind:: $(TESTS_BIN)
for i in $^; do \
rm -rf /tmp/$$i.valgrind.pid*; \
$(VALCMD) --log-file=/tmp/$$i_valgrind.pid%p ./$$i; \
done
# make (test).valgrind -- valgrind the given test"
%.valgrind: %
rm -rf /tmp/$*.valgrind.pid*; \
$(VALCMD) --log-file=/tmp/$*.valgrind.pid%p ./$*;
endif