From 789d22c659a8dd99e8ba3941d39cc93f12d99962 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Thu, 3 Nov 2022 22:10:57 -0700 Subject: [PATCH] Add CI / test checks to make sure we don't accidentally lose features Add CI test to confirm desired Vim features like +sound / etc exist. Smoketest also checks for libsodium now by trying to set xchacha20 cryptmethod which can only succeed if sodium is enabled. Also make sure it's actually checking the scripting language bindings are working properly. Previously for some reason it wasn't checking the print results. --- .github/workflows/ci-macvim.yaml | 13 ++++++++----- src/testdir/test_macvim.vim | 8 ++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-macvim.yaml b/.github/workflows/ci-macvim.yaml index 7b1e36c469..0357422a0b 100644 --- a/.github/workflows/ci-macvim.yaml +++ b/.github/workflows/ci-macvim.yaml @@ -251,15 +251,18 @@ jobs: } # Smoketest scripting languages - macvim_excmd -c 'lua print("Test")' - macvim_excmd -c 'perl VIM::Msg("Test")' - macvim_excmd -c 'py print "Test"' - macvim_excmd -c 'py3 print("Test")' - macvim_excmd -c 'ruby puts("Test")' + macvim_excmd -c 'lua print("Test")' | grep Test + macvim_excmd -c 'perl VIM::Msg("Test")' | grep Test + macvim_excmd -c 'py print "Test"' | grep Test + macvim_excmd -c 'py3 print("Test")' | grep Test + macvim_excmd -c 'ruby puts("Test")' | grep Test # Check that localized messages work by printing ':version' and checking against localized word macvim_excmd -c 'lang es_ES' -c 'version' | grep Enlazado + # Check that libsodium is working + macvim_excmd -c 'set cryptmethod=xchacha20' + # Make sure there isn't any dynamic linkage to third-party dependencies in the built binary, as we should only use # static linkage to avoid dependency hell. Test that all those dylib's are in /usr/lib which is bundled with macOS and not third-party. if otool -L ${VIM_BIN} | grep '\.dylib\s' | grep -v '^\s*/usr/lib/'; then diff --git a/src/testdir/test_macvim.vim b/src/testdir/test_macvim.vim index d1a62347ba..8c0038823a 100644 --- a/src/testdir/test_macvim.vim +++ b/src/testdir/test_macvim.vim @@ -19,6 +19,8 @@ func Test_macvim_options_commands() call assert_true(exists(':macaction'), 'Missing command "macaction"') call assert_true(exists(':macmenu'), 'Missing command "macmenu"') + call assert_true(exists('*showdefinition'), 'Missing function "showdefinition"') + call assert_true(exists('##OSAppearanceChanged'), 'Missing autocmd event "OSAppearanceChanged"') call assert_true(has('fullscreen'), 'Missing feature "fullscreen"') @@ -26,6 +28,12 @@ func Test_macvim_options_commands() call assert_true(has('odbeditor'), 'Missing feature "odbeditor"') call assert_true(has('touchbar'), 'Missing feature "touchbar"') call assert_true(has('transparency'), 'Missing feature "transparency"') + + " Vim system-specific features that we expect to be on in macOS + call assert_true(has('clipboard'), 'Missing feature "clipboard"') + call assert_true(has('sound'), 'Missing feature "sound"') + call assert_true(has('terminal'), 'Missing feature "terminal"') + call assert_true(has('xim'), 'Missing feature "xim"') endfunc " Test that Cmd-key and touch pad mappings are working (this doesn't actually