def test_libfuzzer_coverage_build(self): """Tests that should_build returns True for coverage build of a project specifying 'libfuzzer' and for fuzzing_engines.""" _set_coverage_build() project_yaml = { 'language': 'c++', 'fuzzing_engines': ['libfuzzer'], 'sanitizers': ['address'] } self.assertTrue(build.should_build(project_yaml))
def test_none_engine_coverage_build(self): """Tests that should_build returns False for a coverage build of a project that specifies 'none' for fuzzing_engines.""" _set_coverage_build() project_yaml = { 'language': 'c++', 'fuzzing_engines': ['none'], 'sanitizers': ['address'] } self.assertFalse(build.should_build(project_yaml))
def test_engine_project_none_build(self): """Tests that should_build returns False for an engine: 'none' build when the project doesn't specify engines.""" os.environ['SANITIZER'] = 'address' os.environ['ENGINE'] = 'none' os.environ['ARCHITECTURE'] = 'x86_64' project_yaml = { 'language': 'c++', 'fuzzing_engines': ['libfuzzer'], 'sanitizers': ['address'] } self.assertFalse(build.should_build(project_yaml))
def test_go_coverage_build(self): """Tests that should_build returns True for coverage build of a project specifying 'libfuzzer' and for fuzzing_engines.""" _set_coverage_build() project_yaml = {'language': 'go'} self.assertTrue(build.should_build(project_yaml))
def test_unspecified_engines_coverage_build(self): """Tests that should_build returns True for a coverage build of a project that doesn't specify fuzzing_engines.""" _set_coverage_build() project_yaml = {'language': 'c++'} self.assertTrue(build.should_build(project_yaml))