Coverage for /pythoncovmergedfiles/medio/medio/src/onnx/onnx/fuzz/fuzz_parser.py: 36%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

25 statements  

1###### Coverage stub 

2import atexit 

3import coverage 

4cov = coverage.coverage(data_file='.coverage', cover_pylib=True) 

5cov.start() 

6# Register an exist handler that will print coverage 

7def exit_handler(): 

8 cov.stop() 

9 cov.save() 

10atexit.register(exit_handler) 

11####### End of coverage stub 

12# Copyright (c) ONNX Project Contributors 

13# SPDX-License-Identifier: Apache-2.0 

14 

15import sys 

16 

17import atheris 

18 

19with atheris.instrument_imports(): 

20 from onnx import parser 

21 

22 

23def TestOneInput(data): 

24 try: 

25 text = data.decode("utf-8", "surrogatepass") 

26 parser.parse_model(text) 

27 except Exception: 

28 return 

29 

30 

31def main(): 

32 atheris.instrument_all() 

33 atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True) 

34 atheris.Fuzz() 

35 

36 

37if __name__ == "__main__": 

38 main()