mirror of
https://github.com/verilator/verilator.git
synced 2025-07-31 07:56:10 +00:00
Tests: Add default filename check to context tests
This commit is contained in:
parent
7cc7afca04
commit
4fa41c5dd8
@ -1,4 +1,4 @@
|
||||
# SystemC::Coverage-3
|
||||
C 'f../../t/t_cover_lib_c.cppl35pagesp_user/t_cover_lib_cokept_onehmain' 100
|
||||
C 'f../../t/t_cover_lib_c.cppl36pagesp_user/t_cover_lib_cokept_twohmain' 210
|
||||
C 'f../../t/t_cover_lib_c.cppl37pagesp_user/t_cover_lib_colost_threehmain' 220
|
||||
C 'f../../t/t_cover_lib_c.cppl44pagesp_user/t_cover_lib_cokept_onehmain' 100
|
||||
C 'f../../t/t_cover_lib_c.cppl45pagesp_user/t_cover_lib_cokept_twohmain' 210
|
||||
C 'f../../t/t_cover_lib_c.cppl46pagesp_user/t_cover_lib_colost_threehmain' 220
|
||||
|
@ -1,3 +1,3 @@
|
||||
# SystemC::Coverage-3
|
||||
C 'f../../t/t_cover_lib_c.cppl35pagesp_user/t_cover_lib_cokept_onehmain' 100
|
||||
C 'f../../t/t_cover_lib_c.cppl36pagesp_user/t_cover_lib_cokept_twohmain' 210
|
||||
C 'f../../t/t_cover_lib_c.cppl44pagesp_user/t_cover_lib_cokept_onehmain' 100
|
||||
C 'f../../t/t_cover_lib_c.cppl45pagesp_user/t_cover_lib_cokept_twohmain' 210
|
||||
|
@ -1,3 +1,3 @@
|
||||
# SystemC::Coverage-3
|
||||
C 'f../../t/t_cover_lib_c.cppl35pagesp_user/t_cover_lib_cokept_onehmain' 0
|
||||
C 'f../../t/t_cover_lib_c.cppl36pagesp_user/t_cover_lib_cokept_twohmain' 0
|
||||
C 'f../../t/t_cover_lib_c.cppl44pagesp_user/t_cover_lib_cokept_onehmain' 0
|
||||
C 'f../../t/t_cover_lib_c.cppl45pagesp_user/t_cover_lib_cokept_twohmain' 0
|
||||
|
@ -18,10 +18,17 @@
|
||||
|
||||
#include VM_PREFIX_INCLUDE
|
||||
|
||||
double sc_time_stamp() { return 0; }
|
||||
#define CHECK_RESULT_CSTR(got, exp) \
|
||||
if (strcmp((got), (exp))) { \
|
||||
printf("%%Error: %s:%d: GOT = '%s' EXP = '%s'\n", __FILE__, __LINE__, \
|
||||
(got) ? (got) : "<null>", (exp) ? (exp) : "<null>"); \
|
||||
++failure; \
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
||||
double sc_time_stamp() { return 0; }
|
||||
|
||||
int failure = 0;
|
||||
|
||||
//======================================================================
|
||||
@ -32,6 +39,8 @@ int main() {
|
||||
vluint32_t covers[1];
|
||||
vluint64_t coverw[2];
|
||||
|
||||
//
|
||||
|
||||
VL_COVER_INSERT(&covers[0], "comment", "kept_one");
|
||||
VL_COVER_INSERT(&coverw[0], "comment", "kept_two");
|
||||
VL_COVER_INSERT(&coverw[1], "comment", "lost_three");
|
||||
@ -40,6 +49,7 @@ int main() {
|
||||
coverw[0] = 210;
|
||||
coverw[1] = 220;
|
||||
|
||||
CHECK_RESULT_CSTR(VerilatedCov::defaultFilename(), "coverage.dat");
|
||||
VerilatedCov::write(VL_STRINGIFY(TEST_OBJ_DIR) "/coverage1.dat");
|
||||
VerilatedCov::clearNonMatch("kept_");
|
||||
VerilatedCov::write(VL_STRINGIFY(TEST_OBJ_DIR) "/coverage2.dat");
|
||||
|
33
test_regress/t/t_cover_lib_legacy.pl
Executable file
33
test_regress/t/t_cover_lib_legacy.pl
Executable file
@ -0,0 +1,33 @@
|
||||
#!/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_cover_lib.v");
|
||||
|
||||
compile(
|
||||
v_flags2 => ["--coverage t/t_cover_lib_c.cpp"],
|
||||
verilator_flags2 => ["--exe -Wall -Wno-DECLFILENAME"],
|
||||
make_flags => 'CPPFLAGS_ADD=-DTEST_OBJ_DIR="'.$Self->{obj_dir}.'"',
|
||||
make_top_shell => 0,
|
||||
make_main => 0,
|
||||
);
|
||||
|
||||
execute(
|
||||
check_finished => 1,
|
||||
);
|
||||
|
||||
files_identical_sorted("$Self->{obj_dir}/coverage1.dat", "t/t_cover_lib_1.out");
|
||||
files_identical_sorted("$Self->{obj_dir}/coverage2.dat", "t/t_cover_lib_2.out");
|
||||
files_identical_sorted("$Self->{obj_dir}/coverage3.dat", "t/t_cover_lib_3.out");
|
||||
files_identical_sorted("$Self->{obj_dir}/coverage4.dat", "t/t_cover_lib_4.out");
|
||||
|
||||
ok(1);
|
||||
1;
|
Loading…
Reference in New Issue
Block a user