Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion checker/plugins/cpp_clang_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _run(self, args: Args, *, verbose: bool = False) -> PluginOutput: # type: i
"python3",
"run-clang-format.py",
"--clang-format-executable",
"clang-format-19",
"clang-format-20",
"--color",
"always",
"-r",
Expand Down
5 changes: 3 additions & 2 deletions checker/plugins/cpp_clang_tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Args(PluginABC.Args):
reference_root: Path
task_path: Path
lint_patterns: list[str]
build_type: str = "build-asan"

def _run(self, args: Args, *, verbose: bool = False) -> PluginOutput: # type: ignore[override]
lint_files = []
Expand All @@ -28,8 +29,8 @@ def _run(self, args: Args, *, verbose: bool = False) -> PluginOutput: # type: i
raise PluginExecutionFailed("No files")

run_args = SafeRunScriptPlugin.Args(
origin=str(args.reference_root / "build-asan"),
script=["clang-tidy-19", "-p", ".", "--use-color", "--quiet", *lint_files],
origin=str(args.reference_root / args.build_type),
script=["clang-tidy-20", "-p", ".", "--use-color", "--quiet", *lint_files],
paths_whitelist=[str(args.reference_root)],
paths_blacklist=get_cpp_blacklist(args.reference_root),
)
Expand Down
7 changes: 7 additions & 0 deletions checker/plugins/cpp_run_benchmarks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import os
import tempfile
import xml.etree.ElementTree as ET
from pathlib import Path
Expand All @@ -22,6 +23,7 @@ class Args(PluginABC.Args):
timeout: float
args: list[str]
benchmark_values: list[str]
env_whitelist: list[str] = list()

@staticmethod
def _print_logs(path: Path) -> None:
Expand Down Expand Up @@ -80,6 +82,10 @@ def _check_results(args: Args, tree: ET.ElementTree[ET.Element[str]]) -> None:

@staticmethod
def _run_benchmarks(args: Args, tmp_dir: Path, build_dir: Path, target: str, verbose: bool) -> None:
# Dump the GPU device we use to benchmark CUDA code if one is set
if "CUDA_VISIBLE_DEVICES" in args.env_whitelist:
print_info(f"CUDA_VISIBLE_DEVICES is set to `{os.getenv('CUDA_VISIBLE_DEVICES')}`")

xml_path = tmp_dir / CppRunBenchmarksPlugin._REPORT_XML
run_args = SafeRunScriptPlugin.Args(
origin=str(build_dir),
Expand All @@ -91,6 +97,7 @@ def _run_benchmarks(args: Args, tmp_dir: Path, build_dir: Path, target: str, ver
f"console::out={tmp_dir / CppRunBenchmarksPlugin._REPORT}::colour-mode=ansi",
*args.args,
],
env_whitelist=args.env_whitelist,
timeout=args.timeout,
)
try:
Expand Down
15 changes: 14 additions & 1 deletion checker/plugins/cpp_run_tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import os
import tempfile
from pathlib import Path

Expand All @@ -26,6 +27,8 @@ class Args(PluginABC.Args):
args: list[str]
paths_whitelist: list[str]
lock_network: bool = True
cuda_compute_sanitizer: bool = False
env_whitelist: list[str] = list()

@staticmethod
def _get_sanitizers_env(args: Args, path: Path) -> dict[str, str]:
Expand All @@ -47,11 +50,20 @@ def _print_logs(path: Path) -> None:

@staticmethod
def _run_tests(args: Args, tmp_dir: Path, build_dir: Path, target: str, verbose: bool) -> None:
# Dump the GPU device we use to test CUDA code if one is set
if "CUDA_VISIBLE_DEVICES" in args.env_whitelist:
print_info(f"CUDA_VISIBLE_DEVICES is set to `{os.getenv('CUDA_VISIBLE_DEVICES')}`")

env = CppRunTestsPlugin._get_sanitizers_env(args, tmp_dir)
paths_whitelist = [str(args.root / p) for p in args.paths_whitelist]
run_args = SafeRunScriptPlugin.Args(
origin=str(build_dir),
script=[
script=(
["/usr/local/cuda/bin/compute-sanitizer", "--leak-check", "full", "--error-exitcode", "1"]
if args.cuda_compute_sanitizer
else []
)
+ [
str(build_dir / target),
"-r",
f"console::out={tmp_dir / CppRunTestsPlugin._REPORT}::colour-mode=ansi",
Expand All @@ -61,6 +73,7 @@ def _run_tests(args: Args, tmp_dir: Path, build_dir: Path, target: str, verbose:
timeout=args.timeout,
paths_whitelist=paths_whitelist,
lock_network=args.lock_network,
env_whitelist=args.env_whitelist,
)
try:
SafeRunScriptPlugin()._run(run_args, verbose=verbose)
Expand Down
Loading