Internals: Fix coverage holes. No functional change.

This commit is contained in:
Wilson Snyder 2021-07-09 18:11:59 -04:00
parent e6b75f752b
commit 61e2e55ba5
12 changed files with 118 additions and 18 deletions

View File

@ -1467,7 +1467,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
i += consumed;
} else {
fl->v3fatal("Invalid option: " << argv[i] << parser.getSuggestion(argv[i]));
++i;
++i; // LCOV_EXCL_LINE
}
} else {
// Filename
@ -1643,21 +1643,6 @@ string V3Options::parseFileArg(const string& optdir, const string& relfilename)
//======================================================================
//! Utility to see if we have a language extension argument and if so add it.
bool V3Options::parseLangExt(const char* swp, //!< argument text
const char* langswp, //!< option to match
const V3LangCode& lc) { //!< language code
const int len = strlen(langswp);
if (!strncmp(swp, langswp, len)) {
addLangExt(swp + len, lc);
return true;
} else {
return false;
}
}
//======================================================================
void V3Options::showVersion(bool verbose) {
cout << version();
cout << endl;

View File

@ -376,7 +376,6 @@ private:
void coverage(bool flag) { m_coverageLine = m_coverageToggle = m_coverageUser = flag; }
static bool suffixed(const string& sw, const char* arg);
static string parseFileArg(const string& optdir, const string& relfilename);
bool parseLangExt(const char* swp, const char* langswp, const V3LangCode& lc);
string filePathCheckOneDir(const string& modname, const string& dirname);
static int stripOptionsForChildRun(const string& opt, bool forTop);

View File

@ -83,7 +83,7 @@ void VlcOptions::parseOptsList(int argc, char** argv) {
i += consumed;
} else {
v3fatal("Invalid option: " << argv[i] << parser.getSuggestion(argv[i]));
++i;
++i; // LCOV_EXCL_LINE
}
} else {
addReadFile(argv[i]);

View File

@ -0,0 +1,24 @@
#!/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(simulator => 1);
top_filename("t/t_flag_compiler.v");
compile(
verilator_flags2 => ["--compiler clang"],
);
execute(
check_finished => 1,
);
ok(1);
1;

View File

@ -0,0 +1,24 @@
#!/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(simulator => 1);
top_filename("t/t_flag_compiler.v");
compile(
verilator_flags2 => ["--compiler gcc"],
);
execute(
check_finished => 1,
);
ok(1);
1;

View File

@ -10,6 +10,8 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(simulator => 1);
top_filename("t/t_flag_compiler.v");
compile(
verilator_flags2 => ["--compiler msvc"], # Bug requires msvc
);

View File

@ -0,0 +1,2 @@
%Error: -j accepts positive integer, but '0' is passed
%Error: Exiting due to

22
test_regress/t/t_flag_j_bad.pl Executable file
View File

@ -0,0 +1,22 @@
#!/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);
top_filename("t/t_flag_werror.v");
lint(
fails => 1,
verilator_flags => [qw(-j 0 --build)],
expect_filename => $Self->{golden_filename},
);
ok(1);
1;

View File

@ -0,0 +1 @@
%Error: Unknown --make system specified: 'bad_one'

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(
verilator_flags2 => ["--make bad_one"],
fails => 1,
expect_filename => $Self->{golden_filename},
);
ok(1);
1;

View File

@ -0,0 +1,21 @@
#!/usr/bin/env perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2008 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(simulator => 1);
top_filename("t/t_flag_make_cmake.v");
compile(
verilator_flags2 => ['--make gmake'],
);
ok(1);
1;