mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
test(runtime/syntax): improve syntax tests
When a syntax file is changed, timestamps of the corresponding files are updated. NOTE: At the moment this script does not strictly track dependency, like cpp on c. Also update ignore files closes #16548 Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
273926e5c0
commit
2e18facede
38
runtime/syntax/testdir/tools/maketestdeps
Executable file
38
runtime/syntax/testdir/tools/maketestdeps
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# This script generates auxiliary recipes for 'make test': e.g. in the case of JAVA,
|
||||
# - a phony target 'java' depends on all of the testdir/input/java*.java
|
||||
# - when the syntax file is changed, timestamps of the JAVA files are updated so that the tests will
|
||||
# be rerun against updated syntax
|
||||
# - when a vim setup file for test, e.g. testdir/input/setup/java_module_info.vim, is changed,
|
||||
# timestamp of the corresponding input, testdir/input/java_module_info.java, is updated
|
||||
#
|
||||
# NOTE: At the moment this script DOES NOT strictly track dependency, like cpp on c, so run
|
||||
# `make clean test` before deployment
|
||||
|
||||
set -eu +f -o pipefail
|
||||
|
||||
cd "$(dirname "$0")"/../..
|
||||
for input in testdir/input/*.*; do
|
||||
dirname=$(dirname "$input")
|
||||
basename=$(basename "$input")
|
||||
|
||||
case "$basename" in
|
||||
vim9_*.*) ft=vim;;
|
||||
*_*.*) ft=${basename%%_*};;
|
||||
*.*) ft=${basename%%.*};;
|
||||
*) exit 1
|
||||
esac
|
||||
|
||||
vimsetup=$dirname/setup/${basename%.*}.vim
|
||||
if [ ! -r "$vimsetup" ]; then
|
||||
vimsetup=
|
||||
fi
|
||||
|
||||
cat << EOF
|
||||
$input: $ft.vim $vimsetup
|
||||
touch -c \$@
|
||||
$basename:: $input
|
||||
$ft:: $basename
|
||||
|
||||
EOF
|
||||
done
|
Reference in New Issue
Block a user