diff --git a/docs/internals.rst b/docs/internals.rst index 35ac156f0..0bea6adc7 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -2350,11 +2350,6 @@ check_finished string ``*-* All Finished *-*`` being printed on standard output. This is the normal way for successful tests to finish. -expect - A quoted list of strings or regular expression to be matched in the - output. See `Hints On Writing Tests` for more detail on how this argument - should be used. - fails True to indicate this step is expected to fail. Tests that are expected to fail generally have _bad in their filename. diff --git a/test_regress/driver.py b/test_regress/driver.py index 41b830149..daac67150 100755 --- a/test_regress/driver.py +++ b/test_regress/driver.py @@ -432,8 +432,7 @@ class Runner: else: error_msg = test.errors if test.errors else test.errors_keep_going test.oprint("FAILED: " + error_msg) - j = " -j" if Args.jobs else "" - makecmd = VtOs.getenv_def('VERILATOR_MAKE', os.environ['MAKE']) + j + " &&" + makecmd = VtOs.getenv_def('VERILATOR_MAKE', os.environ['MAKE']) + " &&" upperdir = 'test_regress/' if re.search(r'test_regress', os.getcwd()) else '' self.fail_msgs.append("\t#" + test.soprint("%Error: " + error_msg) + "\t\t" + makecmd + " " + upperdir + test.py_filename + @@ -763,6 +762,7 @@ class VlTest: self.coverage_filename = self.obj_dir + "/coverage.dat" self.golden_filename = re.sub(r'\.py$', '.out', self.py_filename) self.main_filename = self.obj_dir + "/" + self.vm_prefix + "__main.cpp" + self.compile_log_filename = self.obj_dir + "/vlt_compile.log" self.run_log_filename = self.obj_dir + "/vlt_sim.log" self.stats = self.obj_dir + "/V" + self.name + "__stats.txt" self.top_filename = re.sub(r'\.py$', '', self.py_filename) + '.' + self.v_suffix @@ -1055,7 +1055,6 @@ class VlTest: def compile(self, **kwargs) -> None: """Run simulation compiler. Arguments similar to run(); default arguments are from self""" param = { - 'expect': None, 'expect_filename': None, 'fails': False, 'make_flags': [], @@ -1234,7 +1233,6 @@ class VlTest: self.run(logfile=self.obj_dir + "/vlt_compile.log", fails=param['fails'], tee=param['tee'], - expect=param['expect'], expect_filename=param['expect_filename'], verilator_run=True, cmd=vlt_cmd) @@ -1251,7 +1249,6 @@ class VlTest: logfile=self.obj_dir + "/vlt_cmake.log", fails=param['fails'], tee=param['tee'], - expect=param['expect'], expect_filename=param['expect_filename'], verilator_run=True, cmd=[ @@ -1326,7 +1323,6 @@ class VlTest: 'entering': False, 'check_finished': False, 'executable': None, - 'expect': None, 'expect_filename': None, 'fails': False, 'run_env': '', @@ -1363,7 +1359,6 @@ class VlTest: ' '.join(param['all_run_flags']), ], *param, - expect=param['atsim_run_expect'], # non-verilator expect isn't the same expect_filename=param['atsim_run_expect_filename'], ) elif param['ghdl']: @@ -1376,7 +1371,6 @@ class VlTest: ' '.join(param['all_run_flags']), ], *param, - expect=param['ghdl_run_expect'], # non-verilator expect isn't the same expect_filename=param['ghdl_run_expect_filename'], ) elif param['iv']: @@ -1393,7 +1387,6 @@ class VlTest: fails=param['fails'], cmd=cmd, *param, - expect=param['iv_run_expect'], # non-verilator expect isn't the same expect_filename=param['iv_run_expect_filename'], ) elif param['ms']: @@ -1409,7 +1402,6 @@ class VlTest: (" top") ], *param, - expect=param['ms_run_expect'], # non-verilator expect isn't the same expect_filename=param['ms_expect_filename'], ) elif param['nc']: @@ -1422,7 +1414,6 @@ class VlTest: ' '.join(param['all_run_flags']), ], *param, - expect=param['nc_run_expect'], # non-verilator expect isn't the same expect_filename=param['nc_run_expect_filename'], ) elif param['vcs']: @@ -1436,7 +1427,6 @@ class VlTest: ' '.join(param['all_run_flags']), ], *param, - expect=param['vcs_run_expect'], # non-verilator expect isn't the same expect_filename=param['vcs_run_expect_filename'], ) elif param['xrun']: @@ -1455,7 +1445,6 @@ class VlTest: param['top_filename'], ], *param, - expect=param['xrun_run_expect'], # non-verilator expect isn't the same expect_filename=param['xrun_run_expect_filename'], ) elif param['xsim']: @@ -1468,7 +1457,6 @@ class VlTest: ' '.join(param['all_run_flags']), (" " + self.name + ".top") ], *param, - expect=param['xsim_run_expect'], # non-verilator expect isn't the same expect_filename=param['xsim_expect_filename'], ) elif param['vlt_all']: @@ -1489,7 +1477,6 @@ class VlTest: aslr_off=param['aslr_off'], # Disable address space layour randomization check_finished=param['check_finished'], # Check for All Finished entering=param['entering'], # Print entering directory information - expect=param['expect'], expect_filename=param['expect_filename'], fails=param['fails'], logfile=param.get('logfile', self.obj_dir + "/vlt_sim.log"), @@ -1634,7 +1621,6 @@ class VlTest: aslr_off=False, # Disable address space layour randomization check_finished=False, # Check for All Finished entering=None, # Print entering directory information - expect=None, # Regexp to expect in output expect_filename=None, # Filename that should match logfile fails=False, # Command should fail logfile=None, # Filename to write putput to @@ -1741,12 +1727,12 @@ class VlTest: return False # Read the log file a couple of times to allow for NFS delays - if check_finished or expect: + if check_finished: for tryn in range(self.tries() - 1, -1, -1): if tryn != self.tries() - 1: time.sleep(1) moretry = tryn != 0 - if self._run_log_try(cmd, logfile, check_finished, moretry, expect): + if not self._run_log_try(logfile, check_finished, moretry): break if expect_filename: self.files_identical(logfile, expect_filename, is_logfile=True) @@ -1754,8 +1740,8 @@ class VlTest: return True - def _run_log_try(self, cmd: str, logfile: str, check_finished: bool, moretry: bool, - expect) -> None: + def _run_log_try(self, logfile: str, check_finished: bool, moretry: bool) -> bool: + # If moretry, then return true to try again with open(logfile, 'r', encoding='latin-1', newline='\n') as fh: if not fh and moretry: return True @@ -1766,31 +1752,6 @@ class VlTest: if moretry: return True self.error("Missing '*-* All Finished *-*'") - if expect: - # Strip debugging comments - # See also files_identical - wholefile = re.sub(r'^- [^\n]+\n', '', wholefile) - wholefile = re.sub(r'^- [a-z.0-9]+:\d+:[^\n]+\n', '', wholefile) - wholefile = re.sub(r'^dot [^\n]+\n', '', wholefile) - wholefile = re.sub(r'^==[0-9]+== [^\n]+\n', '', wholefile) # Valgrind - # Compare - quoted = (re.escape(expect) or self._try_regex(wholefile, expect) == 1 - or re.search(expect, wholefile)) - ok = (wholefile == expect or self._try_regex(wholefile, expect) == 1 - or re.search(quoted, wholefile)) - if not ok: - #print("**BAD " + self.name + " " + logfile + " MT " + moretry + " " + try) - if moretry: - return True - self.error("Miscompares in output from " + cmd[0]) - if ok < 1: - self.error("Might be error in regexp format") - print("GOT:") - print(wholefile) - print("ENDGOT") - print("EXPECT:") - print(expect) - print("ENDEXPECT") return False @@ -2170,6 +2131,7 @@ class VlTest: break def _files_identical_try(self, fn1: str, fn2: str, is_logfile: bool, moretry: bool) -> bool: + # If moretry, then return true to try again try: f1 = open( # pylint: disable=consider-using-with fn1, 'r', encoding='latin-1', newline='\n') @@ -2187,20 +2149,21 @@ class VlTest: self.copy_if_golden(fn1, fn2) self.error("Files_identical file does not exist: " + fn2) return True - ok = self._files_identical_reader(f1, - f2, - fn1=fn1, - fn2=fn2, - is_logfile=is_logfile, - moretry=moretry) + again = self._files_identical_reader(f1, + f2, + fn1=fn1, + fn2=fn2, + is_logfile=is_logfile, + moretry=moretry) if f1: f1.close() if f2: f2.close() - return ok + return again def _files_identical_reader(self, f1, f2, fn1: str, fn2: str, is_logfile: bool, moretry: bool) -> None: + # If moretry, then return true to try again l1s = f1.readlines() l2s = f2.readlines() if f2 else [] # print(" rawGOT="+pformat(l1s)+"\n rawEXP="+pformat(l2s)) @@ -2270,7 +2233,7 @@ class VlTest: file=sys.stderr) return False - return True + return False # Good def files_identical_sorted(self, fn1: str, fn2: str, is_logfile=False) -> None: """Test if two files, after sorting both, have identical contents""" diff --git a/test_regress/t/t_assert_elab_bad.py b/test_regress/t/t_assert_elab_bad.py index ec8e7f2c3..12c2d4b32 100755 --- a/test_regress/t/t_assert_elab_bad.py +++ b/test_regress/t/t_assert_elab_bad.py @@ -21,7 +21,7 @@ test.compile(v_flags2=[ test.execute(fails=test.vlt_all) -test.file_grep(test.obj_dir + "/vlt_compile.log", +test.file_grep(test.compile_log_filename, r'%Warning-USERFATAL: "Parameter 5 is invalid...string and constant both work"') test.passes() diff --git a/test_regress/t/t_debug_exit_parse.py b/test_regress/t/t_debug_exit_parse.py index 527c9eee3..51dded575 100755 --- a/test_regress/t/t_debug_exit_parse.py +++ b/test_regress/t/t_debug_exit_parse.py @@ -12,6 +12,8 @@ import vltest_bootstrap test.scenarios('vlt') test.top_filename = "t_EXAMPLE.v" -test.lint(verilator_flags2=["--debug-exit-parse"], expect='--debug-exit-parse') +test.lint(verilator_flags2=["--debug-exit-parse"]) + +test.file_grep(test.compile_log_filename, r'--debug-exit-parse') test.passes() diff --git a/test_regress/t/t_debug_fatalsrc_bad.py b/test_regress/t/t_debug_fatalsrc_bad.py index 924b7c544..9ca95762c 100755 --- a/test_regress/t/t_debug_fatalsrc_bad.py +++ b/test_regress/t/t_debug_fatalsrc_bad.py @@ -14,9 +14,9 @@ test.scenarios('vlt') if not test.have_gdb: test.skip("No gdb installed") -test.lint(verilator_flags2=["--debug-fatalsrc"], - fails=test.vlt_all, - expect="""%Error: Internal Error: .*: --debug-fatal-src -.* See the manual .*""") +test.lint(verilator_flags2=["--debug-fatalsrc"], fails=test.vlt_all) + +test.file_grep(test.compile_log_filename, r'%Error: Internal Error: .*: --debug-fatal-src') +test.file_grep(test.compile_log_filename, r'See the manual') test.passes() diff --git a/test_regress/t/t_debug_fatalsrc_bt_bad.py b/test_regress/t/t_debug_fatalsrc_bt_bad.py index 95fab9c75..139ac83b1 100755 --- a/test_regress/t/t_debug_fatalsrc_bt_bad.py +++ b/test_regress/t/t_debug_fatalsrc_bt_bad.py @@ -16,11 +16,10 @@ if 'VERILATOR_TEST_NO_GDB' in os.environ: if not test.have_gdb: test.skip("No gdb installed") -test.lint(verilator_flags2=["--lint-only --debug --gdbbt --debug-fatalsrc"], - fails=True, - expect="""%Error: Internal Error: .*: --debug-fatal-src -.*See the manual .* -.*in V3Options::.* -.*%Error: Command Failed.*""") +test.lint(verilator_flags2=["--lint-only --debug --gdbbt --debug-fatalsrc"], fails=True) + +test.file_grep(test.compile_log_filename, r'%Error: Internal Error: .*: --debug-fatal-src') +test.file_grep(test.compile_log_filename, r'See the manual') +test.file_grep(test.compile_log_filename, r'in V3Options::') test.passes() diff --git a/test_regress/t/t_debug_sigsegv_bad.py b/test_regress/t/t_debug_sigsegv_bad.py index 5dd01cbdf..e05e1f470 100755 --- a/test_regress/t/t_debug_sigsegv_bad.py +++ b/test_regress/t/t_debug_sigsegv_bad.py @@ -16,10 +16,10 @@ if 'VERILATOR_TEST_NO_GDB' in os.environ: if not test.have_gdb: test.skip("No gdb installed") -test.lint(v_flags=["--debug-sigsegv"], - fails=True, - sanitize=0, - expect="""%Error: Verilator internal fault, sorry. Suggest trying --debug --gdbbt -%Error: Command Failed.*""") +test.lint(v_flags=["--debug-sigsegv"], fails=True, sanitize=0) + +test.file_grep(test.compile_log_filename, + r'%Error: Verilator internal fault, sorry. Suggest trying --debug --gdbbt') +test.file_grep(test.compile_log_filename, r'Command Failed') test.passes() diff --git a/test_regress/t/t_debug_sigsegv_bt_bad.py b/test_regress/t/t_debug_sigsegv_bt_bad.py index a8dff0ecc..c602172b0 100755 --- a/test_regress/t/t_debug_sigsegv_bt_bad.py +++ b/test_regress/t/t_debug_sigsegv_bt_bad.py @@ -17,10 +17,9 @@ if not test.have_gdb: test.lint(verilator_flags2=["--lint-only --debug --gdbbt --debug-sigsegv"], sanitize=0, - fails=test.vlt_all, - expect=""".* -Program received signal SIGSEGV, Segmentation fault. -.*in V3Options::.* -.*%Error: Command Failed.*""") + fails=test.vlt_all) + +test.file_grep(test.compile_log_filename, r'Program received signal SIGSEGV') +test.file_grep(test.compile_log_filename, r'in V3Options::') test.passes() diff --git a/test_regress/t/t_flag_generate_key.py b/test_regress/t/t_flag_generate_key.py index 1f95c3a57..4565feae4 100755 --- a/test_regress/t/t_flag_generate_key.py +++ b/test_regress/t/t_flag_generate_key.py @@ -12,9 +12,10 @@ import vltest_bootstrap test.scenarios('vlt') test.compile(v_flags2=["--generate-key"], - expect=r'VL-KEY', verilator_make_gmake=False, make_top_shell=False, make_main=False) +test.file_grep(test.compile_log_filename, r'VL-KEY') + test.passes() diff --git a/test_regress/t/t_flag_getenv.py b/test_regress/t/t_flag_getenv.py index 491390b59..82aee49d3 100755 --- a/test_regress/t/t_flag_getenv.py +++ b/test_regress/t/t_flag_getenv.py @@ -14,10 +14,11 @@ test.scenarios('vlt') test.setenv('FOOBARTEST', "gotit") test.run(cmd=[os.environ["VERILATOR_ROOT"] + "/bin/verilator --getenv FOOBARTEST"], - expect=r'gotit', - logfile=test.obj_dir + "/simx.log", + logfile=test.compile_log_filename, verilator_run=True) +test.file_grep(test.compile_log_filename, r'gotit') + for var in [ 'MAKE', 'PERL', 'PYTHON3', 'SYSTEMC', 'SYSTEMC_ARCH', 'SYSTEMC_LIBDIR', 'VERILATOR_ROOT' ]: diff --git a/test_regress/t/t_flag_instr_count_dpi_bad.py b/test_regress/t/t_flag_instr_count_dpi_bad.py index 12381c7b3..b3e8df414 100755 --- a/test_regress/t/t_flag_instr_count_dpi_bad.py +++ b/test_regress/t/t_flag_instr_count_dpi_bad.py @@ -11,8 +11,8 @@ import vltest_bootstrap test.scenarios('vlt') -test.lint(verilator_flags2=["--instr-count-dpi -1"], - fails=True, - expect="%Error: --instr-count-dpi must be non-negative: -1") +test.lint(verilator_flags2=["--instr-count-dpi -1"], fails=True) + +test.file_grep(test.compile_log_filename, "%Error: --instr-count-dpi must be non-negative: -1") test.passes() diff --git a/test_regress/t/t_flag_quiet_exit.py b/test_regress/t/t_flag_quiet_exit.py index ffe942afc..ad7e5791a 100755 --- a/test_regress/t/t_flag_quiet_exit.py +++ b/test_regress/t/t_flag_quiet_exit.py @@ -16,7 +16,7 @@ test.top_filename = "t/t_file_does_not_exist.v" # "Command Failed" line test.compile(v_flags2=["--quiet-exit"], fails=True) -test.file_grep_not(test.obj_dir + "/vlt_compile.log", r'Exiting due to') -test.file_grep_not(test.obj_dir + "/vlt_compile.log", r'Command Failed') +test.file_grep_not(test.compile_log_filename, r'Exiting due to') +test.file_grep_not(test.compile_log_filename, r'Command Failed') test.passes() diff --git a/test_regress/t/t_flag_quiet_stats.py b/test_regress/t/t_flag_quiet_stats.py index a229ed30f..03b230104 100755 --- a/test_regress/t/t_flag_quiet_stats.py +++ b/test_regress/t/t_flag_quiet_stats.py @@ -15,6 +15,6 @@ test.compile(verilator_flags2=['--quiet-stats'], verilator_make_gcc=False, logfile=test.run_log_filename) -test.file_grep_not(test.obj_dir + '/vlt_compile.log', r'V e r i l a t') +test.file_grep_not(test.compile_log_filename, r'V e r i l a t') test.passes() diff --git a/test_regress/t/t_flag_quiet_stats2.py b/test_regress/t/t_flag_quiet_stats2.py index 1b3b95356..0e875e258 100755 --- a/test_regress/t/t_flag_quiet_stats2.py +++ b/test_regress/t/t_flag_quiet_stats2.py @@ -14,6 +14,6 @@ test.top_filename = "t/t_flag_quiet_stats.v" test.compile(verilator_flags2=['--quiet'], verilator_make_gcc=False, logfile=test.run_log_filename) -test.file_grep_not(test.obj_dir + '/vlt_compile.log', r'V e r i l a t') +test.file_grep_not(test.compile_log_filename, r'V e r i l a t') test.passes() diff --git a/test_regress/t/t_flag_quiet_stats3.py b/test_regress/t/t_flag_quiet_stats3.py index 43bdfb9fb..f7fb9b54b 100755 --- a/test_regress/t/t_flag_quiet_stats3.py +++ b/test_regress/t/t_flag_quiet_stats3.py @@ -16,6 +16,6 @@ test.compile(verilator_flags2=['--quiet --no-quiet-stats'], verilator_make_gcc=False, logfile=test.run_log_filename) -test.file_grep(test.obj_dir + '/vlt_compile.log', r'V e r i l a t') +test.file_grep(test.compile_log_filename, r'V e r i l a t') test.passes() diff --git a/test_regress/t/t_flag_supported.py b/test_regress/t/t_flag_supported.py index 90f3ca8a9..56d4984b8 100755 --- a/test_regress/t/t_flag_supported.py +++ b/test_regress/t/t_flag_supported.py @@ -13,21 +13,19 @@ test.scenarios('vlt') if test.have_coroutines: test.run(cmd=[os.environ["VERILATOR_ROOT"] + "/bin/verilator --get-supported COROUTINES"], - expect="""1 -""", logfile=test.obj_dir + "/vlt_coroutines.log", + expect_filename="t/t_flag_supported_1.out", verilator_run=True) if test.have_sc: test.run(cmd=[os.environ["VERILATOR_ROOT"] + "/bin/verilator --get-supported SYSTEMC"], - expect="""1 -""", logfile=test.obj_dir + "/vlt_systemc.log", + expect_filename="t/t_flag_supported_1.out", verilator_run=True) test.run(cmd=[os.environ["VERILATOR_ROOT"] + "/bin/verilator --get-supported DOES_NOT_EXIST"], - expect='', logfile=test.obj_dir + "/vlt_does_not_exist.log", + expect_filename="t/t_flag_supported_empty.out", verilator_run=True) test.passes() diff --git a/test_regress/t/t_flag_supported_1.out b/test_regress/t/t_flag_supported_1.out new file mode 100755 index 000000000..d00491fd7 --- /dev/null +++ b/test_regress/t/t_flag_supported_1.out @@ -0,0 +1 @@ +1 diff --git a/test_regress/t/t_flag_supported_empty.out b/test_regress/t/t_flag_supported_empty.out new file mode 100755 index 000000000..8b1378917 --- /dev/null +++ b/test_regress/t/t_flag_supported_empty.out @@ -0,0 +1 @@ + diff --git a/test_regress/t/t_flag_version.py b/test_regress/t/t_flag_version.py index 478f3a049..05b74a5da 100755 --- a/test_regress/t/t_flag_version.py +++ b/test_regress/t/t_flag_version.py @@ -11,6 +11,8 @@ import vltest_bootstrap test.scenarios('dist') +n = 0 + for prog in [ # See also t_flag_help.py os.environ["VERILATOR_ROOT"] + "/bin/verilator", @@ -19,24 +21,22 @@ for prog in [ #os.environ["VERILATOR_ROOT"] + "/bin/verilator_gantt", #os.environ["VERILATOR_ROOT"] + "/bin/verilator_profcfunc", ]: + n += 1 + log_filename = test.obj_dir + "/vlt_" + str(n) + ".log" test.run(fails=False, cmd=["perl", prog, "--version"], tee=test.verbose, - logfile=test.obj_dir + "/t_help.log", - expect=r'^Verilator', + logfile=log_filename, verilator_run=True) + test.file_grep(log_filename, r'Verilator') + n += 1 + log_filename = test.obj_dir + "/vlt_" + str(n) + ".log" test.run(fails=False, cmd=["perl", prog, "-V"], tee=test.verbose, - logfile=test.obj_dir + "/t_help.log", - expect=r'^Verilator', - verilator_run=True) - - test.run(fails=False, - cmd=["perl", prog, "-V"], - logfile=test.obj_dir + "/t_help.log", - expect=r'^Verilator', + logfile=log_filename, verilator_run=True) + test.file_grep(log_filename, r'Verilator') test.passes() diff --git a/test_regress/t/t_for_funcbound.py b/test_regress/t/t_for_funcbound.py index 5291ebae6..f4b1881d1 100755 --- a/test_regress/t/t_for_funcbound.py +++ b/test_regress/t/t_for_funcbound.py @@ -13,8 +13,9 @@ test.scenarios('simulator') test.compile() -test.execute(expect="""[10] hello -[20] world -""") +test.execute() + +test.file_grep(test.run_log_filename, r"\[10\] hello") +test.file_grep(test.run_log_filename, r"\[20\] world") test.passes() diff --git a/test_regress/t/t_inst_tree_inl0_pub0.py b/test_regress/t/t_inst_tree_inl0_pub0.py index e433c3e88..25514c89e 100755 --- a/test_regress/t/t_inst_tree_inl0_pub0.py +++ b/test_regress/t/t_inst_tree_inl0_pub0.py @@ -30,6 +30,7 @@ if test.vlt_all: test.file_grep(out_filename, r'{"type":"MODULE","name":"l5__P2",.*"loc":"f,83:[^"]*",.*"origName":"l5"') -test.execute(expect=r"\] (%m|.*t\.ps): Clocked", ) +test.execute() +test.file_grep(test.run_log_filename, r"\] (%m|.*t\.ps): Clocked") test.passes() diff --git a/test_regress/t/t_inst_tree_inl0_pub1.py b/test_regress/t/t_inst_tree_inl0_pub1.py index 57ac152d9..3fa932f0e 100755 --- a/test_regress/t/t_inst_tree_inl0_pub1.py +++ b/test_regress/t/t_inst_tree_inl0_pub1.py @@ -53,6 +53,7 @@ if test.vlt_all: check_relative_refs("l5__P1", True) check_relative_refs("l5__P2", True) -test.execute(expect=r"\] (%m|.*t\.ps): Clocked") +test.execute() +test.file_grep(test.run_log_filename, r"\] (%m|.*t\.ps): Clocked") test.passes() diff --git a/test_regress/t/t_inst_tree_inl1_pub0.py b/test_regress/t/t_inst_tree_inl1_pub0.py index 9ecece33d..c3ddf6de9 100755 --- a/test_regress/t/t_inst_tree_inl1_pub0.py +++ b/test_regress/t/t_inst_tree_inl1_pub0.py @@ -32,6 +32,7 @@ if test.vlt_all: r'{"type":"VAR","name":"t.u.u1.u0.z0",.*"loc":"f,70:[^"]*",.*"origName":"z0",.*"dtypeName":"logic"' ) -test.execute(expect=r"\] (%m|.*t\.ps): Clocked\n") +test.execute() +test.file_grep(test.run_log_filename, r"\] (%m|.*t\.ps): Clocked") test.passes() diff --git a/test_regress/t/t_inst_tree_inl1_pub1.py b/test_regress/t/t_inst_tree_inl1_pub1.py index f26506db1..0a61713b5 100755 --- a/test_regress/t/t_inst_tree_inl1_pub1.py +++ b/test_regress/t/t_inst_tree_inl1_pub1.py @@ -33,6 +33,7 @@ if test.vlt_all: r'{"type":"VAR","name":"u.u0.u1.u0.u0.z",.*"loc":"f,83:[^"]*",.*"origName":"z",.*,"isSigPublic":true,.*dtypeName":"logic",.*"isSigUserRdPublic":true,.*"isSigUserRWPublic":true' ) -test.execute(expect=r"\] (%m|.*t\.ps): Clocked") +test.execute() +test.file_grep(test.run_log_filename, r"\] (%m|.*t\.ps): Clocked") test.passes() diff --git a/test_regress/t/t_math_svl.py b/test_regress/t/t_math_svl.py index 492920838..f5ff115eb 100755 --- a/test_regress/t/t_math_svl.py +++ b/test_regress/t/t_math_svl.py @@ -13,9 +13,9 @@ test.scenarios('simulator') test.compile() -test.execute( - # Make sure we get the finish statement called - expect=r"""\*-\* All Finished \*-\* -Goodbye world, at cycle \d+.*""") +test.execute() + +# Make sure we get the finish statement called +test.file_grep(test.run_log_filename, r'Goodbye world, at cycle \d') test.passes() diff --git a/test_regress/t/t_order_wireloop.py b/test_regress/t/t_order_wireloop.py index b89510f69..2a9b7aa62 100755 --- a/test_regress/t/t_order_wireloop.py +++ b/test_regress/t/t_order_wireloop.py @@ -11,12 +11,13 @@ import vltest_bootstrap test.scenarios('simulator') -test.compile( - fails=test.vlt_all, - # Used to be %Error: t/t_order_wireloop.v:\d+: Wire inputs its own output, creating circular logic .wire x=x. - # However we no longer gate optimize this - # Can't use expect_filename here as unstable output - expect= +test.compile(fails=test.vlt_all) + +# Used to be %Error: t/t_order_wireloop.v:\d+: Wire inputs its own output, creating circular logic .wire x=x. +# However we no longer gate optimize this +# Can't use expect_filename here as unstable output +test.file_grep( + test.compile_log_filename, r"%Warning-UNOPTFLAT: t/t_order_wireloop.v:\d+:\d+: Signal unoptimizable: Circular combinational logic: \'bar\'" ) diff --git a/test_regress/t/t_pipe_exit_bad.py b/test_regress/t/t_pipe_exit_bad.py index db106b66d..3d64d816b 100755 --- a/test_regress/t/t_pipe_exit_bad.py +++ b/test_regress/t/t_pipe_exit_bad.py @@ -12,8 +12,9 @@ import vltest_bootstrap test.scenarios('vlt') test.top_filename = "t/t_pipe_filter.v" -test.lint(verilator_flags2=['-E --pipe-filter \'python3 t/t_pipe_exit_bad_pf.pf\' '], - fails=True, - expect=r'%Error: t_pipe_exit_bad_pf.pf: Intentional bad exit status....*') +test.lint(verilator_flags2=['-E --pipe-filter \'python3 t/t_pipe_exit_bad_pf.pf\' '], fails=True) + +test.file_grep(test.compile_log_filename, + r'%Error: t_pipe_exit_bad_pf.pf: Intentional bad exit status....*') test.passes() diff --git a/test_regress/t/t_pp_circdef_bad.py b/test_regress/t/t_pp_circdef_bad.py index c7236cb6f..0478d07b9 100755 --- a/test_regress/t/t_pp_circdef_bad.py +++ b/test_regress/t/t_pp_circdef_bad.py @@ -11,9 +11,9 @@ import vltest_bootstrap test.scenarios('vlt') -test.lint( - fails=True, - # EOF result varies with Bison version, so can't use .out - expect=r'define or other nested inclusion') +test.lint(fails=True) + +# EOF result varies with Bison version, so can't use .out +test.file_grep(test.compile_log_filename, r'define or other nested inclusion') test.passes() diff --git a/test_regress/t/t_runflag.py b/test_regress/t/t_runflag.py index 2ec96c029..3504e8aca 100755 --- a/test_regress/t/t_runflag.py +++ b/test_regress/t/t_runflag.py @@ -14,14 +14,16 @@ test.scenarios('vlt_all') test.compile() test.execute(all_run_flags=["+verilator+debug +verilator+debugi+9 +verilator+rand+reset+1"], - expect=r'.*Verilated::debug is on.*') + logfile=test.obj_dir + "/vlt_1.log") +test.file_grep(test.obj_dir + "/vlt_1.log", r'Verilated::debug is on') -test.execute(all_run_flags=["+verilator+help"], - fails=True, - expect=r".*For help, please see 'verilator --help'.*") +test.execute(all_run_flags=["+verilator+help"], fails=True, logfile=test.obj_dir + "/vlt_2.log") +test.file_grep(test.obj_dir + "/vlt_2.log", r"For help, please see 'verilator --help'") -test.execute(all_run_flags=["+verilator+V"], fails=True, expect=r'.*Version:.*') +test.execute(all_run_flags=["+verilator+V"], fails=True, logfile=test.obj_dir + "/vlt_3.log") +test.file_grep(test.obj_dir + "/vlt_3.log", r'Version:') -test.execute(all_run_flags=["+verilator+version"], fails=True, expect=r'.*Version:.*') +test.execute(all_run_flags=["+verilator+version"], fails=True, logfile=test.obj_dir + "/vlt_4.log") +test.file_grep(test.obj_dir + "/vlt_4.log", r'Version:') test.passes() diff --git a/test_regress/t/t_threads_nondeterminism.py b/test_regress/t/t_threads_nondeterminism.py index f0a847a26..51793a66a 100755 --- a/test_regress/t/t_threads_nondeterminism.py +++ b/test_regress/t/t_threads_nondeterminism.py @@ -16,6 +16,6 @@ test.compile(verilator_flags2=['--cc --debug-nondeterminism --no-skip-identical' test.execute() -test.file_grep(test.obj_dir + "/vlt_compile.log", r'Hash of shape') +test.file_grep(test.compile_log_filename, r'Hash of shape') test.passes() diff --git a/test_regress/t/t_timing_fork_comb.py b/test_regress/t/t_timing_fork_comb.py index 224405dec..eb5fe00c7 100755 --- a/test_regress/t/t_timing_fork_comb.py +++ b/test_regress/t/t_timing_fork_comb.py @@ -12,10 +12,10 @@ import vltest_bootstrap test.scenarios('simulator') # Should convert the first always into combo and detect cycle -test.compile( - fails=True, - verilator_flags2=["--timing"], - expect= +test.compile(fails=True, verilator_flags2=["--timing"]) + +test.file_grep( + test.compile_log_filename, r'%Warning-UNOPTFLAT: t/t_timing_fork_comb.v:\d+:\d+: Signal unoptimizable: Circular combinational logic:' ) diff --git a/test_regress/t/t_udp_tableeof_bad.py b/test_regress/t/t_udp_tableeof_bad.py index 8b3cadf85..6b41e2961 100755 --- a/test_regress/t/t_udp_tableeof_bad.py +++ b/test_regress/t/t_udp_tableeof_bad.py @@ -11,10 +11,9 @@ import vltest_bootstrap test.scenarios('linter') -test.lint( - verilator_flags2=["--lint-only --bbox-unsup"], - fails=test.vlt_all, - # Cannot use .out, get "$end" or "end of file" depending on bison version - expect=r"EOF in 'table'") +test.lint(verilator_flags2=["--lint-only --bbox-unsup"], fails=test.vlt_all) + +# Cannot use .out, get "$end" or "end of file" depending on bison version +test.file_grep(test.compile_log_filename, r"EOF in 'table'") test.passes() diff --git a/test_regress/t/t_unicode.py b/test_regress/t/t_unicode.py index 4af354bed..61dc58004 100755 --- a/test_regress/t/t_unicode.py +++ b/test_regress/t/t_unicode.py @@ -43,6 +43,8 @@ gen(test.top_filename) test.compile() -test.execute(expect=hi) +test.execute() + +test.file_grep(test.run_log_filename, hi) test.passes()