From daa7bf5d0f5ecfb504b990d2012ee9f3baac0425 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Tue, 8 Jun 2010 06:50:45 +0200 Subject: [PATCH] Testsuite coverage for __file__ and __line__. * tests/m4sugar.at (__file__ and __line__): New test. Signed-off-by: Ralf Wildenhues --- ChangeLog | 3 +++ tests/m4sugar.at | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/ChangeLog b/ChangeLog index ad07b9d6..79ce828d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2010-06-08 Ralf Wildenhues + Testsuite coverage for __file__ and __line__. + * tests/m4sugar.at (__file__ and __line__): New test. + Testsuite coverage for AC_CACHE_VAL and caching semantics. * tests/base.at (AC_CACHE_CHECK): Extend test. (AC_CACHE_LOAD): New test. diff --git a/tests/m4sugar.at b/tests/m4sugar.at index 4aa60340..70693098 100644 --- a/tests/m4sugar.at +++ b/tests/m4sugar.at @@ -2075,3 +2075,30 @@ m4_count(m4_shift(m4_set_intersection([a], [b]))) ]]) AT_CLEANUP + + +## ---------------------- ## +## __file__ and __line__. ## +## ---------------------- ## + +AT_SETUP([[__file__ and __line__]]) + +# Check that __file__ and __line__ work. +# Check that m4__file__ and m4__line__ are not defined +# (and get them to pass by the undefined-macro check). +# Try to not assume too much about AT_CHECK_M4SUGAR_TEXT. +AT_CHECK_M4SUGAR_TEXT([[dnl +m4_pattern_allow([m4__file__])dnl +m4_pattern_allow([m4__line__])dnl +m4__file__ +m4__line__ +__file__ +m4_define([first], __line__)dnl +m4_define([second], __line__)dnl +m4_assert(first + 1 == second)dnl +]], [[m4@&t@__@&t@file__ +m4@&t@__@&t@line__ +script.4s +]]) + +AT_CLEANUP