blob: d0751c2d95a3e97f2cfdca2cc4decf8df9f1ab33 [file] [log] [blame]
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
visibility = [ "$cobalt_root/*" ]
import("//build/test.gni")
config("rappor_gn_config") {
# Use O3 level optimizations for building RAPPOR.
cflags = [ "-O3" ]
configs = [ "$cobalt_root:cobalt_config" ]
}
source_set("rappor_config") {
sources = [ "rappor_config.h" ]
deps = [
":strong_types",
"$cobalt_root/src:logging",
]
}
source_set("rappor_config_validator") {
sources = [
"rappor_config_validator.cc",
"rappor_config_validator.h",
]
deps = [
":rappor_config",
"$cobalt_root/src:logging",
]
public_deps = [
"$cobalt_root/src/pb",
"$cobalt_root/src/registry:cobalt_registry_proto",
"$cobalt_root/src/system_data:client_secret",
"$cobalt_root/src/system_data:client_secret",
]
configs += [ ":rappor_gn_config" ]
}
source_set("rappor_encoder") {
sources = [
"rappor_encoder.cc",
"rappor_encoder.h",
]
deps = [
":rappor_config_validator",
"$cobalt_root/src:logging",
"$cobalt_root/src:tracing",
"$cobalt_root/src/public/lib:status",
"$cobalt_root/src/system_data:client_secret",
]
public_deps = [
"$cobalt_root/src/lib/crypto_util",
"$cobalt_root/src/pb",
]
configs += [ ":rappor_gn_config" ]
}
source_set("strong_types") {
sources = [ "strong_types.h" ]
deps = [ "$cobalt_root/src/lib/util:named_type" ]
}
source_set("rappor_config_helper") {
sources = [
"rappor_config_helper.cc",
"rappor_config_helper.h",
]
public_deps = [ "$cobalt_root/src/registry:cobalt_registry_proto" ]
deps = [
":strong_types",
"$cobalt_root/src:logging",
]
configs += [ ":rappor_gn_config" ]
}
test("rappor_tests") {
sources = [
"rappor_config_helper_test.cc",
"rappor_encoder_test.cc",
"rappor_test_utils.cc",
"rappor_test_utils.h",
"rappor_test_utils_test.cc",
]
deps = [
":rappor_config",
":rappor_config_helper",
":rappor_encoder",
"$cobalt_root/src:logging",
"$cobalt_root/src/lib/crypto_util:random_test_utils",
"//third_party/gflags",
"//third_party/googletest:gtest",
]
if (is_fuchsia_tree) {
deps += [ "//src/lib/fxl/test:gtest_main" ]
} else {
deps += [ "//third_party/googletest:gtest_main" ]
}
configs += [ ":rappor_gn_config" ]
}
group("tests") {
testonly = true
deps = [ ":rappor_tests" ]
}