Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sun, 23 Jun 2013 13:08:27 UTC Commit: c1deb7457f72e7900d6e166e59e6d1ed0552ed9a https://github.com/geany/geany/commit/c1deb7457f72e7900d6e166e59e6d1ed0552ed...
Log Message: ----------- Add a test infrastructure for tag parsers
Modified Paths: -------------- .gitignore Makefile.am configure.ac tests/Makefile.am tests/ctags/Makefile.am tests/ctags/runner.sh
Modified: .gitignore 6 files changed, 6 insertions(+), 0 deletions(-) =================================================================== @@ -97,3 +97,9 @@ Makefile.in /doc/hacking.html /doc/*.pdf /doc/reference + +#----------------------------------------------------------------------- +# /tests/ +#----------------------------------------------------------------------- +/tests/**/*.trs +/tests/**/*.log
Modified: Makefile.am 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in
-SUBDIRS = tagmanager scintilla src plugins icons po doc +SUBDIRS = tagmanager scintilla src plugins icons po doc tests
AUTOMAKE_OPTIONS = 1.7
Modified: configure.ac 2 files changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -139,6 +139,8 @@ AC_CONFIG_FILES([ geany.spec geany.pc doc/Doxyfile + tests/Makefile + tests/ctags/Makefile ]) AC_OUTPUT
Modified: tests/Makefile.am 2 files changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,2 @@ + +SUBDIRS = ctags
Modified: tests/ctags/Makefile.am 15 files changed, 15 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,15 @@ + +dist_check_SCRIPTS = runner.sh + +NULL = +test_sources = \ + $(NULL) +test_results = $(test_sources:=.tags) + +TEST_EXTENSIONS = .tags +TAGS_LOG_COMPILER = $(srcdir)/runner.sh + +TESTS = $(test_results) +EXTRA_DIST = $(test_sources) $(test_results) + +runner.sh: ../../src/geany$(EXEEXT)
Modified: tests/ctags/runner.sh 25 files changed, 25 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,25 @@ +#!/bin/bash + +# error out on undefined variable expansion, usful for debugging +set -u + +# FIXME: get this from automake so we have $(EXEEXT) +GEANY="${top_builddir:-../..}/src/geany" +TMPDIR=$(mktemp -d) || exit 99 +CONFDIR="$TMPDIR/config/" + +trap 'rm -rf "$TMPDIR"' EXIT + +# make sure we don't use an old or modified system version of the filetype +# related configuration files +mkdir -p "$CONFDIR" || exit 99 +mkdir -p "$CONFDIR/filedefs/" || exit 99 +cp "${srcdir:-.}"/../../data/filetype_extensions.conf "$CONFDIR" || exit 99 +cp "${srcdir:-.}"/../../data/filetypes.* "$CONFDIR/filedefs/" || exit 99 + +result="$1" +source="${result%.*}" +tagfile="$TMPDIR/test.${source##*.}.tags" + +"$GEANY" -c "$CONFDIR" -P -g "$tagfile" "$source" || exit 1 +diff "$tagfile" "$result" || exit 2
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).