[go: nahoru, domu]

tree: f807a35336c28c84620751d277d429b1c2772a0e [path history] [tgz]
  1. fuzz_corpus/
  2. proto/
  3. test/
  4. BUILD.gn
  5. cast_auth_util.cc
  6. cast_auth_util.h
  7. cast_auth_util_fuzzer.cc
  8. cast_auth_util_unittest.cc
  9. cast_channel_enum.cc
  10. cast_channel_enum.h
  11. cast_framer.cc
  12. cast_framer.h
  13. cast_framer_ingest_fuzzer.cc
  14. cast_framer_serialize_fuzzer.cc
  15. cast_framer_unittest.cc
  16. cast_message_handler.cc
  17. cast_message_handler.h
  18. cast_message_handler_unittest.cc
  19. cast_message_util.cc
  20. cast_message_util.h
  21. cast_message_util_fuzzer.cc
  22. cast_message_util_unittest.cc
  23. cast_socket.cc
  24. cast_socket.h
  25. cast_socket_service.cc
  26. cast_socket_service.h
  27. cast_socket_service_unittest.cc
  28. cast_socket_unittest.cc
  29. cast_test_util.cc
  30. cast_test_util.h
  31. cast_transport.cc
  32. cast_transport.h
  33. cast_transport_unittest.cc
  34. DEPS
  35. DIR_METADATA
  36. enum_table.cc
  37. enum_table.h
  38. enum_table_unittest.cc
  39. fuzz.dict
  40. keep_alive_delegate.cc
  41. keep_alive_delegate.h
  42. keep_alive_delegate_unittest.cc
  43. keep_alive_handler.cc
  44. keep_alive_handler.h
  45. logger.cc
  46. logger.h
  47. logger_unittest.cc
  48. mojo_data_pump.cc
  49. mojo_data_pump.h
  50. OWNERS
  51. README.md
components/cast_channel/README.md

How to Run a Fuzz Test

Create an appropriate build config:

% tools/mb/mb.py gen -m chromium.fuzz -b 'Libfuzzer Upload Linux ASan' out/libfuzzer
% gn gen out/libfuzzer

Build the fuzz target:

% ninja -C out/libfuzzer $TEST_NAME

Create an empty corpus directory if you don't have one already.

% mkdir ${TEST_NAME}_corpus

Turning off detection of ODR violations that occur in component builds:

% export ASAN_OPTIONS=detect_odr_violation=0

If the test has a seed corpus:

% ./out/libfuzzer/$TEST_NAME ${TEST_NAME}_corpus out/libfuzzer/gen/components/cast_channel/${TEST_NAME}_corpus

If the test has no seed corpus, omit the last parameter:

% ./out/libfuzzer/$TEST_NAME ${TEST_NAME}_corpus

For more details, refer to https://chromium.googlesource.com/chromium/src/testing/libfuzzer/+/refs/heads/master/getting_started.md