diff --git a/libcxx/test/libcxx/clang_query.sh.cpp b/libcxx/test/libcxx/clang_query.sh.cpp --- a/libcxx/test/libcxx/clang_query.sh.cpp +++ b/libcxx/test/libcxx/clang_query.sh.cpp @@ -13,7 +13,7 @@ // The attributes hide_from_abi_of_visible.query relies on aren't applied on windows. // XFAIL: windows -// RUN: clang-query -f %S/clang_query/hide_from_abi_or_visible.query %s --use-color -- -Wno-unknown-warning-option %{compile_flags} -fno-modules > %t.output +// RUN: %{clang-query} -f %S/clang_query/hide_from_abi_or_visible.query %s --use-color -- -Wno-unknown-warning-option %{compile_flags} -fno-modules > %t.output // RUN: cat %t.output // RUN: cat %t.output | wc -l | grep -Fxq 1 diff --git a/libcxx/test/libcxx/clang_tidy.sh.cpp b/libcxx/test/libcxx/clang_tidy.sh.cpp --- a/libcxx/test/libcxx/clang_tidy.sh.cpp +++ b/libcxx/test/libcxx/clang_tidy.sh.cpp @@ -12,8 +12,8 @@ // UNSUPPORTED: gcc // TODO: run clang-tidy with modules enabled once they are supported -// RUN: clang-tidy %s --warnings-as-errors=* -header-filter=.* --checks='-*,libcpp-*' --load=%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin -- %{compile_flags} -fno-modules -// RUN: clang-tidy %s --warnings-as-errors=* -header-filter=.* --config-file=%S/../../.clang-tidy -- -Wweak-vtables %{compile_flags} -fno-modules +// RUN: %{clang-tidy} %s --warnings-as-errors=* -header-filter=.* --checks='-*,libcpp-*' --load=%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin -- %{compile_flags} -fno-modules +// RUN: %{clang-tidy} %s --warnings-as-errors=* -header-filter=.* --config-file=%S/../../.clang-tidy -- -Wweak-vtables %{compile_flags} -fno-modules // Prevent from generating deprecated warnings for this test. #if defined(__DEPRECATED) diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -18,19 +18,6 @@ _isMSVC = lambda cfg: '_MSC_VER' in compilerMacros(cfg) _msvcVersion = lambda cfg: (int(compilerMacros(cfg)['_MSC_VER']) // 100, int(compilerMacros(cfg)['_MSC_VER']) % 100) -def _hasSuitableClangTidy(cfg): - try: - return int(re.search('[0-9]+', commandOutput(cfg, ['clang-tidy --version'])).group()) >= 13 and runScriptExitCode( - cfg, ['stat %{test-tools}/clang_tidy_checks/libcxx-tidy.plugin']) == 0 - except ConfigurationRuntimeError: - return False - -def _hasSuitableClangQuery(cfg): - try: - return int(re.search('[0-9]+', commandOutput(cfg, ['clang-query --version'])).group()) >= 13 - except ConfigurationRuntimeError: - return False - DEFAULT_FEATURES = [ Feature(name='fcoroutines-ts', when=lambda cfg: hasCompileFlag(cfg, '-fcoroutines-ts') and @@ -154,9 +141,11 @@ Feature(name='executor-has-no-bash', when=lambda cfg: runScriptExitCode(cfg, ['%{exec} bash -c \'bash --version\'']) != 0), Feature(name='has-clang-tidy', - when=_hasSuitableClangTidy), + when=lambda cfg: runScriptExitCode(cfg, ['clang-tidy-15 --version']) == 0, + actions=[AddSubstitution('%{clang-tidy}', 'clang-tidy-15')]), Feature(name='has-clang-query', - when=_hasSuitableClangQuery), + when=lambda cfg: runScriptExitCode(cfg, ['clang-query-15 --version']) == 0, + actions=[AddSubstitution('%{clang-query}', 'clang-query-15')]), Feature(name='apple-clang', when=_isAppleClang), Feature(name=lambda cfg: 'apple-clang-{__clang_major__}'.format(**compilerMacros(cfg)), when=_isAppleClang),