diff --git a/opendbc_repo/opendbc/safety/tests/test_mutation_infra.py b/opendbc_repo/opendbc/safety/tests/test_mutation_infra.py index fb9a3dfd2c..49dad10235 100644 --- a/opendbc_repo/opendbc/safety/tests/test_mutation_infra.py +++ b/opendbc_repo/opendbc/safety/tests/test_mutation_infra.py @@ -4,6 +4,7 @@ from concurrent.futures.process import BrokenProcessPool import importlib.util from collections import Counter import json +import os from pathlib import Path from tempfile import TemporaryDirectory import unittest @@ -144,8 +145,12 @@ def test_native_variant(native_variant): with TemporaryDirectory() as directory: root = Path(directory) library = Path(libsafety_py._build_libsafety(release=True, output_dir=root)) - self.assertEqual(list(root.iterdir()), [library]) + notes = set(root.glob("*.gcno")) + self.assertEqual(len(notes), int(os.environ.get("SAFETY_COVERAGE") == "1")) + self.assertEqual(set(root.iterdir()), {library, *notes}) library.unlink() + for note in notes: + note.unlink() for calls in ((RuntimeError("compiler failed"),), (None, RuntimeError("compiler failed"))): with self.subTest(calls=len(calls)), patch.object(libsafety_py.subprocess, "check_call", side_effect=calls): with self.assertRaisesRegex(RuntimeError, "compiler failed"): diff --git a/prebuilt.json b/prebuilt.json index 802c81a792..712d419817 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "c338ab23b81cd24b17017d666cfce9d277520fee84c273011d95adff063f151b", "schema_version": 1} +{"protected_inventory_sha256": "ec16110505a2aa6def6dc914274dcf91300d7ad0d743e2dfd86a4f276fbf1ecb", "schema_version": 1}