From 7cbb68da6c5664a4e2aba533fe1f969373c60d5c Mon Sep 17 00:00:00 2001 From: offa Date: Sun, 6 Feb 2022 05:08:10 +0000 Subject: Add oelint-adv support (#4043) --- test/handler/test_bitbake_oelint_adv_handler.vader | 28 ++++++++++++++++++++++ test/linter/test_bitbake.vader | 13 ++++++++++ 2 files changed, 41 insertions(+) create mode 100644 test/handler/test_bitbake_oelint_adv_handler.vader create mode 100755 test/linter/test_bitbake.vader (limited to 'test') diff --git a/test/handler/test_bitbake_oelint_adv_handler.vader b/test/handler/test_bitbake_oelint_adv_handler.vader new file mode 100644 index 00000000..a52e8810 --- /dev/null +++ b/test/handler/test_bitbake_oelint_adv_handler.vader @@ -0,0 +1,28 @@ +Before: + runtime ale_linters/bitbake/oelint_adv.vim + +After: + Restore + + call ale#linter#Reset() + +Execute(The oelint_adv handler should handle warnings): + AssertEqual + \ [ + \ { + \ 'lnum': 1234, + \ 'type': 'I', + \ 'code': 'oelint.var.suggestedvar.BUGTRACKER', + \ 'text': 'Variable ''BUGTRACKER'' should be set', + \ }, + \ { + \ 'lnum': 17, + \ 'type': 'E', + \ 'code': 'oelint.var.mandatoryvar.DESCRIPTION', + \ 'text': 'Variable ''DESCRIPTION'' should be set', + \ }, + \ ], + \ ale_linters#bitbake#oelint_adv#Handle(1, [ + \ '/meta-x/recipes-y/example/example_1.0.bb:1234:info:oelint.var.suggestedvar.BUGTRACKER:Variable ''BUGTRACKER'' should be set', + \ 'example2_1.1.bb:17:error:oelint.var.mandatoryvar.DESCRIPTION:Variable ''DESCRIPTION'' should be set', + \ ]) diff --git a/test/linter/test_bitbake.vader b/test/linter/test_bitbake.vader new file mode 100755 index 00000000..ba502aa0 --- /dev/null +++ b/test/linter/test_bitbake.vader @@ -0,0 +1,13 @@ +Before: + call ale#assert#SetUpLinterTest('bitbake', 'oelint_adv') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The default command should be correct): + AssertLinter 'oelint-adv', ale#Escape('oelint-adv') . ' --quiet %s' + +Execute(The executable should be configurable): + let b:ale_bitbake_oelint_adv_executable = 'xyz' + + AssertLinter 'xyz', ale#Escape('xyz') . ' --quiet %s' -- cgit v1.2.3