2017-10-25 23:09:26 +00:00
|
|
|
|
Execute(The GCC handler should ignore other lines of output):
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [],
|
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormat(347, [
|
|
|
|
|
\ 'foo',
|
|
|
|
|
\ 'bar',
|
|
|
|
|
\ 'baz',
|
|
|
|
|
\ ])
|
|
|
|
|
|
2017-04-11 19:32:57 +00:00
|
|
|
|
Execute(GCC errors from included files should be parsed correctly):
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [
|
|
|
|
|
\ {
|
2017-10-25 21:29:36 +00:00
|
|
|
|
\ 'lnum': 1,
|
|
|
|
|
\ 'col': 1,
|
|
|
|
|
\ 'filename': 'broken.h',
|
2017-04-11 19:32:57 +00:00
|
|
|
|
\ 'type': 'E',
|
2017-10-25 21:29:36 +00:00
|
|
|
|
\ 'text': 'expected identifier or ''('' before ''{'' token',
|
2017-04-11 19:32:57 +00:00
|
|
|
|
\ },
|
|
|
|
|
\ ],
|
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormat(347, [
|
|
|
|
|
\ 'In file included from <stdin>:3:0:',
|
|
|
|
|
\ 'broken.h:1:1: error: expected identifier or ''('' before ''{'' token',
|
|
|
|
|
\ ' {{{',
|
|
|
|
|
\ ' ^',
|
|
|
|
|
\ ])
|
|
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [
|
|
|
|
|
\ {
|
2017-10-25 21:29:36 +00:00
|
|
|
|
\ 'lnum': 1,
|
|
|
|
|
\ 'col': 1,
|
|
|
|
|
\ 'filename': 'b.h',
|
2017-04-11 19:32:57 +00:00
|
|
|
|
\ 'type': 'E',
|
2017-10-25 21:29:36 +00:00
|
|
|
|
\ 'text': 'expected identifier or ''('' before ''{'' token',
|
2017-04-11 19:32:57 +00:00
|
|
|
|
\ },
|
|
|
|
|
\ ],
|
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormat(347, [
|
|
|
|
|
\ 'In file included from a.h:1:0,',
|
|
|
|
|
\ ' from test.c:3:',
|
|
|
|
|
\ 'b.h:1:1: error: expected identifier or ''('' before ''{'' token',
|
|
|
|
|
\ ' {{{',
|
|
|
|
|
\ ' ^',
|
|
|
|
|
\ ])
|
|
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [
|
|
|
|
|
\ {
|
2017-10-25 21:29:36 +00:00
|
|
|
|
\ 'lnum': 1,
|
|
|
|
|
\ 'col': 1,
|
|
|
|
|
\ 'filename': 'b.h',
|
2017-04-11 19:32:57 +00:00
|
|
|
|
\ 'type': 'E',
|
2017-10-25 21:29:36 +00:00
|
|
|
|
\ 'text': 'unknown type name ''bad_type''',
|
|
|
|
|
\ },
|
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 2,
|
|
|
|
|
\ 'col': 1,
|
|
|
|
|
\ 'filename': 'b.h',
|
|
|
|
|
\ 'type': 'E',
|
|
|
|
|
\ 'text': 'unknown type name ''other_bad_type''',
|
2017-04-11 19:32:57 +00:00
|
|
|
|
\ },
|
|
|
|
|
\ ],
|
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormat(347, [
|
|
|
|
|
\ 'In file included from a.h:1:0,',
|
|
|
|
|
\ ' from test.c:3:',
|
|
|
|
|
\ 'b.h:1:1: error: unknown type name ‘bad_type’',
|
|
|
|
|
\ ' bad_type x;',
|
|
|
|
|
\ ' ^',
|
|
|
|
|
\ 'b.h:2:1: error: unknown type name ‘other_bad_type’',
|
|
|
|
|
\ ' other_bad_type y;',
|
|
|
|
|
\ ' ^',
|
|
|
|
|
\ ])
|
2017-04-29 19:00:29 +00:00
|
|
|
|
|
|
|
|
|
Execute(GCC versions should be parsed correctly):
|
|
|
|
|
AssertEqual [4, 9, 1], ale#handlers#gcc#ParseGCCVersion([
|
|
|
|
|
\ 'g++ (GCC) 4.9.1 20140922 (Red Hat 4.9.1-10)',
|
|
|
|
|
\])
|
|
|
|
|
AssertEqual [4, 8, 4], ale#handlers#gcc#ParseGCCVersion([
|
|
|
|
|
\ 'gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4',
|
|
|
|
|
\ 'Copyright (C) 2013 Free Software Foundation, Inc.',
|
|
|
|
|
\ 'This is free software; see the source for copying conditions. There is NO',
|
|
|
|
|
\ 'warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.',
|
|
|
|
|
\])
|
2017-04-29 23:30:44 +00:00
|
|
|
|
|
|
|
|
|
Execute(The GCC handler shouldn't complain about #pragma once for headers):
|
|
|
|
|
silent file! test.h
|
|
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [],
|
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormat(347, [
|
|
|
|
|
\ '<stdin>:1:1: warning: #pragma once in main file [enabled by default]',
|
|
|
|
|
\ ])
|
|
|
|
|
|
|
|
|
|
silent file! test.hpp
|
|
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [],
|
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormat(347, [
|
|
|
|
|
\ '<stdin>:1:1: warning: #pragma once in main file [enabled by default]',
|
|
|
|
|
\ ])
|
2017-07-22 23:39:59 +00:00
|
|
|
|
|
|
|
|
|
Execute(The GCC handler should handle syntax errors):
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [
|
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 6,
|
|
|
|
|
\ 'col': 12,
|
|
|
|
|
\ 'type': 'E',
|
|
|
|
|
\ 'text': 'invalid suffix "p" on integer constant'
|
|
|
|
|
\ },
|
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 17,
|
|
|
|
|
\ 'col': 5,
|
|
|
|
|
\ 'type': 'E',
|
|
|
|
|
\ 'text': 'invalid suffix "n" on integer constant'
|
|
|
|
|
\ },
|
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 4,
|
|
|
|
|
\ 'type': 'E',
|
|
|
|
|
\ 'text': 'variable or field ''foo'' declared void'
|
|
|
|
|
\ },
|
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 4,
|
|
|
|
|
\ 'type': 'E',
|
|
|
|
|
\ 'text': '''cat'' was not declared in this scope'
|
|
|
|
|
\ },
|
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 12,
|
|
|
|
|
\ 'type': 'E',
|
|
|
|
|
\ 'text': 'expected '';'' before ''o'''
|
|
|
|
|
\ },
|
|
|
|
|
\ ],
|
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormat(347, [
|
|
|
|
|
\ '<stdin>:6:12: error: invalid suffix "p" on integer constant',
|
|
|
|
|
\ '<stdin>:17:5: error: invalid suffix "n" on integer constant',
|
|
|
|
|
\ '<stdin>:4: error: variable or field ''foo'' declared void',
|
|
|
|
|
\ '<stdin>:4: error: ''cat'' was not declared in this scope',
|
|
|
|
|
\ '<stdin>:12: error: expected `;'' before ''o''',
|
|
|
|
|
\ ])
|
2017-10-25 22:43:09 +00:00
|
|
|
|
|
|
|
|
|
Execute(The GCC handler should handle notes with no previous message):
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [],
|
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormat(347, [
|
|
|
|
|
\ '<stdin>:1:1: note: x',
|
|
|
|
|
\ '<stdin>:1:1: note: x',
|
|
|
|
|
\ ])
|
2017-10-25 23:09:26 +00:00
|
|
|
|
|
|
|
|
|
Execute(The GCC handler should interpret - as being the current file):
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [
|
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 6,
|
|
|
|
|
\ 'col': 12,
|
|
|
|
|
\ 'type': 'E',
|
|
|
|
|
\ 'text': 'Some error',
|
|
|
|
|
\ },
|
|
|
|
|
\ ],
|
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormat(347, [
|
|
|
|
|
\ '-:6:12: error: Some error',
|
|
|
|
|
\ ])
|