63ee2f8877
-- 7f6c15aadc4d97e217dd446518dbb4fdc86b36a3 by Derek Mauro <dmauro@google.com>: Upgrade GCC automated testing to use GCC 9.2 and Cmake 3.16.2 PiperOrigin-RevId: 288488783 -- a978cee848d3cf65b0826c981bfd81022fc36660 by Abseil Team <absl-team@google.com>: Removing formatting traits that were only used internally. ON_CALL/EXPECT_CALL do a sufficient job here. PiperOrigin-RevId: 288386509 -- fdec6f40293d5883220f1f0ea1261f7c5b60a66e by Derek Mauro <dmauro@google.com>: Upgrade MacOS tests to use Bazel 2.0.0 PiperOrigin-RevId: 288373298 -- 465865c4123e9481ab50ea0527e92b39519704dd by Derek Mauro <dmauro@google.com>: Changes to support GCC 9 * Fix several -Wredundant-move warnings * Remove FlatHashMap.Any test, which basically doesn't work on any platform any more (see https://cplusplus.github.io/LWG/lwg-active.html#3121) * Fix a constant sign-compare warning * Conditionally compile out the PoisonHash test which doesn't build PiperOrigin-RevId: 288360204 -- 57c4bb07fc58e7dd2a04f3c45027aab5ecaccf25 by Andy Soffer <asoffer@google.com>: Deflaking MockingBitGen test. Because MockingBitGen can return random values, it is inherently flaky. For log-unifrom, 2040 is a common enough value that tests failed unreasonably frequently. Replacing it with a significantly larger value so as to be much less common. 50000 is a good choice because it is (tied for) the least likely to occur randomly from this distribution, but is still in the distribution. PiperOrigin-RevId: 288360112 -- 86f38e4109899d972de353b1c556c018cfe37956 by Matt Calabrese <calabrese@google.com>: Remove construction tests for the internal `CompressedTuple<std::any>` instantiation. This was not guaranteed to work for the reasons that `std::tuple<std::any>` copy construction does not actually work by standard specification (some implementations introduce workarounds for this). In GCC9, `CompressedTuple<std::any>` and `std::tuple<std::any>` both fail for the same reasons, and a proper "fix" requires updating `std::any`, which is out of our control. PiperOrigin-RevId: 288351977 GitOrigin-RevId: 7f6c15aadc4d97e217dd446518dbb4fdc86b36a3 Change-Id: I5d5c62bd297dc0ff1f2970ff076bb5cd088a7e4c
735 lines
16 KiB
Text
735 lines
16 KiB
Text
#
|
|
# Copyright 2019 The Abseil Authors.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
|
|
|
# Internal-only implementation classes for Abseil Random
|
|
load(
|
|
"//absl:copts/configure_copts.bzl",
|
|
"ABSL_DEFAULT_COPTS",
|
|
"ABSL_DEFAULT_LINKOPTS",
|
|
"ABSL_RANDOM_RANDEN_COPTS",
|
|
"ABSL_TEST_COPTS",
|
|
"absl_random_randen_copts_init",
|
|
)
|
|
|
|
package(default_visibility = [
|
|
"//absl/random:__pkg__",
|
|
])
|
|
|
|
licenses(["notice"]) # Apache 2.0
|
|
|
|
cc_library(
|
|
name = "traits",
|
|
hdrs = ["traits.h"],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
visibility = [
|
|
"//absl/random:__pkg__",
|
|
],
|
|
deps = ["//absl/base:config"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "distribution_caller",
|
|
hdrs = ["distribution_caller.h"],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
visibility = [
|
|
"//absl/random:__pkg__",
|
|
],
|
|
deps = ["//absl/base:config"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "distributions",
|
|
hdrs = ["distributions.h"],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":distribution_caller",
|
|
":traits",
|
|
":uniform_helper",
|
|
"//absl/base",
|
|
"//absl/meta:type_traits",
|
|
"//absl/strings",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "fast_uniform_bits",
|
|
hdrs = [
|
|
"fast_uniform_bits.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
visibility = [
|
|
"//absl/random:__pkg__",
|
|
],
|
|
deps = ["//absl/base:config"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "seed_material",
|
|
srcs = [
|
|
"seed_material.cc",
|
|
],
|
|
hdrs = [
|
|
"seed_material.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS + select({
|
|
"//absl:windows": ["-DEFAULTLIB:bcrypt.lib"],
|
|
"//conditions:default": [],
|
|
}),
|
|
deps = [
|
|
":fast_uniform_bits",
|
|
"//absl/base:core_headers",
|
|
"//absl/base:raw_logging_internal",
|
|
"//absl/strings",
|
|
"//absl/types:optional",
|
|
"//absl/types:span",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "pool_urbg",
|
|
srcs = [
|
|
"pool_urbg.cc",
|
|
],
|
|
hdrs = [
|
|
"pool_urbg.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = select({
|
|
"//absl:windows": [],
|
|
"//conditions:default": ["-pthread"],
|
|
}) + ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":randen",
|
|
":seed_material",
|
|
":traits",
|
|
"//absl/base",
|
|
"//absl/base:config",
|
|
"//absl/base:core_headers",
|
|
"//absl/base:endian",
|
|
"//absl/base:raw_logging_internal",
|
|
"//absl/random:seed_gen_exception",
|
|
"//absl/types:span",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "explicit_seed_seq",
|
|
testonly = 1,
|
|
hdrs = [
|
|
"explicit_seed_seq.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = ["//absl/base:config"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "sequence_urbg",
|
|
testonly = 1,
|
|
hdrs = [
|
|
"sequence_urbg.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = ["//absl/base:config"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "salted_seed_seq",
|
|
hdrs = [
|
|
"salted_seed_seq.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":seed_material",
|
|
"//absl/container:inlined_vector",
|
|
"//absl/meta:type_traits",
|
|
"//absl/types:optional",
|
|
"//absl/types:span",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "iostream_state_saver",
|
|
hdrs = ["iostream_state_saver.h"],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
"//absl/meta:type_traits",
|
|
"//absl/numeric:int128",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "generate_real",
|
|
hdrs = [
|
|
"generate_real.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":fastmath",
|
|
":traits",
|
|
"//absl/base:bits",
|
|
"//absl/meta:type_traits",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "fastmath",
|
|
hdrs = [
|
|
"fastmath.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = ["//absl/base:bits"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "wide_multiply",
|
|
hdrs = ["wide_multiply.h"],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":traits",
|
|
"//absl/base:bits",
|
|
"//absl/base:config",
|
|
"//absl/numeric:int128",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "nonsecure_base",
|
|
hdrs = ["nonsecure_base.h"],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":pool_urbg",
|
|
":salted_seed_seq",
|
|
":seed_material",
|
|
"//absl/base:core_headers",
|
|
"//absl/meta:type_traits",
|
|
"//absl/strings",
|
|
"//absl/types:optional",
|
|
"//absl/types:span",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "pcg_engine",
|
|
hdrs = ["pcg_engine.h"],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":fastmath",
|
|
":iostream_state_saver",
|
|
"//absl/base:config",
|
|
"//absl/meta:type_traits",
|
|
"//absl/numeric:int128",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "randen_engine",
|
|
hdrs = ["randen_engine.h"],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":iostream_state_saver",
|
|
":randen",
|
|
"//absl/meta:type_traits",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "platform",
|
|
hdrs = [
|
|
"randen_traits.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
textual_hdrs = [
|
|
"randen-keys.inc",
|
|
"platform.h",
|
|
],
|
|
deps = ["//absl/base:config"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "randen",
|
|
srcs = [
|
|
"randen.cc",
|
|
],
|
|
hdrs = [
|
|
"randen.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":platform",
|
|
":randen_hwaes",
|
|
":randen_slow",
|
|
"//absl/base:raw_logging_internal",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "randen_slow",
|
|
srcs = ["randen_slow.cc"],
|
|
hdrs = ["randen_slow.h"],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":platform",
|
|
"//absl/base:config",
|
|
"//absl/base:core_headers",
|
|
],
|
|
)
|
|
|
|
absl_random_randen_copts_init()
|
|
|
|
cc_library(
|
|
name = "randen_hwaes",
|
|
srcs = [
|
|
"randen_detect.cc",
|
|
],
|
|
hdrs = [
|
|
"randen_detect.h",
|
|
"randen_hwaes.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":platform",
|
|
":randen_hwaes_impl",
|
|
"//absl/base:config",
|
|
],
|
|
)
|
|
|
|
# build with --save_temps to see assembly language output.
|
|
cc_library(
|
|
name = "randen_hwaes_impl",
|
|
srcs = [
|
|
"randen_hwaes.cc",
|
|
"randen_hwaes.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS + ABSL_RANDOM_RANDEN_COPTS + select({
|
|
"//absl:windows": [],
|
|
"//conditions:default": ["-Wno-pass-failed"],
|
|
}),
|
|
# copts in RANDEN_HWAES_COPTS can make this target unusable as a module
|
|
# leading to a Clang diagnostic. Furthermore, it only has a private header
|
|
# anyway and thus there wouldn't be any gain from using it as a module.
|
|
features = ["-header_modules"],
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":platform",
|
|
"//absl/base:config",
|
|
"//absl/base:core_headers",
|
|
],
|
|
)
|
|
|
|
cc_binary(
|
|
name = "gaussian_distribution_gentables",
|
|
srcs = [
|
|
"gaussian_distribution_gentables.cc",
|
|
],
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
"//absl/base:core_headers",
|
|
"//absl/random:distributions",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "distribution_test_util",
|
|
testonly = 1,
|
|
srcs = [
|
|
"chi_square.cc",
|
|
"distribution_test_util.cc",
|
|
],
|
|
hdrs = [
|
|
"chi_square.h",
|
|
"distribution_test_util.h",
|
|
],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
"//absl/base:config",
|
|
"//absl/base:core_headers",
|
|
"//absl/base:raw_logging_internal",
|
|
"//absl/strings",
|
|
"//absl/strings:str_format",
|
|
"//absl/types:span",
|
|
],
|
|
)
|
|
|
|
# Common tags for tests, etc.
|
|
ABSL_RANDOM_NONPORTABLE_TAGS = [
|
|
"no_test_android_arm",
|
|
"no_test_android_arm64",
|
|
"no_test_android_x86",
|
|
"no_test_darwin_x86_64",
|
|
"no_test_ios_x86_64",
|
|
"no_test_loonix",
|
|
"no_test_msvc_x64",
|
|
"no_test_wasm",
|
|
]
|
|
|
|
cc_test(
|
|
name = "traits_test",
|
|
size = "small",
|
|
srcs = ["traits_test.cc"],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":traits",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "generate_real_test",
|
|
size = "small",
|
|
srcs = [
|
|
"generate_real_test.cc",
|
|
],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":generate_real",
|
|
"//absl/base:bits",
|
|
"//absl/flags:flag",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "distribution_test_util_test",
|
|
size = "small",
|
|
srcs = ["distribution_test_util_test.cc"],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":distribution_test_util",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "fastmath_test",
|
|
size = "small",
|
|
srcs = ["fastmath_test.cc"],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":fastmath",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "explicit_seed_seq_test",
|
|
size = "small",
|
|
srcs = ["explicit_seed_seq_test.cc"],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":explicit_seed_seq",
|
|
"//absl/random:seed_sequences",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "salted_seed_seq_test",
|
|
size = "small",
|
|
srcs = ["salted_seed_seq_test.cc"],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":salted_seed_seq",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "chi_square_test",
|
|
size = "small",
|
|
srcs = [
|
|
"chi_square_test.cc",
|
|
],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":distribution_test_util",
|
|
"//absl/base:core_headers",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "fast_uniform_bits_test",
|
|
size = "small",
|
|
srcs = [
|
|
"fast_uniform_bits_test.cc",
|
|
],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":fast_uniform_bits",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "mocking_bit_gen_base",
|
|
hdrs = ["mocking_bit_gen_base.h"],
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
"//absl/random",
|
|
"//absl/strings",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "mock_overload_set",
|
|
testonly = 1,
|
|
hdrs = ["mock_overload_set.h"],
|
|
visibility = [
|
|
"//absl/random:__pkg__",
|
|
],
|
|
deps = [
|
|
"//absl/random:mocking_bit_gen",
|
|
"@com_google_googletest//:gtest",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "nonsecure_base_test",
|
|
size = "small",
|
|
srcs = [
|
|
"nonsecure_base_test.cc",
|
|
],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":nonsecure_base",
|
|
"//absl/random",
|
|
"//absl/random:distributions",
|
|
"//absl/random:seed_sequences",
|
|
"//absl/strings",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "seed_material_test",
|
|
size = "small",
|
|
srcs = ["seed_material_test.cc"],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":seed_material",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "pool_urbg_test",
|
|
size = "small",
|
|
srcs = [
|
|
"pool_urbg_test.cc",
|
|
],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":pool_urbg",
|
|
"//absl/meta:type_traits",
|
|
"//absl/types:span",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "pcg_engine_test",
|
|
size = "medium", # Trying to measure accuracy.
|
|
srcs = ["pcg_engine_test.cc"],
|
|
copts = ABSL_TEST_COPTS,
|
|
flaky = 1,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":explicit_seed_seq",
|
|
":pcg_engine",
|
|
"//absl/time",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "randen_engine_test",
|
|
size = "medium",
|
|
srcs = [
|
|
"randen_engine_test.cc",
|
|
],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":explicit_seed_seq",
|
|
":randen_engine",
|
|
"//absl/base:raw_logging_internal",
|
|
"//absl/strings",
|
|
"//absl/time",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "randen_test",
|
|
size = "small",
|
|
srcs = ["randen_test.cc"],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":randen",
|
|
"//absl/meta:type_traits",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "randen_slow_test",
|
|
size = "small",
|
|
srcs = ["randen_slow_test.cc"],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":randen_slow",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "randen_hwaes_test",
|
|
size = "small",
|
|
srcs = ["randen_hwaes_test.cc"],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
tags = ABSL_RANDOM_NONPORTABLE_TAGS,
|
|
deps = [
|
|
":platform",
|
|
":randen_hwaes",
|
|
":randen_hwaes_impl", # build_cleaner: keep
|
|
"//absl/base:raw_logging_internal",
|
|
"//absl/strings:str_format",
|
|
"@com_google_googletest//:gtest",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "wide_multiply_test",
|
|
size = "small",
|
|
srcs = ["wide_multiply_test.cc"],
|
|
copts = ABSL_TEST_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":wide_multiply",
|
|
"//absl/base:bits",
|
|
"//absl/numeric:int128",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "nanobenchmark",
|
|
srcs = ["nanobenchmark.cc"],
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
textual_hdrs = ["nanobenchmark.h"],
|
|
deps = [
|
|
":platform",
|
|
":randen_engine",
|
|
"//absl/base:core_headers",
|
|
"//absl/base:raw_logging_internal",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "uniform_helper",
|
|
hdrs = ["uniform_helper.h"],
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
"//absl/meta:type_traits",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "nanobenchmark_test",
|
|
size = "small",
|
|
srcs = ["nanobenchmark_test.cc"],
|
|
flaky = 1,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
tags = [
|
|
"benchmark",
|
|
"no_test_ios_x86_64",
|
|
"no_test_loonix", # Crashing.
|
|
],
|
|
deps = [
|
|
":nanobenchmark",
|
|
"//absl/base:raw_logging_internal",
|
|
"//absl/strings",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "randen_benchmarks",
|
|
size = "medium",
|
|
srcs = ["randen_benchmarks.cc"],
|
|
copts = ABSL_TEST_COPTS + ABSL_RANDOM_RANDEN_COPTS,
|
|
flaky = 1,
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
tags = ABSL_RANDOM_NONPORTABLE_TAGS + ["benchmark"],
|
|
deps = [
|
|
":nanobenchmark",
|
|
":platform",
|
|
":randen",
|
|
":randen_engine",
|
|
":randen_hwaes",
|
|
":randen_hwaes_impl",
|
|
":randen_slow",
|
|
"//absl/base:raw_logging_internal",
|
|
"//absl/strings",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "iostream_state_saver_test",
|
|
size = "small",
|
|
srcs = ["iostream_state_saver_test.cc"],
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
deps = [
|
|
":iostream_state_saver",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|