aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/cpp_test
diff options
context:
space:
mode:
authorionagamed <ionagamed@yandex-team.com>2024-03-07 13:39:40 +0300
committerionagamed <ionagamed@yandex-team.com>2024-03-07 13:52:51 +0300
commit8e1f2488ae4aa7b6986a119d5df78fb0481ff41d (patch)
treef689e35dcdb15ce354d565521b8fe62c021168cc /library/python/cpp_test
parenta5bc35bb658487b44e707d555998bbec6cb14eab (diff)
downloadydb-8e1f2488ae4aa7b6986a119d5df78fb0481ff41d.tar.gz
add CPP_STYLE_TEST_16 ya.make macro
a494c8b69e6dec20bf56966cca5259e337905d23
Diffstat (limited to 'library/python/cpp_test')
-rw-r--r--library/python/cpp_test/test_cpp.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/library/python/cpp_test/test_cpp.py b/library/python/cpp_test/test_cpp.py
index b7607d66c2..efa10ea283 100644
--- a/library/python/cpp_test/test_cpp.py
+++ b/library/python/cpp_test/test_cpp.py
@@ -10,15 +10,20 @@ from library.python.testing.style import rules
import library.python.resource as lpr
-STYLE_CONFIG_JSON = json.dumps(yaml.safe_load(lpr.find('resfs/file/config.clang-format')))
+STYLE_CONFIG_JSON_14 = json.dumps(yaml.safe_load(lpr.find('resfs/file/config.clang-format')))
+STYLE_CONFIG_JSON_16 = json.dumps(yaml.safe_load(lpr.find('resfs/file/config.clang-format-16')))
RES_FILE_PREFIX = '/cpp_style/files/'
CHECKED_PATHS = list(lpr.iterkeys(RES_FILE_PREFIX, strip_prefix=True))
def check_style(filename, actual_source):
- clang_format_binary = yatest.common.binary_path('contrib/libs/clang14/tools/clang-format/clang-format')
- config = STYLE_CONFIG_JSON
+ try:
+ clang_format_binary = yatest.common.binary_path('contrib/libs/clang14/tools/clang-format/clang-format')
+ config = STYLE_CONFIG_JSON_14
+ except Exception:
+ clang_format_binary = yatest.common.binary_path('contrib/libs/clang16/tools/clang-format/clang-format')
+ config = STYLE_CONFIG_JSON_16
command = [clang_format_binary, '-assume-filename=' + filename, '-style=' + config]
styled_source = subprocess.check_output(command, input=actual_source)