Tests: Some coverage improvements

This commit is contained in:
Wilson Snyder 2021-09-20 18:20:48 -04:00
parent 76681fd931
commit a7374e84a2
4 changed files with 54 additions and 0 deletions

View File

@ -8,3 +8,23 @@
`define BAR(aa,bb) aa bb
`FOO
`BAR(aa,bb)
`ifdef FOO
`else
`endif
`ifndef FOO
`elsif FOO
`endif
`define STRINGIFY(x) `"x`"
`define CONCAT(a, b) a``b
`STRINGIFY(x)
`CONCAT(x,y)
`undef FOO
`undefineall
`ifdef NEVER
`error "should not get"
`endif

View File

@ -0,0 +1,4 @@
%Error: t/t_preproc_inc_fn_bad.v:7:10: Expecting include filename. Found: ELSE
7 | `include `else
| ^~~~~
%Error: Exiting due to

View File

@ -0,0 +1,20 @@
#!/usr/bin/env perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(vlt => 1);
lint(
fails => 1,
# The .vh file has the error, not the .v file
expect_filename => $Self->{golden_filename},
);
ok(1);
1;

View File

@ -0,0 +1,10 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2010 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
`include `else
module t;
endmodule