From 31c47aac9d2473b95a7ae3ec099df50c08c5474f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Plewa?= Date: Tue, 18 Mar 2025 13:16:57 +0100 Subject: [PATCH] test benchmark only with singlethreaded workloads --- .cmake-format | 3 ++- benchmark/CMakeLists.txt | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.cmake-format b/.cmake-format index c1a8e85a8..cedd9cb05 100644 --- a/.cmake-format +++ b/.cmake-format @@ -12,7 +12,8 @@ with section("parse"): 'NAME': '*', 'SRCS': '*', 'LIBS': '*' , - 'LIBDIRS': '*'}}, + 'LIBDIRS': '*', + 'TESTARGS': '*'}}, 'add_umf_executable': { "pargs": 0, "flags": [], diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 80c8ba5ec..d52fc0857 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -40,8 +40,9 @@ function(add_umf_benchmark) # * SRCS - source files # * LIBS - libraries to be linked with # * LIBDIRS - directories of libraries to be linked with + # * TESTARGS - additional arguments to be passed to the add_test set(oneValueArgs NAME) - set(multiValueArgs SRCS LIBS LIBDIRS) + set(multiValueArgs SRCS LIBS LIBDIRS TESTARGS) cmake_parse_arguments( ARG "" @@ -66,7 +67,7 @@ function(add_umf_benchmark) add_test( NAME ${BENCH_NAME} - COMMAND ${BENCH_NAME} + COMMAND ${BENCH_NAME} ${ARG_TESTARGS} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) if("${BENCH_NAME}" STREQUAL "umf-ubench") @@ -148,7 +149,9 @@ add_umf_benchmark( NAME benchmark SRCS benchmark.cpp LIBS ${LIBS_OPTIONAL} benchmark::benchmark - LIBDIRS ${LIB_DIRS}) + # limit running benchmarks in CI tests to single-threaded + LIBDIRS ${LIB_DIRS} + TESTARGS --benchmark_filter=threads:1$) if(UMF_BUILD_BENCHMARKS_MT) add_umf_benchmark(