aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprettyboy <prettyboy@yandex-team.com>2023-10-19 18:07:41 +0300
committerprettyboy <prettyboy@yandex-team.com>2023-10-19 19:17:14 +0300
commitaf28e86f3a8a7ef431a470291491fd2c0ddfe582 (patch)
tree1f149eab914bcc5cb7b89abf8ed132684fc6f781
parentae2a0658c32a7e4b1e9686930b0f70b83c74ff82 (diff)
downloadydb-af28e86f3a8a7ef431a470291491fd2c0ddfe582.tar.gz
[devtools/ya] Support BENCHMARK_OPTS macro
-rw-r--r--build/plugins/ytest.py6
-rw-r--r--build/ymake.core.conf16
2 files changed, 20 insertions, 2 deletions
diff --git a/build/plugins/ytest.py b/build/plugins/ytest.py
index 2aed37e205..180f8d5c05 100644
--- a/build/plugins/ytest.py
+++ b/build/plugins/ytest.py
@@ -566,8 +566,10 @@ def onadd_ytest(unit, *args):
return
else:
test_record["TEST-NAME"] += "_bench"
-
- if flat_args[1] == 'fuzz.test' and unit.get('FUZZING') == 'yes':
+ elif flat_args[1] in ("g_benchmark", "y_benchmark"):
+ benchmark_opts = get_unit_list_variable(unit, 'BENCHMARK_OPTS_VALUE')
+ test_record['BENCHMARK-OPTS'] = serialize_list(benchmark_opts)
+ elif flat_args[1] == 'fuzz.test' and unit.get('FUZZING') == 'yes':
test_record['FUZZING'] = '1'
# use all cores if fuzzing requested
test_record['REQUIREMENTS'] = serialize_list(
diff --git a/build/ymake.core.conf b/build/ymake.core.conf
index d7d100bc4e..e42f2ebc90 100644
--- a/build/ymake.core.conf
+++ b/build/ymake.core.conf
@@ -1609,6 +1609,22 @@ module G_BENCHMARK: _BASE_PROGRAM {
ADD_YTEST($MODULE_PREFIX$REALPRJNAME g_benchmark)
}
+BENCHMARK_OPTS_VALUE=
+### @usage: BENCHMARK_OPTS(opt1 [opt2...])
+###
+### Allows to specify extra args to benchmark binary.
+### Supported for G_BENCHMARK and Y_BENCHMARK
+###
+### @example:
+### BENCHMARK_OPTS (
+### --benchmark_min_time=0
+### )
+###
+### Documentation: https://docs.yandex-team.ru/ya-make/manual/tests/benchmark
+macro BENCHMARK_OPTS(Data...) {
+ SET_APPEND(BENCHMARK_OPTS_VALUE $Data)
+}
+
# tag:test
TEST_ROOT=$(TESTS_DATA_ROOT)
RESULT_MAX_FILE=0