From d72a9d64ff4f9ff7fef32d180363180abf4e1f0b Mon Sep 17 00:00:00 2001 From: Dan George Date: Mon, 15 Nov 2021 03:34:46 -0800 Subject: Add cppcheck handler match on misra msg (#3980) Co-authored-by: Dan George --- test/handler/test_cppcheck_handler.vader | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/handler/test_cppcheck_handler.vader b/test/handler/test_cppcheck_handler.vader index 2a740722..ef161f44 100644 --- a/test/handler/test_cppcheck_handler.vader +++ b/test/handler/test_cppcheck_handler.vader @@ -63,6 +63,23 @@ Execute(Basic errors should be handled by cppcheck): \ ' ^', \ ]) + AssertEqual + \ [ + \ { + \ 'lnum': 1, + \ 'col' : 16, + \ 'type': 'W', + \ 'sub_type': 'style', + \ 'text': 'misra violation (use --rule-texts= to get proper output)', + \ 'code': 'misra-c2012-2.7' + \ }, + \ ], + \ ale#handlers#cppcheck#HandleCppCheckFormat(bufnr(''), [ + \ 'test.cpp:1:16: style: misra violation (use --rule-texts= to get proper output) [misra-c2012-2.7]\', + \ 'void test( int parm ) {}', + \ ' ^', + \ ]) + Execute(Problems from other files should be ignored by cppcheck): call ale#test#SetFilename('test.cpp') -- cgit v1.2.3