Tests: Add bad option test.

This commit is contained in:
Wilson Snyder 2020-04-23 19:56:02 -04:00
parent 6ed10b7fde
commit f93ae707e0
5 changed files with 46 additions and 2 deletions

View File

@ -804,7 +804,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
} else if (!strcmp(sw, "+librescan")) { // NOP
} else if (!strcmp(sw, "+notimingchecks")) { // NOP
} else {
fl->v3fatal("Invalid Option: " << argv[i]);
fl->v3fatal("Invalid option: " << argv[i]);
}
shift;
}
@ -1293,7 +1293,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
shift;
addIncDirUser(parseFileArg(optdir, string(argv[i])));
} else {
fl->v3fatal("Invalid Option: " << argv[i]);
fl->v3fatal("Invalid option: " << argv[i]);
}
shift;
} // - options

View File

@ -0,0 +1 @@
%Error: Invalid option: +invalid-plus

View File

@ -0,0 +1,21 @@
#!/usr/bin/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);
compile(
fails => 1,
verilator_flags2 => ['+invalid-plus'],
expect_filename => $Self->{golden_filename},
);
ok(1);
1;

View File

@ -0,0 +1 @@
%Error: Invalid option: --invalid-dash

View File

@ -0,0 +1,21 @@
#!/usr/bin/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);
compile(
fails => 1,
verilator_flags2 => ['--invalid-dash'],
expect_filename => $Self->{golden_filename},
);
ok(1);
1;