mirror of
https://github.com/vim/vim
synced 2025-04-29 21:07:49 +02:00
Vim tests for features such as python3 relies on checking the feature flag exists by doing `has('python3')`. However, if the feature itself is broken and the flag returns 0, the relevant tests will simply silently get ignored and CI will passed erroneously. As a preventive measure, as basic checks to make sure certain feature flags are correct as a basic smoke test. Currently only checking two types of feature flags: 1. Features that depend on system packages being installed properly (e.g. sodium) and could be erroneously dropped if the CI environment changed or a bug exists in the configure script. 2. Scripting languages. When in dynamic mode, these feature flags (e.g. "ruby", "python3") will return 0 when the lib cannot be found or the code has an initialization bug. This happened in #16964 where CI still passed despite Python 3 being broken. closes: #16998 Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
15 lines
381 B
VimL
15 lines
381 B
VimL
if 1 " This prevents it from being run in tiny versions
|
|
" Check for required features
|
|
if exists("g:required")
|
|
for feature in g:required
|
|
if !has(feature)
|
|
echo "Error: Feature '" .. feature .. "' not found"
|
|
echo ''
|
|
cquit
|
|
endif
|
|
endfor
|
|
echo "\nChecked features: " .. string(g:required)
|
|
echo ''
|
|
endif
|
|
endif
|
|
" vim: sts=2 sw=2 et
|