grade.py: не падать на машине без компилятора — ПРОПУСК с причиной, авто-отключение санитайзеров, .exe под Windows, WSL-подсказка

This commit is contained in:
Kodlo-chan
2026-09-23 17:48:28 +07:00
parent 165dd5619d
commit 75a10f9999
4 changed files with 155 additions and 18 deletions
+3 -2
View File
@@ -6,7 +6,7 @@ import sys
HERE = os.path.dirname(os.path.abspath(__file__))
SRC = os.path.join(HERE, "crash.c")
BIN = os.path.join(HERE, "crash_checked")
BIN = os.path.join(HERE, "crash_checked" + (".exe" if os.name == "nt" else ""))
failures = 0
@@ -20,7 +20,8 @@ def check(cond, name, extra=""):
def main():
r = subprocess.run(["gcc", "-g", "-O1", "-Wall", "-Wextra",
cc = os.environ.get("CC", "gcc")
r = subprocess.run([cc, "-g", "-O1", "-Wall", "-Wextra",
"-fsanitize=address,undefined", "-fno-omit-frame-pointer",
SRC, "-o", BIN], capture_output=True, text=True, timeout=180)
check(r.returncode == 0, "сборка с ASAN/UBSAN прошла", r.stderr[:800])