Subject: Re: bug#14517: t/tags-pr12372.sh assumes that etags generates tags for all files

From: Stefano Lattarini <[email-masked]>
Date: Mon, 03 Jun 2013 11:47:23 +0200

tags 14517 + patch
thanks

On 05/31/2013 12:02 PM, Peter Rosin wrote:
> On 2013-05-31 11:58, Stefano Lattarini wrote:
>> On 05/31/2013 11:52 AM, Peter Rosin wrote:
>>> I'm not going to write the patch this week though, and possibly
>>> not in the near future as I have other things ($$$) to do as well...
>>>
>> Not to worry, the bug remains open, I will get to it eventually
>> (maybe soon).
> 
> Yup, I'm happy to test anything you come up with (within reason :-).
> 
Here it is.  Does it work for you?

---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----

>From 9137db89c88d5fceed1c80beeb2969d36a9e72c9 Mon Sep 17 00:00:00 2001
Message-Id: <9137db89c[email-masked]>
From: Stefano Lattarini <[email-masked]>
Date: Mon, 3 Jun 2013 11:45:29 +0200
Subject: [PATCH] tests: fix spurious failure when 'etags' program is Exuberant Ctags

Fixes automake bug#14517.

* t/tags-pr12372.sh: If the 'etags' program in use supports the
'--langmap' option, use it.  That is required to avoid spurious
failures with Exuberant Ctags (at least version 5.8), which by
default do not generate any tags for file extensions it doesn't
recognize.

Signed-off-by: Stefano Lattarini <[email-masked]>
---
 t/tags-pr12372.sh | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/t/tags-pr12372.sh b/t/tags-pr12372.sh
index 4eeb9be..657be60 100644
--- a/t/tags-pr12372.sh
+++ b/t/tags-pr12372.sh
@@ -63,7 +63,17 @@ $AUTOMAKE

 ./configure

-$MAKE
+# Exuberant Ctags (at least version 5.8) do not generate any tags
+# for file extensions it doesn't recognize.  This can be fixed by
+# using the '--langmap' option.  But we must be careful, because
+# etags from Emacs (at least version 23.4) doesn't recognize that
+# option.
+if etags --help | grep '.*--langmap'; then
+  run_make ETAGSFLAGS="--langmap=c:+.pc"
+else
+  $MAKE
+fi
+
 cat TAGS
 cat sub/TAGS
 $FGREP foo-main.pc TAGS
-- 
1.8.3.rc3.8.g5e49f30