aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-23 01:57:57 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-23 01:57:57 +0000
commitc46326e48c46b88cb6a2692a7e325efbfe5b602d (patch)
tree6dd22f05458cae5b5437518a1e095786366865de
parent14c3a7d41a7ad442d80bc952d800b591020a27e9 (diff)
downloadpaludis-c46326e48c46b88cb6a2692a7e325efbfe5b602d.tar.gz
paludis-c46326e48c46b88cb6a2692a7e325efbfe5b602d.tar.xz
Make the extra test exception information work even when the linker thinks it is cleverer than us.
-rw-r--r--paludis/Makefile.am.m412
-rw-r--r--paludis/exception_to_debug_string.hh5
-rw-r--r--test/test_framework.cc4
3 files changed, 10 insertions, 11 deletions
diff --git a/paludis/Makefile.am.m4 b/paludis/Makefile.am.m4
index 3c6cf49..9114b5f 100644
--- a/paludis/Makefile.am.m4
+++ b/paludis/Makefile.am.m4
@@ -7,10 +7,10 @@ define(`filelist', `')dnl
define(`testlist', `')dnl
define(`testscriptlist', `')dnl
define(`addtest', `define(`testlist', testlist `$1_TEST')dnl
-$1_TEST_SOURCES = $1_TEST.cc
-$1_TEST_LDADD = $(top_builddir)/test/libtest.a libpaludis.a libpaludistestextras.a
+$1_TEST_SOURCES = $1_TEST.cc exception_to_debug_string.cc exception_to_debug_string.hh
+$1_TEST_LDADD = $(top_builddir)/test/libtest.a libpaludis.a
+$1_TEST_CXXFLAGS = -I$(top_srcdir)
$1_TEST_CPPFLAGS = -DPALUDIS_TEST_CASE=1
-$1_TEST_CXXFLAGS = -I$(top_srcdir) -g
')dnl
define(`addtestscript', `define(`testscriptlist', testscriptlist `$1_TEST_setup.sh $1_TEST_cleanup.sh')')dnl
define(`addhh', `define(`filelist', filelist `$1.hh')')dnl
@@ -37,16 +37,12 @@ SUBDIRS = . args
libpaludis_a_SOURCES = filelist
-libpaludistestextras_a_CPPFLAGS = -DPALUDIS_TEST_CASE=1
-libpaludistestextras_a_CXXFLAGS = -I$(top_srcdir) -g
-libpaludistestextras_a_SOURCES = exception_to_debug_string.hh exception_to_debug_string.cc
-
TESTS = testlist
TESTS_ENVIRONMENT = env TEST_SCRIPT_DIR="$(srcdir)/" $(SHELL) $(top_srcdir)/test/run_test.sh
check_PROGRAMS = $(TESTS)
check_SCRIPTS = testscriptlist
-noinst_LIBRARIES = libpaludis.a libpaludistestextras.a
+noinst_LIBRARIES = libpaludis.a
Makefile.am : Makefile.am.m4 files.m4
$(top_srcdir)/misc/do_m4.bash Makefile.am
diff --git a/paludis/exception_to_debug_string.hh b/paludis/exception_to_debug_string.hh
index a9c00ca..de13e6f 100644
--- a/paludis/exception_to_debug_string.hh
+++ b/paludis/exception_to_debug_string.hh
@@ -23,14 +23,17 @@
#include <paludis/stringify.hh>
#include <paludis/exception.hh>
+#include <paludis/attributes.hh>
#include <exception>
#ifdef PALUDIS_TEST_CASE
#ifdef PALUDIS_CAN_USE_ATTRIBUTE
-std::string exception_to_debug_string(const std::exception & e);
+std::string exception_to_debug_string(const std::exception & e) PALUDIS_ATTRIBUTE((noinline));
#endif
+#else
+#error Missing -DPALUDIS_TEST_CASE=1?
#endif
#endif
diff --git a/test/test_framework.cc b/test/test_framework.cc
index f4a9ebd..0458139 100644
--- a/test/test_framework.cc
+++ b/test/test_framework.cc
@@ -38,11 +38,11 @@ using namespace test;
*
* \ingroup Test
*/
-std::string exception_to_debug_string(const std::exception &) PALUDIS_ATTRIBUTE((weak));
+std::string exception_to_debug_string(const std::exception &) PALUDIS_ATTRIBUTE((weak,noinline));
std::string exception_to_debug_string(const std::exception & e)
{
- return e.what();
+ return e.what() + std::string(" (no further information)");
}
#ifndef DOXYGEN