Tests: Skip gdb tests if no gdb

This commit is contained in:
Wilson Snyder 2021-11-28 15:33:33 -05:00
parent 692306ef44
commit e814855357
4 changed files with 48 additions and 30 deletions

View File

@ -10,13 +10,17 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(vlt => 1); scenarios(vlt => 1);
lint( if (system("gdb --version")) {
verilator_flags2 => ["--debug-fatalsrc"], skip("No gdb installed");
fails => $Self->{vlt_all}, } else {
expect => lint(
verilator_flags2 => ["--debug-fatalsrc"],
fails => $Self->{vlt_all},
expect =>
'%Error: Internal Error: .*: --debug-fatal-src '%Error: Internal Error: .*: --debug-fatal-src
.* See the manual .*', .* See the manual .*',
); );
ok(1); ok(1);
}
1; 1;

View File

@ -9,17 +9,22 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(vlt => 1); scenarios(vlt => 1);
$ENV{VERILATOR_TEST_NO_GDB} and skip("Skipping due to VERILATOR_TEST_NO_GDB");
lint( if ($ENV{VERILATOR_TEST_NO_GDB}) {
verilator_flags2 => ["--lint-only --debug --gdbbt --debug-fatalsrc"], skip("Skipping due to VERILATOR_TEST_NO_GDB");
fails => 1, } elsif (system("gdb --version")) {
expect => skip("No gdb installed");
} else {
lint(
verilator_flags2 => ["--lint-only --debug --gdbbt --debug-fatalsrc"],
fails => 1,
expect =>
'%Error: Internal Error: .*: --debug-fatal-src '%Error: Internal Error: .*: --debug-fatal-src
.*See the manual .* .*See the manual .*
.*in V3Options::.* .*in V3Options::.*
.*%Error: Command Failed.*', .*%Error: Command Failed.*',
); );
ok(1);
}
ok(1);
1; 1;

View File

@ -9,16 +9,21 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(vlt => 1); scenarios(vlt => 1);
$ENV{VERILATOR_TEST_NO_GDB} and skip("Skipping due to VERILATOR_TEST_NO_GDB");
lint( if ($ENV{VERILATOR_TEST_NO_GDB}) {
v_flags => ["--debug-sigsegv"], skip("Skipping due to VERILATOR_TEST_NO_GDB");
fails => 1, } elsif (system("gdb --version")) {
sanitize => 0, skip("No gdb installed");
expect => } else {
lint(
v_flags => ["--debug-sigsegv"],
fails => 1,
sanitize => 0,
expect =>
'%Error: Verilator internal fault, sorry. Suggest trying --debug --gdbbt '%Error: Verilator internal fault, sorry. Suggest trying --debug --gdbbt
%Error: Command Failed.*', %Error: Command Failed.*',
); );
ok(1); ok(1);
}
1; 1;

View File

@ -9,18 +9,22 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(vlt => 1); scenarios(vlt => 1);
$ENV{VERILATOR_TEST_NO_GDB} and skip("Skipping due to VERILATOR_TEST_NO_GDB"); if ($ENV{VERILATOR_TEST_NO_GDB}) {
skip("Skipping due to VERILATOR_TEST_NO_GDB");
lint( } elsif (system("gdb --version")) {
verilator_flags2 => ["--lint-only --debug --gdbbt --debug-sigsegv"], skip("No gdb installed");
sanitize => 0, } else {
fails => $Self->{vlt_all}, lint(
expect => verilator_flags2 => ["--lint-only --debug --gdbbt --debug-sigsegv"],
sanitize => 0,
fails => $Self->{vlt_all},
expect =>
'.* '.*
Program received signal SIGSEGV, Segmentation fault. Program received signal SIGSEGV, Segmentation fault.
.*in V3Options::.* .*in V3Options::.*
.*%Error: Command Failed.*', .*%Error: Command Failed.*',
); );
ok(1); ok(1);
}
1; 1;