From 3b7cacef391e46a896650e9a7268119e882b9f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Sun, 11 Dec 2011 12:08:30 +0000 Subject: [PATCH] middle of porting; unstable, don't checkout, tests run but fail; refs #1 --- src/makefile.am | 2 +- {src/mrw => test}/configfile.ini | 0 {src/mrw => test}/configfile.ini.result | 0 test/makefile.am | 188 +++++++++++++++++++++++- 4 files changed, 181 insertions(+), 9 deletions(-) rename {src/mrw => test}/configfile.ini (100%) rename {src/mrw => test}/configfile.ini.result (100%) diff --git a/src/makefile.am b/src/makefile.am index 0f75643..5d4cbd3 100644 --- a/src/makefile.am +++ b/src/makefile.am @@ -27,7 +27,7 @@ pkgconfig2_DATA = $(pkgconfig_DATA) EXTRA_DIST = $(pkgconfig_DATA).in -LDFLAGS = -version-info ${LIB_VERSION} +AM_LDFLAGS = -version-info ${LIB_VERSION} lib_LTLIBRARIES = libmrw.la if HAVE_BOOST_THREAD diff --git a/src/mrw/configfile.ini b/test/configfile.ini similarity index 100% rename from src/mrw/configfile.ini rename to test/configfile.ini diff --git a/src/mrw/configfile.ini.result b/test/configfile.ini.result similarity index 100% rename from src/mrw/configfile.ini.result rename to test/configfile.ini.result diff --git a/test/makefile.am b/test/makefile.am index 0b5f6b7..748e2df 100644 --- a/test/makefile.am +++ b/test/makefile.am @@ -3,15 +3,187 @@ ## 1 2 3 4 5 6 7 8 ## 45678901234567890123456789012345678901234567890123456789012345678901234567890 -AM_CXXFLAGS += -I ${top_srcdir}/src -AM_LDFLAGS = -L${top_builddir}/src -LDADD = -lcppunit +VALGRIND_CHECKS = auto_test smartpointer_test stdext_test \ + tokenizer_test string_test +NO_VALGRIND_CHECKS = +if HAVE_DIR + VALGRIND_CHECKS += configfile_test + dist_check_SCRIPTS = configfile_check.sh +endif +if HAVE_REGEXP + VALGRIND_CHECKS += regexp_test +endif +if HAVE_EXEC + VALGRIND_CHECKS += exec_test +endif +if HAVE_LTDL + VALGRIND_CHECKS += dynamiclibrary_test +endif +if HAVE_LOG4CXX + VALGRIND_CHECKS += functiontrace_test +endif +if HAVE_STACKTRACE + NO_VALGRIND_CHECKS += stacktrace_test + VALGRIND_CHECKS += mrwexcstderr_test +if HAVE_LOG4CXX + VALGRIND_CHECKS += mrwexclog4cxx_test +if AUTOFNTRACE + NO_VALGRIND_CHECKS += mrwautofunctiontracelog4cxx_test +if HAVE_THREADS +if HAVE_BOOST_THREAD + NO_VALGRIND_CHECKS += mrwautofunctiontracelog4cxx_test-mt +endif +endif +endif +endif +endif -check_PROGRAMS = mrw-c++_test +auto_test_SOURCES = auto_test.cxx +auto_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 +auto_test_CXXFLAGS = -g3 -O0 +auto_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src +auto_test_LDADD = -lmrw +if HAVE_STACKTRACE + auto_test_LDADD += -lmrwexcstderr +endif +smartpointer_test_SOURCES = smartpointer_test.cxx +smartpointer_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 +smartpointer_test_CXXFLAGS = -g3 -O0 +smartpointer_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src +smartpointer_test_LDADD = -lmrw +if HAVE_STACKTRACE + smartpointer_test_LDADD += -lmrwexcstderr +endif +if HAVE_EXEC +exec_test_SOURCES = exec_test.cxx +exec_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 +exec_test_CXXFLAGS = -g3 -O0 +exec_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src +exec_test_LDADD = -lmrw +if HAVE_STACKTRACE + exec_test_LDADD += -lmrwexcstderr +endif +endif +stdext_test_SOURCES = stdext_test.cxx +stdext_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 +stdext_test_CXXFLAGS = -g3 -O0 +stdext_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src +stdext_test_LDADD = -lmrw +if HAVE_STACKTRACE + stdext_test_LDADD += -lmrwexcstderr +endif +string_test_SOURCES = string_test.cxx +string_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 +string_test_CXXFLAGS = -g3 -O0 +string_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src +string_test_LDADD = -lmrw +if HAVE_STACKTRACE + string_test_LDADD += -lmrwexcstderr +endif +if HAVE_REGEXP + regexp_test_SOURCES = regexp_test.cxx + regexp_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 + regexp_test_CXXFLAGS = -g3 -O0 + regexp_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src + regexp_test_LDADD = -lmrw +if HAVE_STACKTRACE + regexp_test_LDADD += -lmrwexcstderr +endif +endif +tokenizer_test_SOURCES = tokenizer_test.cxx +tokenizer_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 +tokenizer_test_CXXFLAGS = -g3 -O0 +tokenizer_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src +tokenizer_test_LDADD = -lmrw +if HAVE_STACKTRACE + tokenizer_test_LDADD += -lmrwexcstderr +endif +if HAVE_DIR + configfile_test_SOURCES = configfile_test.cxx + configfile_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 + configfile_test_CXXFLAGS = -g3 -O0 + configfile_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src + configfile_test_LDADD = -lmrw +if HAVE_STACKTRACE + configfile_test_LDADD += -lmrwexcstderr +endif +endif +if HAVE_LTDL + check_LTLIBRARIES = libdynamiclibrary_testlib.la + libdynamiclibrary_testlib_la_SOURCES = dynamiclibrary_testlib.cxx + libdynamiclibrary_testlib_la_LDFLAGS = -module -rpath /bullshit + dynamiclibrary_test_SOURCES = dynamiclibrary_test.cxx + dynamiclibrary_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 + dynamiclibrary_test_CXXFLAGS = -g3 -O0 + dynamiclibrary_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src + dynamiclibrary_test_LDADD = -lmrw -lltdl +endif +if HAVE_LOG4CXX + functiontrace_test_SOURCES = functiontrace_test.cxx + functiontrace_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 + functiontrace_test_CXXFLAGS = -g3 -O0 + functiontrace_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src + functiontrace_test_LDADD = -lmrw -llog4cxx +if HAVE_STACKTRACE + functiontrace_test_LDADD += -lmrwexcstderr +endif +endif +if HAVE_STACKTRACE + stacktrace_test_SOURCES = stacktrace_test.cxx + stacktrace_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 + stacktrace_test_CXXFLAGS = -g3 -O0 + stacktrace_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src + stacktrace_test_LDADD = -lmrw -lmrwexcstderr + mrwexcstderr_test_SOURCES = mrwexcstderr_test.cxx + mrwexcstderr_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 + mrwexcstderr_test_CXXFLAGS = -g3 -O0 + mrwexcstderr_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src + mrwexcstderr_test_LDADD = -lmrw -lmrwexcstderr +if HAVE_LOG4CXX + mrwexclog4cxx_test_SOURCES = mrwexclog4cxx_test.cxx + mrwexclog4cxx_test_CPPFLAGS = -I ${top_srcdir}/src @CPPUNIT_CFLAGS@ -g3 -O0 + mrwexclog4cxx_test_CXXFLAGS = -g3 -O0 + mrwexclog4cxx_test_LDFLAGS = @CPPUNIT_LIBS@ -L${top_builddir}/src + mrwexclog4cxx_test_LDADD = -lmrw -lmrwexclog4cxx -llog4cxx +if AUTOFNTRACE + mrwautofunctiontracelog4cxx_test_SOURCES = \ + mrwautofunctiontracelog4cxx_test.cxx + mrwautofunctiontracelog4cxx_test_CPPFLAGS = -I ${top_srcdir}/src \ + @CPPUNIT_CFLAGS@ -finstrument-functions -g3 -O0 + mrwautofunctiontracelog4cxx_test_CXXFLAGS = -g3 -O0 -finstrument-functions + mrwautofunctiontracelog4cxx_test_LDFLAGS = \ + @CPPUNIT_LIBS@ -L${top_builddir}/src -finstrument-functions + mrwautofunctiontracelog4cxx_test_LDADD = \ + -llog4cxx -lmrwautofunctiontracelog4cxx +if HAVE_THREADS +if HAVE_BOOST_THREAD + mrwautofunctiontracelog4cxx_test_mt_SOURCES = \ + mrwautofunctiontracelog4cxx_test.cxx + mrwautofunctiontracelog4cxx_test_mt_CPPFLAGS = -I ${top_srcdir}/src \ + @CPPUNIT_CFLAGS@ -finstrument-functions -g3 -O0 + mrwautofunctiontracelog4cxx_test_mt_CXXFLAGS = -g3 -O0 \ + -finstrument-functions @THREADS@ + mrwautofunctiontracelog4cxx_test_mt_LDFLAGS = \ + @CPPUNIT_LIBS@ -L${top_builddir}/src @THREADS@ -finstrument-functions + mrwautofunctiontracelog4cxx_test_mt_LDADD = \ + -llog4cxx -lmrwautofunctiontracelog4cxx-mt @BOOST_THREAD_LIB@ +endif +endif +endif +endif +endif -TESTS=${check_PROGRAMS} +dist_check_DATA = test.dat configfile.ini configfile.ini.result +if HAVE_VALGRIND +VALTESTS=$(VALGRIND_CHECKS:%=valcheck_%) +TESTS = $(VALTESTS) $(NO_VALGRIND_CHECKS) $(dist_check_SCRIPTS) +valcheck_%: % + echo "LD_LIBRARY_PATH=.libs $(top_srcdir)/valcheck.sh .libs/$<" > $@ + chmod ugo+x $@ +else +TESTS = $(check_PROGRAMS) $(dist_check_SCRIPTS) +endif +check_PROGRAMS = $(VALGRIND_CHECKS) $(NO_VALGRIND_CHECKS) -mrw_c___test_SOURCES = mrw-c++_test.cxx - -CLEANFILES = mrw-c++_test.xml +CLEANFILES = MAINTAINERCLEANFILES = makefile.in