tests: fix spurious failure when 'etags' program is Exuberant Ctags
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 3 Jun 2013 09:45:29 +0000 (11:45 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 3 Jun 2013 09:45:29 +0000 (11:45 +0200)
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 <stefano.lattarini@gmail.com>
t/tags-pr12372.sh

index 4eeb9be963da7ea4fe8d97820a3b1d5109658ea1..657be608825a358a0a41bee2dea99cf067ee3d39 100644 (file)
@@ -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