Skip to content

Commit b8d9e91

Browse files
committed
Add a testcase for #795
1 parent 5d4fc21 commit b8d9e91

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

vunit/vhdl/run/test/run_tests.vhd

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,27 @@ begin
467467

468468
test_case_cleanup;
469469

470+
---------------------------------------------------------------------------
471+
banner("Should prevent from running a test from enabled_test_case more than once unless re-initialized.");
472+
test_case_setup;
473+
test_runner_setup(runner, "enabled_test_cases : Should one");
474+
for i in 0 to 1 loop
475+
case i is
476+
when 0 =>
477+
check(c, run("Should one"), "Expected ""Should one"" to run.");
478+
when others =>
479+
check_false(c, run("Should one"), "Didn't expected ""Should one"" to run.");
480+
end case;
481+
end loop;
482+
check_false(c, run("Should one"), "Didn't expect ""Should one"" to run.");
483+
test_runner_setup(runner, "enabled_test_cases : Should one");
484+
while test_suite loop
485+
check(c, run("Should one"), "Expected ""Should one"" to run.");
486+
exit;
487+
end loop;
488+
489+
test_case_cleanup;
490+
470491
---------------------------------------------------------------------------
471492
--banner("Should be possible to exit a test case or test suite with an error message that can be caught afterwards.");
472493
--test_case_setup;

0 commit comments

Comments
 (0)