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
1 1
ACLOCAL_AMFLAGS = -I m4
2 2

	
3 3
AM_CXXFLAGS = $(WARNINGCXXFLAGS)
4 4

	
5 5
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
6 6
LDADD = $(top_builddir)/lemon/libemon.la
7 7

	
8 8
EXTRA_DIST = \
9 9
	AUTHORS \
10 10
	LICENSE \
11 11
	m4/lx_check_cplex.m4 \
12 12
	m4/lx_check_glpk.m4 \
13 13
	m4/lx_check_soplex.m4 \
14 14
	m4/lx_check_coin.m4 \
15 15
	CMakeLists.txt \
16 16
	cmake/FindGhostscript.cmake \
17 17
	cmake/FindCPLEX.cmake \
18 18
	cmake/FindGLPK.cmake \
19 19
	cmake/FindCOIN.cmake \
20 20
	cmake/LEMONConfig.cmake.in \
21 21
	cmake/version.cmake.in \
22 22
	cmake/version.cmake \
23 23
	cmake/nsis/lemon.ico \
24 24
	cmake/nsis/uninstall.ico
25 25

	
26 26
pkgconfigdir = $(libdir)/pkgconfig
27 27
lemondir = $(pkgincludedir)
28 28
bitsdir = $(lemondir)/bits
29 29
conceptdir = $(lemondir)/concepts
30 30
pkgconfig_DATA =
31 31
lib_LTLIBRARIES =
32 32
lemon_HEADERS =
33 33
bits_HEADERS =
34 34
concept_HEADERS =
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 \
59 60
	build-aux/config.guess \
60 61
	build-aux/config.sub \
61 62
	build-aux/depcomp \
62 63
	build-aux/install-sh \
63 64
	build-aux/ltmain.sh \
64 65
	build-aux/missing \
65 66
	doc/doxygen.log
66 67

	
67 68
mrproper:
68 69
	$(MAKE) $(AM_MAKEFLAGS) maintainer-clean
69 70
	-rm -f $(MRPROPERFILES)
70 71

	
71 72
dist-bz2: dist
72 73
	zcat $(PACKAGE)-$(VERSION).tar.gz | \
73 74
	bzip2 --best -c > $(PACKAGE)-$(VERSION).tar.bz2
74 75

	
75 76
distcheck-bz2: distcheck
76 77
	zcat $(PACKAGE)-$(VERSION).tar.gz | \
77 78
	bzip2 --best -c > $(PACKAGE)-$(VERSION).tar.bz2
78 79

	
79 80
.PHONY: demo mrproper dist-bz2 distcheck-bz2
Ignore white space 6144 line context
1 1
dnl Process this file with autoconf to produce a configure script.
2 2

	
3 3
dnl Version information.
4 4
m4_define([lemon_version_number],
5 5
          [m4_normalize(esyscmd([echo ${LEMON_VERSION}]))])
6 6
dnl m4_define([lemon_version_number], [])
7 7
m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))])
8 8
m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i 2> /dev/null]))])
9 9
m4_define([lemon_version], [ifelse(lemon_version_number(),
10 10
                           [],
11 11
                           [ifelse(lemon_hg_revision(),
12 12
                           [],
13 13
                           [hg-tip],
14 14
                           [lemon_hg_path().lemon_hg_revision()])],
15 15
                           [lemon_version_number()])])
16 16

	
17 17
AC_PREREQ([2.59])
18 18
AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon])
19 19
AC_CONFIG_AUX_DIR([build-aux])
20 20
AC_CONFIG_MACRO_DIR([m4])
21 21
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects nostdinc])
22 22
AC_CONFIG_SRCDIR([lemon/list_graph.h])
23 23
AC_CONFIG_HEADERS([config.h lemon/config.h])
24 24

	
25 25
AC_DEFINE([LEMON_VERSION], [lemon_version()], [The version string])
26 26

	
27 27
dnl Do compilation tests using the C++ compiler.
28 28
AC_LANG([C++])
29 29

	
30 30
dnl Check the existence of long long type.
31 31
AC_CHECK_TYPE(long long, [long_long_found=yes], [long_long_found=no])
32 32
if test x"$long_long_found" = x"yes"; then
33 33
  AC_DEFINE([LEMON_HAVE_LONG_LONG], [1], [Define to 1 if you have long long.])
34 34
fi
35 35

	
36 36
dnl Checks for programs.
37 37
AC_PROG_CXX
38 38
AC_PROG_CXXCPP
39 39
AC_PROG_INSTALL
40 40
AC_DISABLE_SHARED
41 41
AC_PROG_LIBTOOL
42 42

	
43 43
AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
44 44
AC_CHECK_PROG([python_found],[python],[yes],[no])
45 45
AC_CHECK_PROG([gs_found],[gs],[yes],[no])
46 46

	
47 47
dnl Detect Intel compiler.
48 48
AC_MSG_CHECKING([whether we are using the Intel C++ compiler])
49 49
AC_COMPILE_IFELSE([#ifndef __INTEL_COMPILER
50 50
choke me
51 51
#endif], [ICC=[yes]], [ICC=[no]])
52 52
if test x"$ICC" = x"yes"; then
53 53
  AC_MSG_RESULT([yes])
54 54
else
55 55
  AC_MSG_RESULT([no])
56 56
fi
57 57

	
58 58
dnl Set custom compiler flags when using g++.
59 59
if test "$GXX" = yes -a "$ICC" = no; then
60 60
  WARNINGCXXFLAGS="-Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas"
61 61
fi
62 62
AC_SUBST([WARNINGCXXFLAGS])
63 63

	
64 64
dnl Checks for libraries.
65 65
LX_CHECK_GLPK
66 66
LX_CHECK_CPLEX
67 67
LX_CHECK_SOPLEX
68 68
LX_CHECK_COIN
69 69

	
70 70
AM_CONDITIONAL([HAVE_LP], [test x"$lx_lp_found" = x"yes"])
71 71
AM_CONDITIONAL([HAVE_MIP], [test x"$lx_mip_found" = x"yes"])
72 72

	
73 73
dnl Disable/enable building the binary tools.
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
98 113
AC_CHECK_FUNCS(gettimeofday times ctime_r)
99 114

	
100 115
dnl Add dependencies on files generated by configure.
101 116
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],
102 117
  ['$(top_srcdir)/doc/Doxyfile.in $(top_srcdir)/lemon/lemon.pc.in $(top_srcdir)/cmake/version.cmake.in'])
