aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2023-06-08 13:56:44 +0300
committerthegeorg <thegeorg@yandex-team.com>2023-06-08 13:56:44 +0300
commit40479c2d3d1e9bd3eb213aba537570d28d37d8a2 (patch)
tree9a275dff7a8b4b20f6c7f33022a7ef800d7a4063 /library
parent74801b5fa21692b9fce51b8096694453568cbf8a (diff)
downloadydb-40479c2d3d1e9bd3eb213aba537570d28d37d8a2.tar.gz
Restrict direct usages of google benchmarking library
Forbid PEERDIR-ing Google Benchmark from modules other than G_BENCHMARK.
Diffstat (limited to 'library')
-rw-r--r--library/cpp/testing/CMakeLists.txt2
-rw-r--r--library/cpp/testing/gbenchmark/CMakeLists.darwin-x86_64.txt (renamed from library/cpp/testing/gbenchmark_main/CMakeLists.darwin-x86_64.txt)10
-rw-r--r--library/cpp/testing/gbenchmark/CMakeLists.linux-aarch64.txt (renamed from library/cpp/testing/gbenchmark_main/CMakeLists.linux-aarch64.txt)10
-rw-r--r--library/cpp/testing/gbenchmark/CMakeLists.linux-x86_64.txt (renamed from library/cpp/testing/gbenchmark_main/CMakeLists.linux-x86_64.txt)10
-rw-r--r--library/cpp/testing/gbenchmark/CMakeLists.txt (renamed from library/cpp/testing/gbenchmark_main/CMakeLists.txt)0
-rw-r--r--library/cpp/testing/gbenchmark/CMakeLists.windows-x86_64.txt (renamed from library/cpp/testing/gbenchmark_main/CMakeLists.windows-x86_64.txt)10
-rw-r--r--library/cpp/testing/gbenchmark/benchmark.h3
-rw-r--r--library/cpp/testing/gbenchmark/main.cpp (renamed from library/cpp/testing/gbenchmark_main/main.cpp)0
8 files changed, 24 insertions, 21 deletions
diff --git a/library/cpp/testing/CMakeLists.txt b/library/cpp/testing/CMakeLists.txt
index 38ecc236cf..70c5d112f1 100644
--- a/library/cpp/testing/CMakeLists.txt
+++ b/library/cpp/testing/CMakeLists.txt
@@ -8,7 +8,7 @@
add_subdirectory(benchmark)
add_subdirectory(common)
-add_subdirectory(gbenchmark_main)
+add_subdirectory(gbenchmark)
add_subdirectory(gmock_in_unittest)
add_subdirectory(gtest)
add_subdirectory(gtest_extensions)
diff --git a/library/cpp/testing/gbenchmark_main/CMakeLists.darwin-x86_64.txt b/library/cpp/testing/gbenchmark/CMakeLists.darwin-x86_64.txt
index 3253a09a82..6b4fdb826d 100644
--- a/library/cpp/testing/gbenchmark_main/CMakeLists.darwin-x86_64.txt
+++ b/library/cpp/testing/gbenchmark/CMakeLists.darwin-x86_64.txt
@@ -7,13 +7,13 @@
-add_library(cpp-testing-gbenchmark_main)
-target_link_libraries(cpp-testing-gbenchmark_main PUBLIC
+add_library(cpp-testing-gbenchmark)
+target_link_libraries(cpp-testing-gbenchmark PUBLIC
contrib-libs-cxxsupp
yutil
- contrib-libs-benchmark
+ restricted-google-benchmark
cpp-testing-hook
)
-target_sources(cpp-testing-gbenchmark_main PRIVATE
- ${CMAKE_SOURCE_DIR}/library/cpp/testing/gbenchmark_main/main.cpp
+target_sources(cpp-testing-gbenchmark PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/testing/gbenchmark/main.cpp
)
diff --git a/library/cpp/testing/gbenchmark_main/CMakeLists.linux-aarch64.txt b/library/cpp/testing/gbenchmark/CMakeLists.linux-aarch64.txt
index 66a59ee414..f3cdb5fbc1 100644
--- a/library/cpp/testing/gbenchmark_main/CMakeLists.linux-aarch64.txt
+++ b/library/cpp/testing/gbenchmark/CMakeLists.linux-aarch64.txt
@@ -7,14 +7,14 @@
-add_library(cpp-testing-gbenchmark_main)
-target_link_libraries(cpp-testing-gbenchmark_main PUBLIC
+add_library(cpp-testing-gbenchmark)
+target_link_libraries(cpp-testing-gbenchmark PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp
yutil
- contrib-libs-benchmark
+ restricted-google-benchmark
cpp-testing-hook
)
-target_sources(cpp-testing-gbenchmark_main PRIVATE
- ${CMAKE_SOURCE_DIR}/library/cpp/testing/gbenchmark_main/main.cpp
+target_sources(cpp-testing-gbenchmark PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/testing/gbenchmark/main.cpp
)
diff --git a/library/cpp/testing/gbenchmark_main/CMakeLists.linux-x86_64.txt b/library/cpp/testing/gbenchmark/CMakeLists.linux-x86_64.txt
index 66a59ee414..f3cdb5fbc1 100644
--- a/library/cpp/testing/gbenchmark_main/CMakeLists.linux-x86_64.txt
+++ b/library/cpp/testing/gbenchmark/CMakeLists.linux-x86_64.txt
@@ -7,14 +7,14 @@
-add_library(cpp-testing-gbenchmark_main)
-target_link_libraries(cpp-testing-gbenchmark_main PUBLIC
+add_library(cpp-testing-gbenchmark)
+target_link_libraries(cpp-testing-gbenchmark PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp
yutil
- contrib-libs-benchmark
+ restricted-google-benchmark
cpp-testing-hook
)
-target_sources(cpp-testing-gbenchmark_main PRIVATE
- ${CMAKE_SOURCE_DIR}/library/cpp/testing/gbenchmark_main/main.cpp
+target_sources(cpp-testing-gbenchmark PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/testing/gbenchmark/main.cpp
)
diff --git a/library/cpp/testing/gbenchmark_main/CMakeLists.txt b/library/cpp/testing/gbenchmark/CMakeLists.txt
index f8b31df0c1..f8b31df0c1 100644
--- a/library/cpp/testing/gbenchmark_main/CMakeLists.txt
+++ b/library/cpp/testing/gbenchmark/CMakeLists.txt
diff --git a/library/cpp/testing/gbenchmark_main/CMakeLists.windows-x86_64.txt b/library/cpp/testing/gbenchmark/CMakeLists.windows-x86_64.txt
index 3253a09a82..6b4fdb826d 100644
--- a/library/cpp/testing/gbenchmark_main/CMakeLists.windows-x86_64.txt
+++ b/library/cpp/testing/gbenchmark/CMakeLists.windows-x86_64.txt
@@ -7,13 +7,13 @@
-add_library(cpp-testing-gbenchmark_main)
-target_link_libraries(cpp-testing-gbenchmark_main PUBLIC
+add_library(cpp-testing-gbenchmark)
+target_link_libraries(cpp-testing-gbenchmark PUBLIC
contrib-libs-cxxsupp
yutil
- contrib-libs-benchmark
+ restricted-google-benchmark
cpp-testing-hook
)
-target_sources(cpp-testing-gbenchmark_main PRIVATE
- ${CMAKE_SOURCE_DIR}/library/cpp/testing/gbenchmark_main/main.cpp
+target_sources(cpp-testing-gbenchmark PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/testing/gbenchmark/main.cpp
)
diff --git a/library/cpp/testing/gbenchmark/benchmark.h b/library/cpp/testing/gbenchmark/benchmark.h
new file mode 100644
index 0000000000..b7be8ef533
--- /dev/null
+++ b/library/cpp/testing/gbenchmark/benchmark.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#include <contrib/restricted/google/benchmark/include/benchmark/benchmark.h>
diff --git a/library/cpp/testing/gbenchmark_main/main.cpp b/library/cpp/testing/gbenchmark/main.cpp
index 523d18901a..523d18901a 100644
--- a/library/cpp/testing/gbenchmark_main/main.cpp
+++ b/library/cpp/testing/gbenchmark/main.cpp