aboutsummaryrefslogtreecommitdiffstats
path: root/devel/ahven
diff options
context:
space:
mode:
authormarino <marino@FreeBSD.org>2014-02-19 02:35:16 +0800
committermarino <marino@FreeBSD.org>2014-02-19 02:35:16 +0800
commit0467d875fc5bbc66c3a56d1ea745c09b8c85df14 (patch)
treed8834a1e067b48725963826dddc337003b3b4459 /devel/ahven
parenta1802b5c8b966f0aa4323cad7fb334c6d19bc891 (diff)
downloadfreebsd-ports-gnome-0467d875fc5bbc66c3a56d1ea745c09b8c85df14.tar.gz
freebsd-ports-gnome-0467d875fc5bbc66c3a56d1ea745c09b8c85df14.tar.zst
freebsd-ports-gnome-0467d875fc5bbc66c3a56d1ea745c09b8c85df14.zip
devel/ahven: Modify to add symbolic tracing.
The author, Tero Koskine, intends for ahven to be compiler agnostic, and therefore can't use GNAT-specific functionality like GNAT.Traceback.Symbolic. However, there is only one brand of Ada compiler in ports, GNAT, so we can take advantage of it. This change adds a default option to alter the exception handling to trace through the symbols to display files and line numbers of each frame on the stack. Declining the option builds Ahven without the modification and allows Ahven to be used on non-GNAT compilers (assuming you can find one on FreeBSD.)
Diffstat (limited to 'devel/ahven')
-rw-r--r--devel/ahven/Makefile12
-rw-r--r--devel/ahven/files/extra-src_ahven-framework.adb34
2 files changed, 44 insertions, 2 deletions
diff --git a/devel/ahven/Makefile b/devel/ahven/Makefile
index 7d6cc892354f..d81e5f0309e8 100644
--- a/devel/ahven/Makefile
+++ b/devel/ahven/Makefile
@@ -3,7 +3,7 @@
PORTNAME= ahven
PORTVERSION= 2.4
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= devel
MASTER_SITES= SF
MASTER_SITE_SUBDIR=${PORTNAME}/${PORTNAME}/Ahven%20${PORTVERSION}
@@ -19,7 +19,11 @@ USES= ada
ALL_TARGET= build_all
MAKE_ENV+= OS_VERSION=unix
-OPTIONS_DEFINE= DOCS
+OPTIONS_DEFINE= TRACE DOCS
+OPTIONS_DEFAULT=TRACE
+NO_OPTIONS_SORT=yes
+
+TRACE_DESC= Build with GNAT-specific symbolic tracing functionality
.include <bsd.port.options.mk>
@@ -30,6 +34,10 @@ BUILD_DEPENDS+= sphinx-build:${PORTSDIR}/textproc/py-sphinx \
ALL_TARGET+= docs
.endif
+.if ${PORT_OPTIONS:MTRACE}
+EXTRA_PATCHES= ${FILESDIR}/extra-src_ahven-framework.adb
+.endif
+
post-install:
@${RM} -rf ${STAGEDIR}${PREFIX}/share/doc/ahven/html/_sources
@${RM} ${STAGEDIR}${PREFIX}/share/doc/ahven/html/.buildinfo
diff --git a/devel/ahven/files/extra-src_ahven-framework.adb b/devel/ahven/files/extra-src_ahven-framework.adb
new file mode 100644
index 000000000000..b80adf17d2bc
--- /dev/null
+++ b/devel/ahven/files/extra-src_ahven-framework.adb
@@ -0,0 +1,34 @@
+--- src/ahven-framework.adb.orig 2014-02-08 21:21:51.000000000 +0000
++++ src/ahven-framework.adb
+@@ -14,6 +14,8 @@
+ -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ --
+
++with GNAT.Traceback.Symbolic;
++use GNAT.Traceback.Symbolic;
+ with Ada.Strings;
+ with Ada.Unchecked_Deallocation;
+ with Ada.Exceptions;
+@@ -346,19 +348,19 @@ package body Ahven.Framework is
+ Set_Status
+ (S => TEST_FAIL,
+ Message => Ada.Exceptions.Exception_Message (E),
+- Long_Message => Ada.Exceptions.Exception_Information (E),
++ Long_Message => Symbolic_Traceback (E),
+ R => Result);
+ when E : Test_Skipped_Error =>
+ Set_Status
+ (S => TEST_SKIP,
+ Message => Ada.Exceptions.Exception_Message (E),
+- Long_Message => Ada.Exceptions.Exception_Information (E),
++ Long_Message => Symbolic_Traceback (E),
+ R => Result);
+ when E : others =>
+ Set_Status
+ (S => TEST_ERROR,
+ Message => Ada.Exceptions.Exception_Message (E),
+- Long_Message => Ada.Exceptions.Exception_Information (E),
++ Long_Message => Symbolic_Traceback (E),
+ R => Result);
+ end;
+ end Run_A_Command;