mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Tests: Add bad option test.
This commit is contained in:
parent
6ed10b7fde
commit
f93ae707e0
@ -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
|
||||
|
1
test_regress/t/t_flag_invalid2_bad.out
Normal file
1
test_regress/t/t_flag_invalid2_bad.out
Normal file
@ -0,0 +1 @@
|
||||
%Error: Invalid option: +invalid-plus
|
21
test_regress/t/t_flag_invalid2_bad.pl
Executable file
21
test_regress/t/t_flag_invalid2_bad.pl
Executable 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;
|
1
test_regress/t/t_flag_invalid_bad.out
Normal file
1
test_regress/t/t_flag_invalid_bad.out
Normal file
@ -0,0 +1 @@
|
||||
%Error: Invalid option: --invalid-dash
|
21
test_regress/t/t_flag_invalid_bad.pl
Executable file
21
test_regress/t/t_flag_invalid_bad.pl
Executable 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;
|
Loading…
Reference in New Issue
Block a user