(self)
| 623 | return num_fuzzer.NumFuzzer |
| 624 | |
| 625 | def testNumFuzzer(self): |
| 626 | fuzz_flags = [ |
| 627 | f'{flag}=1' for flag in self.get_runner_options() |
| 628 | if (flag.startswith('--stress-') or |
| 629 | flag.startswith('--allocation') or |
| 630 | flag.startswith('--scavenge')) |
| 631 | ] |
| 632 | self.assertEqual(len(fuzz_flags), len(fuzzer.FUZZERS)) |
| 633 | for fuzz_flag in fuzz_flags: |
| 634 | # The fake timeout observer above will stop after proessing the 10th |
| 635 | # test. This still executes an 11th. Each test causes a test- and a |
| 636 | # result event internally. We test both paths here. |
| 637 | for event_count in (19, 20): |
| 638 | with self.subTest(f'fuzz_flag={fuzz_flag} event_count={event_count}'): |
| 639 | with patch( |
| 640 | 'testrunner.testproc.timeout.TimeoutProc.create', |
| 641 | lambda x: FakeTimeoutProc(event_count)): |
| 642 | result = self.run_tests( |
| 643 | '--command-prefix', sys.executable, |
| 644 | '--outdir', 'out/build', |
| 645 | '--variants=default', |
| 646 | '--fuzzer-random-seed=12345', |
| 647 | '--total-timeout-sec=60', |
| 648 | fuzz_flag, |
| 649 | '--progress=verbose', |
| 650 | 'sweet/bananas', |
| 651 | ) |
| 652 | result.has_returncode(0) |
| 653 | result.stdout_includes('>>> Statusfile variables:') |
| 654 | result.stdout_includes('11 tests ran') |
| 655 | |
| 656 | def _run_test_with_random_skip(self, prob): |
| 657 | """Run a test root that marks sweet/apples as RARE and pass a probability |
nothing calls this directly
no test coverage detected