Skip to content

[libc++] Move the benchmarks under libcxx/test #99371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -845,10 +845,6 @@ add_subdirectory(src)
add_subdirectory(utils)
add_subdirectory(modules)

if (LIBCXX_INCLUDE_BENCHMARKS)
add_subdirectory(benchmarks)
endif()

if (LIBCXX_INCLUDE_TESTS)
add_subdirectory(test)
add_subdirectory(lib/abi)
Expand Down
10 changes: 5 additions & 5 deletions libcxx/docs/TestingLibcxx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,9 @@ An example build would look like:

$ ninja -C build cxx-benchmarks

This will build all of the benchmarks under ``<libcxx-src>/benchmarks`` to be
This will build all of the benchmarks under ``<libcxx>/test/benchmarks`` to be
built against the just-built libc++. The compiled tests are output into
``build/projects/libcxx/benchmarks``.
``build/libcxx/test/benchmarks``.

Also See:

Expand All @@ -474,9 +474,9 @@ For example:

.. code-block:: bash

$ cd build/projects/libcxx/benchmarks
$ ./algorithms.bench.out # Runs all the benchmarks
$ ./algorithms.bench.out --benchmark_filter=BM_Sort.* # Only runs the sort benchmarks
$ cd build/libcxx/test/benchmarks
$ ./find.bench.out # Runs all the benchmarks
$ ./find.bench.out --benchmark_filter="bm_ranges_find<std::vector<char>>" # Only runs that specific benchmark

For more information about running benchmarks see `Google Benchmark`_.

Expand Down
4 changes: 4 additions & 0 deletions libcxx/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
include(HandleLitArguments)
add_subdirectory(tools)

if (LIBCXX_INCLUDE_BENCHMARKS)
add_subdirectory(benchmarks)
endif()

set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")
set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ include(CheckCXXCompilerFlag)
# Build Google Benchmark
#==============================================================================

set(CMAKE_FOLDER "${CMAKE_FOLDER}/Benchmarks")

set(BENCHMARK_COMPILE_FLAGS
-Wno-unused-command-line-argument
-nostdinc++
Expand Down Expand Up @@ -191,6 +189,10 @@ endforeach()
if (LIBCXX_INCLUDE_TESTS)
include(AddLLVM)

configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/lit.cfg.py)

configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import site

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

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

config.test_exec_root = os.path.join(config.libcxx_obj_root, "benchmarks")
config.test_source_root = config.test_exec_root
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.test_source_root = "@CMAKE_CURRENT_BINARY_DIR@"

config.test_format = GoogleBenchmark(
test_sub_dirs=".", test_suffix=".bench.out", benchmark_args=config.benchmark_args
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@"
config.benchmark_args = "@LIBCXX_BENCHMARK_TEST_ARGS@".split(';')

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