From 81dbc52c446680469a5e00e4e26b091bfc266a59 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 20 Nov 2024 08:23:14 -0800 Subject: Fuzzer: Legalize and prune the JS interface in pickPasses (#7092) Also add a test that the ClusterFuzz run.py does not warn, which was helpful when debugging this. --- test/unit/test_cluster_fuzz.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/unit/test_cluster_fuzz.py') diff --git a/test/unit/test_cluster_fuzz.py b/test/unit/test_cluster_fuzz.py index 293cfa339..1d275c712 100644 --- a/test/unit/test_cluster_fuzz.py +++ b/test/unit/test_cluster_fuzz.py @@ -97,6 +97,18 @@ class ClusterFuzz(utils.BinaryenTestCase): self.assertTrue(not os.path.exists(fuzz_file)) self.assertTrue(not os.path.exists(flags_file)) + # Run.py should report no errors or warnings to stderr, except from + # those we know are safe. + SAFE_WARNINGS = [ + # When we randomly pick no passes to run, this is shown. + 'warning: no passes specified, not doing any work', + ] + stderr = proc.stderr + for safe in SAFE_WARNINGS: + stderr = stderr.replace(safe, '') + stderr = stderr.strip() + self.assertEqual(stderr, '') + def test_fuzz_passes(self): # We should see interesting passes being run in run.py. This is *NOT* a # deterministic test, since the number of passes run is random (we just -- cgit v1.2.3