Skip to content

Commit 0b784e8

Browse files
Merge pull request #1199 from lplewa/benchmark_limit1
limit benchmark test to singlethreaded one only
2 parents d6d2da6 + 31c47aa commit 0b784e8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.cmake-format

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ with section("parse"):
1212
'NAME': '*',
1313
'SRCS': '*',
1414
'LIBS': '*' ,
15-
'LIBDIRS': '*'}},
15+
'LIBDIRS': '*',
16+
'TESTARGS': '*'}},
1617
'add_umf_executable': {
1718
"pargs": 0,
1819
"flags": [],

benchmark/CMakeLists.txt

+6-3
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ function(add_umf_benchmark)
4040
# * SRCS - source files
4141
# * LIBS - libraries to be linked with
4242
# * LIBDIRS - directories of libraries to be linked with
43+
# * TESTARGS - additional arguments to be passed to the add_test
4344
set(oneValueArgs NAME)
44-
set(multiValueArgs SRCS LIBS LIBDIRS)
45+
set(multiValueArgs SRCS LIBS LIBDIRS TESTARGS)
4546
cmake_parse_arguments(
4647
ARG
4748
""
@@ -66,7 +67,7 @@ function(add_umf_benchmark)
6667

6768
add_test(
6869
NAME ${BENCH_NAME}
69-
COMMAND ${BENCH_NAME}
70+
COMMAND ${BENCH_NAME} ${ARG_TESTARGS}
7071
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
7172

7273
if("${BENCH_NAME}" STREQUAL "umf-ubench")
@@ -148,7 +149,9 @@ add_umf_benchmark(
148149
NAME benchmark
149150
SRCS benchmark.cpp
150151
LIBS ${LIBS_OPTIONAL} benchmark::benchmark
151-
LIBDIRS ${LIB_DIRS})
152+
# limit running benchmarks in CI tests to single-threaded
153+
LIBDIRS ${LIB_DIRS}
154+
TESTARGS --benchmark_filter=threads:1$)
152155

153156
if(UMF_BUILD_BENCHMARKS_MT)
154157
add_umf_benchmark(

0 commit comments

Comments
 (0)