gravatar
ladanyi@tmit.bme.hu
ladanyi@tmit.bme.hu
Optionally use valgrind when running tests + other build system fixes
0 4 2
default
6 files changed with 50 insertions and 0 deletions:
↑ Collapse diff ↑
Ignore white space 6 line context
1
EXTRA_DIST += \
2
	scripts/bib2dox.py \
3
	scripts/bootstrap.sh \
4
	scripts/chg-len.py \
5
	scripts/mk-release.sh \
6
	scripts/unify-sources.sh \
7
	scripts/valgrind-wrapper.sh
Ignore white space 6 line context
1
#!/bin/sh
2

	
3
# Run in valgrind, with leak checking enabled
4

	
5
valgrind -q --leak-check=full "$@" 2> .valgrind-log
6

	
7
# Save the test result
8

	
9
result="$?"
10

	
11
# Valgrind should generate no error messages
12

	
13
log_contents="`cat .valgrind-log`"
14

	
15
if [ "$log_contents" != "" ]; then
16
        cat .valgrind-log >&2
17
        result=1
18
fi
19

	
20
rm -f .valgrind-log
21

	
22
exit $result
Ignore white space 6 line context
... ...
@@ -35,24 +35,25 @@
35 35
noinst_HEADERS =
36 36
noinst_PROGRAMS =
37 37
bin_PROGRAMS =
38 38
check_PROGRAMS =
39 39
dist_bin_SCRIPTS =
40 40
TESTS =
41 41
XFAIL_TESTS =
42 42

	
43 43
include lemon/Makefile.am
44 44
include test/Makefile.am
45 45
include doc/Makefile.am
46 46
include tools/Makefile.am
47
include scripts/Makefile.am
47 48

	
48 49
DIST_SUBDIRS = demo
49 50

	
50 51
demo:
51 52
	$(MAKE) $(AM_MAKEFLAGS) -C demo
52 53

	
53 54
MRPROPERFILES = \
54 55
	aclocal.m4 \
55 56
	config.h.in \
56 57
	config.h.in~ \
57 58
	configure \
58 59
	Makefile.in \
Ignore white space 6 line context
... ...
@@ -74,24 +74,39 @@
74 74
AC_ARG_ENABLE([tools],
75 75
AS_HELP_STRING([--enable-tools], [build additional tools @<:@default@:>@])
76 76
AS_HELP_STRING([--disable-tools], [do not build additional tools]),
77 77
              [], [enable_tools=yes])
78 78
AC_MSG_CHECKING([whether to build the additional tools])
79 79
if test x"$enable_tools" != x"no"; then
80 80
  AC_MSG_RESULT([yes])
81 81
else
82 82
  AC_MSG_RESULT([no])
83 83
fi
84 84
AM_CONDITIONAL([WANT_TOOLS], [test x"$enable_tools" != x"no"])
85 85

	
86
dnl Support for running test cases using valgrind.
87
use_valgrind=no
88
AC_ARG_ENABLE([valgrind],
89
AS_HELP_STRING([--enable-valgrind], [use valgrind when running tests]),
90
              [use_valgrind=yes])
91

	
92
if [[ "$use_valgrind" = "yes" ]]; then
93
  AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
94

	
95
  if [[ "$HAVE_VALGRIND" = "no" ]]; then
96
    AC_MSG_ERROR([Valgrind not found in PATH.])
97
  fi
98
fi
99
AM_CONDITIONAL(USE_VALGRIND, [test "$use_valgrind" = "yes"])
100

	
86 101
dnl Checks for header files.
87 102
AC_CHECK_HEADERS(limits.h sys/time.h sys/times.h unistd.h)
88 103

	
89 104
dnl Checks for typedefs, structures, and compiler characteristics.
90 105
AC_C_CONST
91 106
AC_C_INLINE
92 107
AC_TYPE_SIZE_T
93 108
AC_HEADER_TIME
94 109
AC_STRUCT_TM
95 110

	
96 111
dnl Checks for library functions.
97 112
AC_HEADER_STDC
... ...
@@ -119,22 +134,23 @@
119 134
echo C++ compiler.................. : $CXX
120 135
echo C++ compiles flags............ : $WARNINGCXXFLAGS $CXXFLAGS
121 136
echo
122 137
echo Compiler supports long long... : $long_long_found
123 138
echo
124 139
echo GLPK support.................. : $lx_glpk_found
125 140
echo CPLEX support................. : $lx_cplex_found
126 141
echo SOPLEX support................ : $lx_soplex_found
127 142
echo CLP support................... : $lx_clp_found
128 143
echo CBC support................... : $lx_cbc_found
129 144
echo
130 145
echo Build additional tools........ : $enable_tools
146
echo Use valgrind for tests........ : $use_valgrind
131 147
echo
132 148
echo The packace will be installed in
133 149
echo -n '  '
134 150
echo $prefix.
135 151
echo
136 152
echo '*********************************************************************'
137 153

	
138 154
echo
139 155
echo Configure complete, now type \'make\' and then \'make install\'.
140 156
echo
Ignore white space 24 line context
modified binary file chmod 100644 => 100755
Ignore white space 6 line context
1
if USE_VALGRIND
2
TESTS_ENVIRONMENT=$(top_srcdir)/scripts/valgrind-wrapper.sh
3
endif
4

	
1 5
EXTRA_DIST += \
2 6
	test/CMakeLists.txt
3 7

	
4 8
noinst_HEADERS += \
5 9
	test/graph_test.h \
6 10
	test/test_tools.h
7 11

	
8 12
check_PROGRAMS += \
9 13
	test/adaptors_test \
10 14
	test/bellman_ford_test \
11 15
	test/bfs_test \
12 16
	test/circulation_test \
0 comments (0 inline)