Skip to content

Commit 78b4b5c

Browse files
authored
[libc++] Move the benchmarks under libcxx/test (#99371)
This is an intermediate and fairly mechanical step towards unifying the benchmarks with the rest of the test suite. Moving this around requires a few changes, notably making sure we don't throw a wrench into the discovery process of the normal test suite. This won't be a problem anymore once benchmarks are taken into account by the test setup out of the box.
1 parent e9d5842 commit 78b4b5c

File tree

78 files changed

+17
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+17
-15
lines changed

libcxx/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -845,10 +845,6 @@ add_subdirectory(src)
845845
add_subdirectory(utils)
846846
add_subdirectory(modules)
847847

848-
if (LIBCXX_INCLUDE_BENCHMARKS)
849-
add_subdirectory(benchmarks)
850-
endif()
851-
852848
if (LIBCXX_INCLUDE_TESTS)
853849
add_subdirectory(test)
854850
add_subdirectory(lib/abi)

libcxx/docs/TestingLibcxx.rst

Lines changed: 5 additions & 5 deletions

libcxx/test/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
include(HandleLitArguments)
22
add_subdirectory(tools)
33

4+
if (LIBCXX_INCLUDE_BENCHMARKS)
5+
add_subdirectory(benchmarks)
6+
endif()
7+
48
set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")
59
set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n")
610

libcxx/benchmarks/CMakeLists.txt renamed to libcxx/test/benchmarks/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ include(CheckCXXCompilerFlag)
55
# Build Google Benchmark
66
#==============================================================================
77

8-
set(CMAKE_FOLDER "${CMAKE_FOLDER}/Benchmarks")
9-
108
set(BENCHMARK_COMPILE_FLAGS
119
-Wno-unused-command-line-argument
1210
-nostdinc++
@@ -191,6 +189,10 @@ endforeach()
191189
if (LIBCXX_INCLUDE_TESTS)
192190
include(AddLLVM)
193191

192+
configure_lit_site_cfg(
193+
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py.in
194+
${CMAKE_CURRENT_BINARY_DIR}/lit.cfg.py)
195+
194196
configure_lit_site_cfg(
195197
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
196198
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)
File renamed without changes.

libcxx/benchmarks/lit.cfg.py renamed to libcxx/test/benchmarks/lit.cfg.py.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
import site
55

6-
site.addsitedir(os.path.join(os.path.dirname(os.path.dirname(__file__)), "utils"))
6+
site.addsitedir(os.path.join("@LIBCXX_SOURCE_DIR@", "utils"))
77
from libcxx.test.googlebenchmark import GoogleBenchmark
88

99
# Tell pylint that we know config and lit_config exist somewhere.
@@ -15,8 +15,8 @@
1515
config.name = "libc++ benchmarks"
1616
config.suffixes = []
1717

18-
config.test_exec_root = os.path.join(config.libcxx_obj_root, "benchmarks")
19-
config.test_source_root = config.test_exec_root
18+
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
19+
config.test_source_root = "@CMAKE_CURRENT_BINARY_DIR@"
2020

2121
config.test_format = GoogleBenchmark(
2222
test_sub_dirs=".", test_suffix=".bench.out", benchmark_args=config.benchmark_args

libcxx/benchmarks/lit.site.cfg.py.in renamed to libcxx/test/benchmarks/lit.site.cfg.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@"
77
config.benchmark_args = "@LIBCXX_BENCHMARK_TEST_ARGS@".split(';')
88

99
# Let the main config do the real work.
10-
lit_config.load_config(config, "@LIBCXX_SOURCE_DIR@/benchmarks/lit.cfg.py")
10+
lit_config.load_config(config, "@CMAKE_CURRENT_BINARY_DIR@/lit.cfg.py")

0 commit comments

Comments
 (0)