BUILD.gn 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. # Copyright 2018 Google Inc. All rights reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. import("//testing/libfuzzer/fuzzer_test.gni")
  15. import("//testing/test.gni")
  16. config("fuzzer_config") {
  17. configs = [ "../..:spvtools_internal_config" ]
  18. }
  19. group("fuzzers") {
  20. testonly = true
  21. deps = []
  22. if (!build_with_chromium || use_fuzzing_engine) {
  23. deps += [ ":fuzzers_bin" ]
  24. }
  25. }
  26. if (!build_with_chromium || use_fuzzing_engine) {
  27. group("fuzzers_bin") {
  28. testonly = true
  29. deps = [
  30. ":spvtools_binary_parser_fuzzer",
  31. ":spvtools_opt_legalization_fuzzer",
  32. ":spvtools_opt_performance_fuzzer",
  33. ":spvtools_opt_size_fuzzer",
  34. ":spvtools_val_fuzzer",
  35. ]
  36. }
  37. }
  38. template("spvtools_fuzzer") {
  39. source_set(target_name) {
  40. testonly = true
  41. sources = invoker.sources
  42. deps = [
  43. "../..:spvtools",
  44. "../..:spvtools_opt",
  45. "../..:spvtools_val",
  46. ]
  47. if (defined(invoker.deps)) {
  48. deps += invoker.deps
  49. }
  50. configs -= [ "//build/config/compiler:chromium_code" ]
  51. configs += [
  52. "//build/config/compiler:no_chromium_code",
  53. ":fuzzer_config",
  54. ]
  55. }
  56. }
  57. spvtools_fuzzer("spvtools_binary_parser_fuzzer_src") {
  58. sources = [
  59. "spvtools_binary_parser_fuzzer.cpp",
  60. ]
  61. }
  62. spvtools_fuzzer("spvtools_opt_performance_fuzzer_src") {
  63. sources = [
  64. "spvtools_opt_performance_fuzzer.cpp",
  65. ]
  66. }
  67. spvtools_fuzzer("spvtools_opt_legalization_fuzzer_src") {
  68. sources = [
  69. "spvtools_opt_legalization_fuzzer.cpp",
  70. ]
  71. }
  72. spvtools_fuzzer("spvtools_opt_size_fuzzer_src") {
  73. sources = [
  74. "spvtools_opt_size_fuzzer.cpp",
  75. ]
  76. }
  77. spvtools_fuzzer("spvtools_val_fuzzer_src") {
  78. sources = [
  79. "spvtools_val_fuzzer.cpp",
  80. ]
  81. }
  82. if (!build_with_chromium || use_fuzzing_engine) {
  83. fuzzer_test("spvtools_binary_parser_fuzzer") {
  84. sources = []
  85. deps = [
  86. ":spvtools_binary_parser_fuzzer_src",
  87. ]
  88. # Intentionally doesn't use the seed corpus, because it consumes
  89. # part of the input as not part of the file.
  90. }
  91. fuzzer_test("spvtools_opt_performance_fuzzer") {
  92. sources = []
  93. deps = [
  94. ":spvtools_opt_performance_fuzzer_src",
  95. ]
  96. seed_corpus = "corpora/spv"
  97. }
  98. fuzzer_test("spvtools_opt_legalization_fuzzer") {
  99. sources = []
  100. deps = [
  101. ":spvtools_opt_legalization_fuzzer_src",
  102. ]
  103. seed_corpus = "corpora/spv"
  104. }
  105. fuzzer_test("spvtools_opt_size_fuzzer") {
  106. sources = []
  107. deps = [
  108. ":spvtools_opt_size_fuzzer_src",
  109. ]
  110. seed_corpus = "corpora/spv"
  111. }
  112. fuzzer_test("spvtools_val_fuzzer") {
  113. sources = []
  114. deps = [
  115. ":spvtools_val_fuzzer_src",
  116. ]
  117. seed_corpus = "corpora/spv"
  118. }
  119. }