From 21dbdbf69d0803dd6fd7660f656c00d9029ff5c9 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 25 Sep 2025 21:08:24 -0400 Subject: [PATCH] Tests: Auto-skip when not in root repo --- test_regress/driver.py | 5 +++++ test_regress/t/t_assert_comp_bad.py | 3 --- test_regress/t/t_event_control_star_never_bad.py | 3 --- test_regress/t/t_lint_assigneqexpr_bad.py | 3 --- test_regress/t/t_lint_badvltpragma_bad.py | 3 --- test_regress/t/t_lint_multidriven_bad.py | 3 --- test_regress/t/t_lint_paramnodefault_bad.py | 3 --- test_regress/t/t_lint_pinmissing_bad.py | 3 --- test_regress/t/t_lint_procassinit_bad.py | 3 --- test_regress/t/t_lint_stmtdly_bad.py | 3 --- test_regress/t/t_lint_widthexpand_docs_bad.py | 3 --- test_regress/t/t_param_hier_bad.py | 3 --- test_regress/t/t_var_bad_hide_docs.py | 3 --- 13 files changed, 5 insertions(+), 36 deletions(-) diff --git a/test_regress/driver.py b/test_regress/driver.py index 3261ab541..5c435f255 100755 --- a/test_regress/driver.py +++ b/test_regress/driver.py @@ -2674,6 +2674,11 @@ class VlTest: regexp=r'.*', lineno_adjust=-9999, # lines=None) -> None: #'#, #-#' + + if not os.path.exists(test.root + "/.git"): + self.skip("Not in a git repository") + return + temp_fn = out_filename temp_fn = re.sub(r'.*/', '', temp_fn) temp_fn = self.obj_dir + "/" + temp_fn diff --git a/test_regress/t/t_assert_comp_bad.py b/test_regress/t/t_assert_comp_bad.py index 5a3852f87..d90cee6ad 100755 --- a/test_regress/t/t_assert_comp_bad.py +++ b/test_regress/t/t_assert_comp_bad.py @@ -11,9 +11,6 @@ import vltest_bootstrap test.scenarios('simulator') -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.compile(verilator_flags2=['--assert'], nc_flags2=['+assert'], vcs_flags2=['-assert svaext'], diff --git a/test_regress/t/t_event_control_star_never_bad.py b/test_regress/t/t_event_control_star_never_bad.py index a2b567e13..9a2ac6e4d 100755 --- a/test_regress/t/t_event_control_star_never_bad.py +++ b/test_regress/t/t_event_control_star_never_bad.py @@ -12,9 +12,6 @@ import vltest_bootstrap test.scenarios('linter') test.top_filename = 't/t_event_control_star_never.v' -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.extract(in_filename=test.top_filename, diff --git a/test_regress/t/t_lint_assigneqexpr_bad.py b/test_regress/t/t_lint_assigneqexpr_bad.py index f7e35e5e8..f6a8acb6f 100755 --- a/test_regress/t/t_lint_assigneqexpr_bad.py +++ b/test_regress/t/t_lint_assigneqexpr_bad.py @@ -12,9 +12,6 @@ import vltest_bootstrap test.scenarios('vlt') test.top_filename = "t/t_lint_assigneqexpr.v" -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.lint(verilator_flags2=['-Wall -Wno-DECLFILENAME'], fails=True, expect_filename=test.golden_filename) diff --git a/test_regress/t/t_lint_badvltpragma_bad.py b/test_regress/t/t_lint_badvltpragma_bad.py index fa175c1c4..144609fba 100755 --- a/test_regress/t/t_lint_badvltpragma_bad.py +++ b/test_regress/t/t_lint_badvltpragma_bad.py @@ -11,9 +11,6 @@ import vltest_bootstrap test.scenarios('vlt') -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.lint(fails=True, expect_filename=test.golden_filename) test.extract(in_filename=test.top_filename, diff --git a/test_regress/t/t_lint_multidriven_bad.py b/test_regress/t/t_lint_multidriven_bad.py index c34cc857e..5f9429530 100755 --- a/test_regress/t/t_lint_multidriven_bad.py +++ b/test_regress/t/t_lint_multidriven_bad.py @@ -11,9 +11,6 @@ import vltest_bootstrap test.scenarios('linter') -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.lint(fails=True, expect_filename=test.golden_filename) test.extract(in_filename=test.top_filename, diff --git a/test_regress/t/t_lint_paramnodefault_bad.py b/test_regress/t/t_lint_paramnodefault_bad.py index 5463b1a05..a7e39a6c8 100755 --- a/test_regress/t/t_lint_paramnodefault_bad.py +++ b/test_regress/t/t_lint_paramnodefault_bad.py @@ -12,9 +12,6 @@ import vltest_bootstrap test.scenarios('linter') test.top_filename = 't/t_lint_paramnodefault.v' -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.lint(fails=True, expect_filename=test.golden_filename) test.extract(in_filename=test.top_filename, diff --git a/test_regress/t/t_lint_pinmissing_bad.py b/test_regress/t/t_lint_pinmissing_bad.py index b02a8247f..83b37efab 100755 --- a/test_regress/t/t_lint_pinmissing_bad.py +++ b/test_regress/t/t_lint_pinmissing_bad.py @@ -11,9 +11,6 @@ import vltest_bootstrap test.scenarios('linter') -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.lint(fails=True, expect_filename=test.golden_filename) test.extract(in_filename=test.top_filename, diff --git a/test_regress/t/t_lint_procassinit_bad.py b/test_regress/t/t_lint_procassinit_bad.py index cb0745ee1..c95232256 100755 --- a/test_regress/t/t_lint_procassinit_bad.py +++ b/test_regress/t/t_lint_procassinit_bad.py @@ -11,9 +11,6 @@ import vltest_bootstrap test.scenarios('vlt') -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.lint(verilator_flags2=['-Wall -Wno-DECLFILENAME'], fails=True, expect_filename=test.golden_filename) diff --git a/test_regress/t/t_lint_stmtdly_bad.py b/test_regress/t/t_lint_stmtdly_bad.py index b7752cc94..35944aa6d 100755 --- a/test_regress/t/t_lint_stmtdly_bad.py +++ b/test_regress/t/t_lint_stmtdly_bad.py @@ -11,9 +11,6 @@ import vltest_bootstrap test.scenarios('vlt') -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.lint(verilator_flags2=["--no-timing"], fails=True, expect_filename=test.golden_filename) test.extract(in_filename=test.top_filename, diff --git a/test_regress/t/t_lint_widthexpand_docs_bad.py b/test_regress/t/t_lint_widthexpand_docs_bad.py index f9013b153..4e7afe03b 100755 --- a/test_regress/t/t_lint_widthexpand_docs_bad.py +++ b/test_regress/t/t_lint_widthexpand_docs_bad.py @@ -11,9 +11,6 @@ import vltest_bootstrap test.scenarios('linter') -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.lint(verilator_flags2=["--lint-only"], fails=test.vlt_all, expect_filename=test.golden_filename) diff --git a/test_regress/t/t_param_hier_bad.py b/test_regress/t/t_param_hier_bad.py index d77bef2fb..14ad3403f 100755 --- a/test_regress/t/t_param_hier_bad.py +++ b/test_regress/t/t_param_hier_bad.py @@ -11,9 +11,6 @@ import vltest_bootstrap test.scenarios('linter') -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.lint(fails=True, expect_filename=test.golden_filename) test.extract(in_filename=test.top_filename, diff --git a/test_regress/t/t_var_bad_hide_docs.py b/test_regress/t/t_var_bad_hide_docs.py index 470ff9c36..25caf8912 100755 --- a/test_regress/t/t_var_bad_hide_docs.py +++ b/test_regress/t/t_var_bad_hide_docs.py @@ -11,9 +11,6 @@ import vltest_bootstrap test.scenarios('linter') -if not os.path.exists(test.root + "/.git"): - test.skip("Not in a git repository") - test.lint(verilator_flags2=["--lint-only -Wwarn-VARHIDDEN"], fails=test.vlt_all, expect_filename=test.golden_filename)