BUILD.gn 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Copyright 2020 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. import("//testing/libfuzzer/fuzzer_test.gni")
  5. import("//testing/test.gni")
  6. config("zxcvbn_internal_config") {
  7. cflags = [
  8. "-Wno-shadow",
  9. # TODO(crbug.com/1344570) Remove once zxcvbn no longer uses
  10. # std::wstring_convert.
  11. "-Wno-deprecated-declarations",
  12. ]
  13. }
  14. config("zxcvbn_public_config") {
  15. include_dirs = [ "//third_party/zxcvbn-cpp/native-src" ]
  16. }
  17. source_set("zxcvbn-cpp") {
  18. sources = [
  19. "native-src/zxcvbn/adjacency_graphs.cpp",
  20. "native-src/zxcvbn/adjacency_graphs.hpp",
  21. "native-src/zxcvbn/common.hpp",
  22. "native-src/zxcvbn/frequency_lists.cpp",
  23. "native-src/zxcvbn/frequency_lists.hpp",
  24. "native-src/zxcvbn/matching.cpp",
  25. "native-src/zxcvbn/matching.hpp",
  26. "native-src/zxcvbn/optional.hpp",
  27. "native-src/zxcvbn/scoring.cpp",
  28. "native-src/zxcvbn/scoring.hpp",
  29. "native-src/zxcvbn/time_estimates.cpp",
  30. "native-src/zxcvbn/time_estimates.hpp",
  31. "native-src/zxcvbn/util.cpp",
  32. "native-src/zxcvbn/util.hpp",
  33. ]
  34. deps = [
  35. "//base",
  36. "//third_party/icu",
  37. ]
  38. public_configs = [ ":zxcvbn_public_config" ]
  39. configs += [ ":zxcvbn_internal_config" ]
  40. }
  41. test("zxcvbn_unittests") {
  42. sources = [
  43. "test/matching_unittest.cc",
  44. "test/scoring_unittest.cc",
  45. ]
  46. deps = [
  47. ":zxcvbn-cpp",
  48. "//testing/gmock",
  49. "//testing/gtest",
  50. "//testing/gtest:gtest_main",
  51. ]
  52. configs += [ ":zxcvbn_internal_config" ]
  53. }
  54. fuzzer_test("zxcvbn_matching_fuzzer") {
  55. sources = [ "test/matching_fuzzer.cc" ]
  56. deps = [
  57. ":zxcvbn-cpp",
  58. "//base",
  59. ]
  60. libfuzzer_options = [ "max_len=128" ]
  61. }
  62. fuzzer_test("zxcvbn_scoring_fuzzer") {
  63. sources = [ "test/scoring_fuzzer.cc" ]
  64. deps = [
  65. ":zxcvbn-cpp",
  66. "//base",
  67. ]
  68. libfuzzer_options = [ "max_len=128" ]
  69. }