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": [],