-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile.am
More file actions
75 lines (70 loc) · 2.87 KB
/
Copy pathMakefile.am
File metadata and controls
75 lines (70 loc) · 2.87 KB
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
SUBDIRS = hmac main
dist_doc_DATA = README.md
EXTRA_DIST = $(top_srcdir)/uthash/uthash.h \
$(top_srcdir)/main/myanon-sample.conf \
$(top_srcdir)/debian/changelog \
$(top_srcdir)/debian/control \
$(top_srcdir)/debian/copyright \
$(top_srcdir)/debian/manpages \
$(top_srcdir)/debian/rules \
$(top_srcdir)/debian/source/format
TULIST = test1 test1-insert-ignore null-example appendkey prependkey issue29 issue52 issue55 issue_semicolon_truncate test_substring appendindex prependindex test_regex complex
PYTULIST = test_python test_large_python test_large_python_2 test_row_context test_pyargs test_latin1
PYTHON_SUPPORT = @PYTHON_SUPPORT@
check: all
@rc=0; \
for ut in $(TULIST); do \
main/myanon -f tests/$${ut}.conf < tests/$${ut}.sql | diff tests/$${ut}_anon.sql - > /dev/null; \
if [ $$? -eq 0 ]; then \
echo "Test $${ut} OK" >&2; \
else \
echo "Test $${ut} FAILED" >&2; \
rc=1; \
fi \
done; \
if test "x$(PYTHON_SUPPORT)" = "xyes"; then \
for ut in $(PYTULIST); do \
main/myanon -f tests/$${ut}.conf < tests/$${ut}.sql | diff tests/$${ut}_anon.sql - > /dev/null; \
if [ $$? -eq 0 ]; then \
echo "Test $${ut} OK" >&2; \
else \
echo "Test $${ut} FAILED" >&2; \
rc=1; \
fi \
done; \
fi; \
exit $$rc
valgrind-check: all
@if [ "$$(uname)" != "Linux" ]; then echo "valgrind-check is only supported on Linux" >&2; exit 1; fi
@which valgrind > /dev/null 2>&1 || { echo "valgrind not found" >&2; exit 1; }
@rc=0; \
for ut in $(TULIST); do \
valgrind --leak-check=full --error-exitcode=99 main/myanon -f tests/$${ut}.conf < tests/$${ut}.sql 2>valgrind_$${ut}.log | diff tests/$${ut}_anon.sql - > /dev/null; \
vrc=$$?; \
leaks=$$(grep "definitely lost:" valgrind_$${ut}.log | grep -v "0 bytes" || true); \
errors=$$(grep "ERROR SUMMARY:" valgrind_$${ut}.log | grep -v "0 errors" || true); \
if [ $$vrc -eq 0 ] && [ -z "$$leaks" ] && [ -z "$$errors" ]; then \
echo "Test $${ut} OK (valgrind clean)" >&2; \
else \
echo "Test $${ut} FAILED (see valgrind_$${ut}.log)" >&2; \
rc=1; \
fi; \
rm -f valgrind_$${ut}.log; \
done; \
if test "x$(PYTHON_SUPPORT)" = "xyes"; then \
for ut in $(PYTULIST); do \
valgrind --leak-check=full --error-exitcode=99 main/myanon -f tests/$${ut}.conf < tests/$${ut}.sql 2>valgrind_$${ut}.log | diff tests/$${ut}_anon.sql - > /dev/null; \
vrc=$$?; \
leaks=$$(grep "definitely lost:" valgrind_$${ut}.log | grep -v "0 bytes" || true); \
errors=$$(grep "ERROR SUMMARY:" valgrind_$${ut}.log | grep -v "0 errors" || true); \
if [ $$vrc -eq 0 ] && [ -z "$$leaks" ] && [ -z "$$errors" ]; then \
echo "Test $${ut} OK (valgrind clean)" >&2; \
else \
echo "Test $${ut} FAILED (see valgrind_$${ut}.log)" >&2; \
rc=1; \
fi; \
rm -f valgrind_$${ut}.log; \
done; \
fi; \
exit $$rc
.PHONY: check valgrind-check