Move filetypes.* to the filedefs directory
[geany-mirror.git] / tests / ctags / runner.sh
blob695d517c15a5fe88a002fa49b73107c0e0d65d4c
1 #!/bin/bash
3 # error out on undefined variable expansion, useful for debugging
4 set -u
6 # FIXME: get this from automake so we have $(EXEEXT)
7 GEANY="${top_builddir:-../..}/src/geany"
8 TMPDIR=$(mktemp -d) || exit 99
9 CONFDIR="$TMPDIR/config/"
11 trap 'rm -rf "$TMPDIR"' EXIT
13 # make sure we don't use an old or modified system version of the filetype
14 # related configuration files
15 mkdir -p "$CONFDIR" || exit 99
16 mkdir -p "$CONFDIR/filedefs/" || exit 99
17 cp "${srcdir:-.}"/../../data/filetype_extensions.conf "$CONFDIR" || exit 99
18 cp "${srcdir:-.}"/../../data/filedefs/filetypes.* "$CONFDIR/filedefs/" || exit 99
20 result="$1"
21 source="${result%.*}"
22 tagfile="$TMPDIR/test.${source##*.}.tags"
24 "$GEANY" -c "$CONFDIR" -P -g "$tagfile" "$source" || exit 1
25 diff -u "$result" "$tagfile" || exit 2