103 118

	
104 119
AC_CONFIG_FILES([
105 120
Makefile
106 121
demo/Makefile
107 122
cmake/version.cmake
108 123
doc/Doxyfile
109 124
lemon/lemon.pc
110 125
])
111 126

	
112 127
AC_OUTPUT
113 128

	
114 129
echo
115 130
echo '****************************** SUMMARY ******************************'
116 131
echo
117 132
echo Package version............... : $PACKAGE-$VERSION
118 133
echo
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 6 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 \
13 17
	test/connectivity_test \
14 18
	test/counter_test \
15 19
	test/dfs_test \
16 20
	test/digraph_test \
17 21
	test/dijkstra_test \
18 22
	test/dim_test \
19 23
	test/edge_set_test \
20 24
	test/error_test \
21 25
	test/euler_test \
22 26
	test/gomory_hu_test \
23 27
	test/graph_copy_test \
24 28
	test/graph_test \
25 29
	test/graph_utils_test \
26 30
	test/hao_orlin_test \
27 31
	test/heap_test \
28 32
	test/kruskal_test \
29 33
	test/maps_test \
30 34
	test/matching_test \
31 35
	test/min_cost_arborescence_test \
32 36
	test/min_cost_flow_test \
33 37
	test/min_mean_cycle_test \
34 38
	test/path_test \
35 39
	test/preflow_test \
36 40
	test/radix_sort_test \
37 41
	test/random_test \
38 42
	test/suurballe_test \
39 43
	test/test_tools_fail \
40 44
	test/test_tools_pass \
41 45
	test/time_measure_test \
42 46
	test/unionfind_test
43 47

	
44 48
test_test_tools_pass_DEPENDENCIES = demo
45 49

	
46 50
if HAVE_LP
47 51
check_PROGRAMS += test/lp_test
48 52
endif HAVE_LP
49 53
if HAVE_MIP
50 54
check_PROGRAMS += test/mip_test
51 55
endif HAVE_MIP
52 56

	
53 57
TESTS += $(check_PROGRAMS)
54 58
XFAIL_TESTS += test/test_tools_fail$(EXEEXT)
55 59

	
56 60
test_adaptors_test_SOURCES = test/adaptors_test.cc
57 61
test_bellman_ford_test_SOURCES = test/bellman_ford_test.cc
58 62
test_bfs_test_SOURCES = test/bfs_test.cc
59 63
test_circulation_test_SOURCES = test/circulation_test.cc
60 64
test_counter_test_SOURCES = test/counter_test.cc
61 65
test_connectivity_test_SOURCES = test/connectivity_test.cc
62 66
test_dfs_test_SOURCES = test/dfs_test.cc
63 67
test_digraph_test_SOURCES = test/digraph_test.cc
64 68
test_dijkstra_test_SOURCES = test/dijkstra_test.cc
65 69
test_dim_test_SOURCES = test/dim_test.cc
66 70
test_edge_set_test_SOURCES = test/edge_set_test.cc
67 71
test_error_test_SOURCES = test/error_test.cc
68 72
test_euler_test_SOURCES = test/euler_test.cc
69 73
test_gomory_hu_test_SOURCES = test/gomory_hu_test.cc
70 74
test_graph_copy_test_SOURCES = test/graph_copy_test.cc
71 75
test_graph_test_SOURCES = test/graph_test.cc
72 76
test_graph_utils_test_SOURCES = test/graph_utils_test.cc
73 77
test_heap_test_SOURCES = test/heap_test.cc
74 78
test_kruskal_test_SOURCES = test/kruskal_test.cc
75 79
test_hao_orlin_test_SOURCES = test/hao_orlin_test.cc
76 80
test_lp_test_SOURCES = test/lp_test.cc
77 81
test_maps_test_SOURCES = test/maps_test.cc
78 82
test_mip_test_SOURCES = test/mip_test.cc
79 83
test_matching_test_SOURCES = test/matching_test.cc
80 84
test_min_cost_arborescence_test_SOURCES = test/min_cost_arborescence_test.cc
81 85
test_min_cost_flow_test_SOURCES = test/min_cost_flow_test.cc
82 86
test_min_mean_cycle_test_SOURCES = test/min_mean_cycle_test.cc
83 87
test_path_test_SOURCES = test/path_test.cc
84 88
test_preflow_test_SOURCES = test/preflow_test.cc
85 89
test_radix_sort_test_SOURCES = test/radix_sort_test.cc
86 90
test_suurballe_test_SOURCES = test/suurballe_test.cc
87 91
test_random_test_SOURCES = test/random_test.cc
88 92
test_test_tools_fail_SOURCES = test/test_tools_fail.cc
89 93
test_test_tools_pass_SOURCES = test/test_tools_pass.cc
90 94
test_time_measure_test_SOURCES = test/time_measure_test.cc
91 95
test_unionfind_test_SOURCES = test/unionfind_test.cc
0 comments (0 inline)