| # Copyright 2020 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//testing/libfuzzer/fuzzer_test.gni") |
| import("//testing/test.gni") |
| |
| config("zxcvbn_config") { |
| include_dirs = [ "//third_party/zxcvbn-cpp/native-src" ] |
| |
| cflags = [ "-Wno-shadow" ] |
| } |
| |
| source_set("zxcvbn-cpp") { |
| sources = [ |
| "native-src/zxcvbn/adjacency_graphs.cpp", |
| "native-src/zxcvbn/adjacency_graphs.hpp", |
| "native-src/zxcvbn/common.hpp", |
| "native-src/zxcvbn/frequency_lists.cpp", |
| "native-src/zxcvbn/frequency_lists.hpp", |
| "native-src/zxcvbn/matching.cpp", |
| "native-src/zxcvbn/matching.hpp", |
| "native-src/zxcvbn/optional.hpp", |
| "native-src/zxcvbn/scoring.cpp", |
| "native-src/zxcvbn/scoring.hpp", |
| "native-src/zxcvbn/time_estimates.cpp", |
| "native-src/zxcvbn/time_estimates.hpp", |
| "native-src/zxcvbn/util.cpp", |
| "native-src/zxcvbn/util.hpp", |
| ] |
| |
| public_deps = [ |
| "//base", |
| "//third_party/icu", |
| ] |
| |
| public_configs = [ ":zxcvbn_config" ] |
| } |
| |
| test("zxcvbn_unittests") { |
| sources = [ |
| "test/matching_unittest.cc", |
| "test/scoring_unittest.cc", |
| ] |
| |
| deps = [ |
| ":zxcvbn-cpp", |
| "//testing/gmock", |
| "//testing/gtest", |
| "//testing/gtest:gtest_main", |
| ] |
| } |
| |
| fuzzer_test("zxcvbn_matching_fuzzer") { |
| sources = [ "test/matching_fuzzer.cc" ] |
| deps = [ ":zxcvbn-cpp" ] |
| libfuzzer_options = [ "max_len=128" ] |
| } |
| |
| fuzzer_test("zxcvbn_scoring_fuzzer") { |
| sources = [ "test/scoring_fuzzer.cc" ] |
| deps = [ ":zxcvbn-cpp" ] |
| libfuzzer_options = [ "max_len=128" ] |
| } |