blob: f32c530a5e38940a62a23a4aee5029694d72c2d2 [file] [log] [blame]
# Copyright 2020 The Chromium Authors
# 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_internal_config") {
cflags = [
"-Wno-shadow",
# TODO(crbug.com/1344570) Remove once zxcvbn no longer uses
# std::wstring_convert.
"-Wno-deprecated-declarations",
]
}
config("zxcvbn_public_config") {
include_dirs = [ "//third_party/zxcvbn-cpp/native-src" ]
}
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",
]
deps = [
"//base",
"//third_party/icu",
]
public_configs = [ ":zxcvbn_public_config" ]
configs += [ ":zxcvbn_internal_config" ]
}
test("zxcvbn_unittests") {
sources = [
"test/matching_unittest.cc",
"test/scoring_unittest.cc",
]
deps = [
":zxcvbn-cpp",
"//testing/gmock",
"//testing/gtest",
"//testing/gtest:gtest_main",
]
configs += [ ":zxcvbn_internal_config" ]
}
fuzzer_test("zxcvbn_matching_fuzzer") {
sources = [ "test/matching_fuzzer.cc" ]
deps = [
":zxcvbn-cpp",
"//base",
]
libfuzzer_options = [ "max_len=128" ]
}
fuzzer_test("zxcvbn_scoring_fuzzer") {
sources = [ "test/scoring_fuzzer.cc" ]
deps = [
":zxcvbn-cpp",
"//base",
]
libfuzzer_options = [ "max_len=128" ]
}