From b1b872e72f7ce838c38d73015add8d6f542f6802 Mon Sep 17 00:00:00 2001 From: "amelia@ivis.ai" Date: Wed, 2 Sep 2026 17:38:54 +0900 Subject: [PATCH] fix(launch_manager): enable ASSERT_DBG in unit tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lm_cc_test never defined SCORE_LANGUAGE_FUTURECPP_ASSERT_LEVEL_DEBUG, so SCORE_LANGUAGE_FUTURECPP_ASSERT_DBG(_MESSAGE) checks compiled out to a no-op dummy in every unit test binary (see score/language/futurecpp's assert.hpp) — several existing call sites in launch_manager rely on this macro (graph.cpp, process_info_node.cpp, dependency_graph.hpp, alive_interface_path.hpp, lm_control_impl.hpp) but none of them were actually being exercised. Define it in the shared lm_cc_test wrapper so it applies uniformly across all launch_manager unit tests, rather than one target at a time. --- tests/utils/bazel/unit_test.bzl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/utils/bazel/unit_test.bzl b/tests/utils/bazel/unit_test.bzl index 41a18c8b3c..38ff4765e7 100644 --- a/tests/utils/bazel/unit_test.bzl +++ b/tests/utils/bazel/unit_test.bzl @@ -22,6 +22,11 @@ def lm_cc_test(name, deps = [], **kwargs): print a diagnostic message before aborting, without requiring any explicit setup call in test code. + SCORE_LANGUAGE_FUTURECPP_ASSERT_LEVEL_DEBUG is also defined so that + SCORE_LANGUAGE_FUTURECPP_ASSERT_DBG(_MESSAGE) checks actually compile in + (they're a no-op otherwise, see score/language/futurecpp's assert.hpp), + letting these invariants be exercised in unit tests. + Args: name: Test target name. deps: Additional dependencies (assertion handler is appended automatically). @@ -30,6 +35,7 @@ def lm_cc_test(name, deps = [], **kwargs): cc_test( name = name, deps = deps + ["//score/launch_manager/src/daemon/src/common:assertion_handler"], + defines = kwargs.pop("defines", []) + ["SCORE_LANGUAGE_FUTURECPP_ASSERT_LEVEL_DEBUG"], target_compatible_with = kwargs.pop("target_compatible_with", []) + select({ "//config:unit_qemu": [], "//config:unit_host": [],