diff --git a/test_regress/Makefile_obj b/test_regress/Makefile_obj index c6bdd069b..2281352f6 100644 --- a/test_regress/Makefile_obj +++ b/test_regress/Makefile_obj @@ -31,6 +31,7 @@ CPPFLAGS += -DVERILATOR=1 # Needed by tracing routines CPPFLAGS += -DVL_DEBUG=1 CPPFLAGS += -DVM_PREFIX=$(VM_PREFIX) +CPPFLAGS += -DVM_PREFIX_INCLUDE="<$(VM_PREFIX).h>" CPPFLAGS += $(CPPFLAGS_DRIVER) CPPFLAGS += $(CPPFLAGS_DRIVER2) CPPFLAGS += $(CPPFLAGS_ADD) diff --git a/test_regress/t/t_clk_2in.cpp b/test_regress/t/t_clk_2in.cpp index c12350d60..74e946050 100644 --- a/test_regress/t/t_clk_2in.cpp +++ b/test_regress/t/t_clk_2in.cpp @@ -6,11 +6,7 @@ // without warranty, 2010 by Wilson Snyder. #include -#ifdef T_CLK_2IN_VEC -# include "Vt_clk_2in_vec.h" -#else -# include "Vt_clk_2in.h" -#endif +#include VM_PREFIX_INCLUDE unsigned int main_time = false; diff --git a/test_regress/t/t_dist_whitespace.pl b/test_regress/t/t_dist_whitespace.pl index 93c17dc3c..925b5a5d6 100755 --- a/test_regress/t/t_dist_whitespace.pl +++ b/test_regress/t/t_dist_whitespace.pl @@ -14,12 +14,19 @@ my $Debug; my %files = %{get_manifest_files($root)}; foreach my $file (sort keys %files) { - my $contents = file_contents("$root/$file"); + my $filename = "$root/$file"; + my $contents = file_contents($filename); if ($file =~ /\.out$/) { # Ignore golden files } elsif ($contents =~ /[\001\002\003\004\005\006]/) { # Ignore binrary files } elsif ($contents =~ /[ \t]\n/) { + if ($ENV{HARNESS_UPDATE_GOLDEN}) { + $contents =~ s/[ \t]+\n/\n/g; + $warns{$file} = "Updated whitespace at $file"; + write_wholefile($filename, $contents); + next; + } my @lines = split(/\n/, $contents); my $line_no = 0; foreach my $line (@lines) { @@ -37,7 +44,13 @@ foreach my $file (sort keys %files) { if (keys %warns) { # First warning lists everything as that's shown in the driver summary - $Self->error("Files have whitespace errors: ",join(' ',sort keys %warns)); + if ($ENV{HARNESS_UPDATE_GOLDEN}) { + $Self->error("Updated files with whitespace errors: ",join(' ',sort keys %warns)); + $Self->error("To auto-fix: HARNESS_UPDATE_GOLDEN=1 {command} or --golden"); + } else { + $Self->error("Files have whitespace errors: ",join(' ',sort keys %warns)); + $Self->error("To auto-fix: HARNESS_UPDATE_GOLDEN=1 {command} or --golden"); + } foreach my $file (sort keys %warns) { $Self->error($warns{$file}); } diff --git a/test_regress/t/t_mem_multi_io2.cpp b/test_regress/t/t_mem_multi_io2.cpp index f4fbfa4d6..b495e661f 100644 --- a/test_regress/t/t_mem_multi_io2.cpp +++ b/test_regress/t/t_mem_multi_io2.cpp @@ -3,13 +3,7 @@ // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2008 by Lane Brooks -#if defined(T_MEM_MULTI_IO2_CC) -# include "Vt_mem_multi_io2_cc.h" -#elif defined(T_MEM_MULTI_IO2_SC) -# include "Vt_mem_multi_io2_sc.h" -#else -# error "Unknown test" -#endif +#include VM_PREFIX_INCLUDE VM_PREFIX* tb = NULL; bool pass = true; diff --git a/test_regress/t/t_mem_multi_io3.cpp b/test_regress/t/t_mem_multi_io3.cpp index 8f001d86f..4df0e1970 100644 --- a/test_regress/t/t_mem_multi_io3.cpp +++ b/test_regress/t/t_mem_multi_io3.cpp @@ -3,13 +3,7 @@ // This file ONLY is placed into the Public Domain, for any use, // without warranty. -#if defined(T_MEM_MULTI_IO3_CC) -# include "Vt_mem_multi_io3_cc.h" -#elif defined(T_MEM_MULTI_IO3_SC) -# include "Vt_mem_multi_io3_sc.h" -#else -# error "Unknown test" -#endif +#include VM_PREFIX_INCLUDE VM_PREFIX* tb = NULL; bool pass = true; diff --git a/test_regress/t/t_trace_cat.cpp b/test_regress/t/t_trace_cat.cpp index 326b3abcf..08786d9ea 100644 --- a/test_regress/t/t_trace_cat.cpp +++ b/test_regress/t/t_trace_cat.cpp @@ -8,15 +8,7 @@ #include #include -#if defined(T_TRACE_CAT) -# include "Vt_trace_cat.h" -#elif defined(T_TRACE_CAT_REOPEN) -# include "Vt_trace_cat_reopen.h" -#elif defined(T_TRACE_CAT_RENEW) -# include "Vt_trace_cat_renew.h" -#else -# error "Unknown test" -#endif +#include VM_PREFIX_INCLUDE unsigned long long main_time = 0; double sc_time_stamp() { diff --git a/test_regress/t/t_trace_timescale.cpp b/test_regress/t/t_trace_timescale.cpp index 96632f559..7c9b86a5f 100644 --- a/test_regress/t/t_trace_timescale.cpp +++ b/test_regress/t/t_trace_timescale.cpp @@ -8,11 +8,7 @@ #include #include -#if defined(T_TRACE_TIMESCALE) -# include "Vt_trace_timescale.h" -#else -# error "Unknown test" -#endif +#include VM_PREFIX_INCLUDE unsigned long long main_time = 0; double sc_time_stamp() { diff --git a/test_regress/t/t_tri_gate.cpp b/test_regress/t/t_tri_gate.cpp index 1960985f7..b90e6a4d0 100644 --- a/test_regress/t/t_tri_gate.cpp +++ b/test_regress/t/t_tri_gate.cpp @@ -3,23 +3,7 @@ // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2008 by Lane Brooks -#ifdef T_COND -# include "Vt_tri_gate_cond.h" -#elif defined(T_BUFIF0) -# include "Vt_tri_gate_bufif0.h" -#elif defined(T_BUFIF1) -# include "Vt_tri_gate_bufif1.h" -#elif defined(T_NOTIF0) -# include "Vt_tri_gate_notif0.h" -#elif defined(T_NOTIF1) -# include "Vt_tri_gate_notif1.h" -#elif defined(T_PMOS) -# include "Vt_tri_gate_pmos.h" -#elif defined(T_NMOS) -# include "Vt_tri_gate_nmos.h" -#else -# error "Unknown test" -#endif +#include VM_PREFIX_INCLUDE VM_PREFIX* tb = NULL; diff --git a/test_regress/t/t_var_pinsizes.cpp b/test_regress/t/t_var_pinsizes.cpp index 995e00840..fba136f42 100644 --- a/test_regress/t/t_var_pinsizes.cpp +++ b/test_regress/t/t_var_pinsizes.cpp @@ -1,26 +1,6 @@ // -*- mode: C++; c-file-style: "cc-mode" -*- -#ifdef T_VAR_PINS_CC -# include "Vt_var_pins_cc.h" -#elif defined(T_VAR_PINS_SC1) -# include "Vt_var_pins_sc1.h" -#elif defined(T_VAR_PINS_SC2) -# include "Vt_var_pins_sc2.h" -#elif defined(T_VAR_PINS_SC32) -# include "Vt_var_pins_sc32.h" -#elif defined(T_VAR_PINS_SC64) -# include "Vt_var_pins_sc64.h" -#elif defined(T_VAR_PINS_SCUI) -# include "Vt_var_pins_scui.h" -#elif defined(T_VAR_PINS_SC_UINT) -# include "Vt_var_pins_sc_uint.h" -#elif defined(T_VAR_PINS_SC_BIGUINT) -# include "Vt_var_pins_sc_biguint.h" -#elif defined(T_VAR_PINS_SC_UINT_BIGUINT) -# include "Vt_var_pins_sc_uint_biguint.h" -#else -# error "Unknown test" -#endif +#include VM_PREFIX_INCLUDE VM_PREFIX* tb = NULL; diff --git a/test_regress/t/t_include_all.pl b/test_regress/t/t_verilated_all.pl similarity index 93% rename from test_regress/t/t_include_all.pl rename to test_regress/t/t_verilated_all.pl index 03a364f51..5799c25a2 100755 --- a/test_regress/t/t_include_all.pl +++ b/test_regress/t/t_verilated_all.pl @@ -36,7 +36,7 @@ foreach my $dfile (glob("$Self->{obj_dir}/*.d")) { foreach my $file (sort keys %hit) { if (!$hit{$file} && $file !~ /_sc/) { - $Self->error("Include file not covered by t_include_all test: ",$file); + $Self->error("Include file not covered by t_verilated_all test: ",$file); } } diff --git a/test_regress/t/t_include_all.v b/test_regress/t/t_verilated_all.v similarity index 100% rename from test_regress/t/t_include_all.v rename to test_regress/t/t_verilated_all.v diff --git a/test_regress/t/t_include_all_newest.pl b/test_regress/t/t_verilated_all_newest.pl similarity index 95% rename from test_regress/t/t_include_all_newest.pl rename to test_regress/t/t_verilated_all_newest.pl index dbe936ef9..183c15808 100755 --- a/test_regress/t/t_include_all_newest.pl +++ b/test_regress/t/t_verilated_all_newest.pl @@ -7,7 +7,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. -top_filename("t/t_include_all.v"); +top_filename("t/t_verilated_all.v"); my $root = ".."; diff --git a/test_regress/t/t_include_all_oldest.pl b/test_regress/t/t_verilated_all_oldest.pl similarity index 95% rename from test_regress/t/t_include_all_oldest.pl rename to test_regress/t/t_verilated_all_oldest.pl index a0077af6f..5e781bc0d 100755 --- a/test_regress/t/t_include_all_oldest.pl +++ b/test_regress/t/t_verilated_all_oldest.pl @@ -7,7 +7,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. -top_filename("t/t_include_all.v"); +top_filename("t/t_verilated_all.v"); my $root = "..";