BUILD.gn 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Copyright 2015 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. #
  5. # Fuzzing Infrastructure Tests
  6. import("//testing/libfuzzer/fuzzer_test.gni")
  7. import("//testing/test.gni")
  8. # TODO(crbug.com/906751): Get the tests working on Windows. Disable them for now
  9. # because they cause the Windows clang ToT builder to fail.
  10. if (!is_win) {
  11. test("libfuzzer_tests") {
  12. sources = [ "fuzzer_launcher_test.cc" ]
  13. deps = [
  14. ":test_config_and_dict",
  15. ":test_config_and_seed_corpus",
  16. ":test_config_and_seed_corpuses",
  17. ":test_config_only",
  18. ":test_dict_from_subdir",
  19. ":test_dict_only",
  20. "//base",
  21. "//testing/gmock",
  22. "//testing/gtest",
  23. "//testing/gtest:gtest_main",
  24. ]
  25. data_deps = [
  26. ":check_fuzzer_config",
  27. ":check_seed_corpus_archive",
  28. ]
  29. }
  30. }
  31. fuzzer_test("test_dict_only") {
  32. sources = [ "../fuzzers/empty_fuzzer.cc" ]
  33. dict = "test.dict"
  34. additional_configs = [ "//testing/libfuzzer:no_clusterfuzz" ]
  35. }
  36. fuzzer_test("test_config_only") {
  37. sources = [ "../fuzzers/empty_fuzzer.cc" ]
  38. libfuzzer_options = [
  39. "some_test_option=test_value",
  40. "max_len=1024",
  41. ]
  42. additional_configs = [ "//testing/libfuzzer:no_clusterfuzz" ]
  43. }
  44. fuzzer_test("test_config_and_dict") {
  45. sources = [ "../fuzzers/empty_fuzzer.cc" ]
  46. dict = "test.dict"
  47. libfuzzer_options = [
  48. "max_len=random(1337, 31337)",
  49. "timeout = 666",
  50. "use_traces=1",
  51. ]
  52. additional_configs = [ "//testing/libfuzzer:no_clusterfuzz" ]
  53. }
  54. fuzzer_test("test_config_and_seed_corpus") {
  55. sources = [ "../fuzzers/empty_fuzzer.cc" ]
  56. seed_corpus = "test_corpus"
  57. libfuzzer_options = [
  58. "some_test_option=test_value",
  59. "max_len=1024",
  60. ]
  61. additional_configs = [ "//testing/libfuzzer:no_clusterfuzz" ]
  62. }
  63. fuzzer_test("test_config_and_seed_corpuses") {
  64. sources = [ "../fuzzers/empty_fuzzer.cc" ]
  65. seed_corpuses = [
  66. "test_corpus",
  67. "test_corpus_2",
  68. ]
  69. libfuzzer_options = [
  70. "some_test_option=another_test_value",
  71. "max_len=1337",
  72. ]
  73. additional_configs = [ "//testing/libfuzzer:no_clusterfuzz" ]
  74. }
  75. fuzzer_test("test_dict_from_subdir") {
  76. sources = [ "../fuzzers/empty_fuzzer.cc" ]
  77. dict = "dicts_subdir/test_subdir.dict"
  78. additional_configs = [ "//testing/libfuzzer:no_clusterfuzz" ]
  79. }
  80. copy("check_fuzzer_config") {
  81. sources = [ "check_fuzzer_config.py" ]
  82. outputs = [ "$root_build_dir/check_fuzzer_config.py" ]
  83. }
  84. copy("check_seed_corpus_archive") {
  85. sources = [ "check_seed_corpus_archive.py" ]
  86. outputs = [ "$root_build_dir/check_seed_corpus_archive.py" ]
  87. }