2017-10-25 19:09:26 -04:00
|
|
|
|
Execute(The GCC handler should ignore other lines of output):
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [],
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
|
2017-10-25 19:09:26 -04:00
|
|
|
|
\ 'foo',
|
|
|
|
|
\ 'bar',
|
|
|
|
|
\ 'baz',
|
|
|
|
|
\ ])
|
|
|
|
|
|
2017-04-11 15:32:57 -04:00
|
|
|
|
Execute(GCC errors from included files should be parsed correctly):
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [
|
|
|
|
|
\ {
|
2017-10-25 17:29:36 -04:00
|
|
|
|
\ 'lnum': 1,
|
|
|
|
|
\ 'col': 1,
|
|
|
|
|
\ 'filename': 'broken.h',
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ 'type': 'E',
|
2017-10-25 17:29:36 -04:00
|
|
|
|
\ 'text': 'expected identifier or ''('' before ''{'' token',
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ },
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 3,
|
|
|
|
|
\ 'col': 2,
|
|
|
|
|
\ 'text': 'Error found in header. See :ALEDetail',
|
|
|
|
|
\ 'detail': join([
|
|
|
|
|
\ 'In file included from <stdin>:3:2:',
|
|
|
|
|
\ 'broken.h:1:1: error: expected identifier or ''('' before ''{'' token',
|
|
|
|
|
\ ' {{{',
|
|
|
|
|
\ ' ^',
|
|
|
|
|
\ ], "\n"),
|
|
|
|
|
\ },
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ ],
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
|
|
|
|
|
\ 'In file included from <stdin>:3:2:',
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ 'broken.h:1:1: error: expected identifier or ''('' before ''{'' token',
|
|
|
|
|
\ ' {{{',
|
|
|
|
|
\ ' ^',
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ 'compilation terminated.',
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ ])
|
|
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [
|
|
|
|
|
\ {
|
2017-10-25 17:29:36 -04:00
|
|
|
|
\ 'lnum': 1,
|
|
|
|
|
\ 'col': 1,
|
|
|
|
|
\ 'filename': 'b.h',
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ 'type': 'E',
|
2017-10-25 17:29:36 -04:00
|
|
|
|
\ 'text': 'expected identifier or ''('' before ''{'' token',
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ },
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 5,
|
|
|
|
|
\ 'text': 'Error found in header. See :ALEDetail',
|
|
|
|
|
\ 'detail': join([
|
|
|
|
|
\ 'In file included from a.h:1:0,',
|
|
|
|
|
\ ' from <stdin>:5:',
|
|
|
|
|
\ 'b.h:1:1: error: expected identifier or ''('' before ''{'' token',
|
|
|
|
|
\ ' {{{',
|
|
|
|
|
\ ' ^',
|
|
|
|
|
\ ], "\n"),
|
|
|
|
|
\ },
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ ],
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ 'In file included from a.h:1:0,',
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ' from <stdin>:5:',
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ 'b.h:1:1: error: expected identifier or ''('' before ''{'' token',
|
|
|
|
|
\ ' {{{',
|
|
|
|
|
\ ' ^',
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ 'compilation terminated.',
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ ])
|
|
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [
|
|
|
|
|
\ {
|
2017-10-25 17:29:36 -04:00
|
|
|
|
\ 'lnum': 1,
|
|
|
|
|
\ 'col': 1,
|
|
|
|
|
\ 'filename': 'b.h',
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ 'type': 'E',
|
2017-10-25 17:29:36 -04: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 15:32:57 -04:00
|
|
|
|
\ },
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 3,
|
|
|
|
|
\ 'text': 'Error found in header. See :ALEDetail',
|
|
|
|
|
\ 'detail': join([
|
|
|
|
|
\ 'In file included from a.h:1:0,',
|
|
|
|
|
\ ' from <stdin>: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;',
|
|
|
|
|
\ ' ^',
|
|
|
|
|
\ ], "\n"),
|
|
|
|
|
\ },
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ ],
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ 'In file included from a.h:1:0,',
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ' from <stdin>:3:',
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ '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;',
|
|
|
|
|
\ ' ^',
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ 'compilation terminated.',
|
2017-04-11 15:32:57 -04:00
|
|
|
|
\ ])
|
2017-04-29 15:00:29 -04:00
|
|
|
|
|
2017-04-29 19:30:44 -04:00
|
|
|
|
Execute(The GCC handler shouldn't complain about #pragma once for headers):
|
|
|
|
|
silent file! test.h
|
|
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [],
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
|
2017-04-29 19:30:44 -04:00
|
|
|
|
\ '<stdin>:1:1: warning: #pragma once in main file [enabled by default]',
|
|
|
|
|
\ ])
|
|
|
|
|
|
|
|
|
|
silent file! test.hpp
|
|
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [],
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
|
2017-04-29 19:30:44 -04:00
|
|
|
|
\ '<stdin>:1:1: warning: #pragma once in main file [enabled by default]',
|
|
|
|
|
\ ])
|
2017-07-22 19:39:59 -04: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'''
|
|
|
|
|
\ },
|
|
|
|
|
\ ],
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
|
2017-07-22 19:39:59 -04:00
|
|
|
|
\ '<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 18:43:09 -04:00
|
|
|
|
|
|
|
|
|
Execute(The GCC handler should handle notes with no previous message):
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [],
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
|
2017-10-25 18:43:09 -04:00
|
|
|
|
\ '<stdin>:1:1: note: x',
|
|
|
|
|
\ '<stdin>:1:1: note: x',
|
|
|
|
|
\ ])
|
2017-10-25 19:09:26 -04:00
|
|
|
|
|
2018-08-02 16:45:04 -04:00
|
|
|
|
Execute(The GCC handler should attach notes to previous messages):
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [
|
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 6,
|
|
|
|
|
\ 'col': 12,
|
|
|
|
|
\ 'type': 'E',
|
|
|
|
|
\ 'text': 'Some error',
|
|
|
|
|
\ 'detail': "Some error\n<stdin>:1:1: note: x",
|
|
|
|
|
\ },
|
|
|
|
|
\ ],
|
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
|
|
|
|
|
\ '-:6:12: error: Some error',
|
|
|
|
|
\ '<stdin>:1:1: note: x',
|
|
|
|
|
\ ])
|
|
|
|
|
|
2017-10-25 19:09:26 -04:00
|
|
|
|
Execute(The GCC handler should interpret - as being the current file):
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [
|
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 6,
|
|
|
|
|
\ 'col': 12,
|
|
|
|
|
\ 'type': 'E',
|
|
|
|
|
\ 'text': 'Some error',
|
|
|
|
|
\ },
|
|
|
|
|
\ ],
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
|
2017-10-25 19:09:26 -04:00
|
|
|
|
\ '-:6:12: error: Some error',
|
|
|
|
|
\ ])
|
2018-05-08 05:22:09 -04:00
|
|
|
|
|
|
|
|
|
Execute(The GCC handler should handle fatal error messages due to missing files):
|
|
|
|
|
AssertEqual
|
|
|
|
|
\ [
|
|
|
|
|
\ {
|
|
|
|
|
\ 'lnum': 3,
|
|
|
|
|
\ 'col': 12,
|
|
|
|
|
\ 'type': 'E',
|
|
|
|
|
\ 'text': 'foo.h: No such file or directory'
|
|
|
|
|
\ },
|
|
|
|
|
\ ],
|
2018-07-30 15:09:43 -04:00
|
|
|
|
\ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
|
2018-05-08 05:22:09 -04:00
|
|
|
|
\ '<stdin>:3:12: fatal error: foo.h: No such file or directory',
|
|
|
|
|
\ ])
|