You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[libc++] Unify the benchmarks with the test suite (#101399)
Instead of building the benchmarks separately via CMake and running them
separately from the test suite, this patch merges the benchmarks into
the test suite and handles both uniformly.
As a result:
- It is now possible to run individual benchmarks like we run tests
(e.g. using libcxx-lit), which is a huge quality-of-life improvement.
- The benchmarks will be run under exactly the same configuration as
the rest of the tests, which is a nice simplification. This does
mean that one has to be careful to enable the desired optimization
flags when running benchmarks, but that is easy with e.g.
`libcxx-lit <...> --param optimization=speed`.
- Benchmarks can use the same annotations as the rest of the test
suite, such as `// UNSUPPORTED` & friends.
When running the tests via `check-cxx`, we only compile the benchmarks
because running them would be too time consuming. This introduces a bit
of complexity in the testing setup, and instead it would be better to
allow passing a --dry-run flag to GoogleBenchmark executables, which is
the topic of google/benchmark#1827.
I am not really satisfied with the layering violation of adding the
%{benchmark_flags} substitution to cmake-bridge, however I believe
this can be improved in the future.
Copy file name to clipboardExpand all lines: libcxx/docs/TestingLibcxx.rst
+19-30Lines changed: 19 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -392,6 +392,10 @@ Test Filenames`_ when determining the names for new test files.
392
392
of Lit test to be executed. This can be used to generate multiple Lit tests from a single source file, which is useful for testing repetitive properties
393
393
in the library. Be careful not to abuse this since this is not a replacement for usual code reuse techniques.
394
394
395
+
* - ``FOO.bench.cpp``
396
+
- A benchmark test. These tests are linked against the GoogleBenchmark library and generally consist of micro-benchmarks of individual
397
+
components of the library.
398
+
395
399
396
400
libc++-Specific Lit Features
397
401
----------------------------
@@ -438,43 +442,29 @@ Libc++ contains benchmark tests separately from the test of the test suite.
438
442
The benchmarks are written using the `Google Benchmark`_ library, a copy of which
439
443
is stored in the libc++ repository.
440
444
441
-
For more information about using the Google Benchmark library see the
445
+
For more information about using the Google Benchmark library, see the
0 commit comments