summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNathan Sharp <39231199+nwsharp@users.noreply.github.com>2021-07-12 06:39:53 -0600
committerGitHub <noreply@github.com>2021-07-12 21:39:53 +0900
commitc8f669249ae064aa014ec180df3934f0a82cab29 (patch)
tree3ba9d4e7e7d25cfddde068b4b868a5cde2da8ce5 /test
parent9a9fd24b17db32e452609e68e6a9729461625720 (diff)
downloadale-c8f669249ae064aa014ec180df3934f0a82cab29.zip
Add Yosys linter for Verilog files. (#3713)
* Add yosys for verilog files. * Add handler test for yosys. * fix typo in yosys handler test * fix array order in yosys handler test * add yosys linter to filetype defaults test * fix duplicate tag * add 'yosys' to 'ale-supported-languages-and-tools.txt'
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_yosys_handler.vader27
-rw-r--r--test/test_filetype_linter_defaults.vader2
2 files changed, 28 insertions, 1 deletions
diff --git a/test/handler/test_yosys_handler.vader b/test/handler/test_yosys_handler.vader
new file mode 100644
index 00000000..a55d0b5b
--- /dev/null
+++ b/test/handler/test_yosys_handler.vader
@@ -0,0 +1,27 @@
+Before:
+ runtime ale_linters/verilog/yosys.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The yosys handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 3,
+ \ 'type': 'E',
+ \ 'text': 'syntax error, unexpected TOK_ID',
+ \ 'filename': 'file.v'
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': 'internal error',
+ \ },
+ \ ],
+ \ ale_linters#verilog#yosys#Handle(bufnr(''), [
+ \ '1. Executing Verilog-2005 frontend: file.v',
+ \ 'ERROR: internal error',
+ \ 'file.v:3: ERROR: syntax error, unexpected TOK_ID',
+ \ ])
+
diff --git a/test/test_filetype_linter_defaults.vader b/test/test_filetype_linter_defaults.vader
index 419800de..563a093f 100644
--- a/test/test_filetype_linter_defaults.vader
+++ b/test/test_filetype_linter_defaults.vader
@@ -61,7 +61,7 @@ Execute(The defaults for the zsh filetype should be correct):
Execute(The defaults for the verilog filetype should be correct):
" This filetype isn't configured with default, so we can test loading all
" available linters with this.
- AssertEqual ['hdl-checker', 'iverilog', 'verilator', 'vlog', 'xvlog'], GetLinterNames('verilog')
+ AssertEqual ['hdl-checker', 'iverilog', 'verilator', 'vlog', 'xvlog', 'yosys'], GetLinterNames('verilog')
let g:ale_linters_explicit = 1