Skip to content

Add assertion handler to all LCM unit tests via lm_cc_test macro - #378

Open
shegazyy wants to merge 1 commit into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/assertion-handler-for-unit-tests
Open

Add assertion handler to all LCM unit tests via lm_cc_test macro#378
shegazyy wants to merge 1 commit into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/assertion-handler-for-unit-tests

Conversation

@shegazyy

Copy link
Copy Markdown
Contributor

Creates a shared testing library (score/launch_manager/src/testing) that registers a diagnostic assertion handler at static-init time via alwayslink = True. Adds a lm_cc_test Bazel macro in tests/utils/bazel/ unit_test.bzl that wraps cc_test and injects the handler dependency automatically. Updates all 11 unit-test BUILD files to use lm_cc_test.

Creates a shared testing library (score/launch_manager/src/testing) that
registers a diagnostic assertion handler at static-init time via
alwayslink = True. Adds a lm_cc_test Bazel macro in tests/utils/bazel/
unit_test.bzl that wraps cc_test and injects the handler dependency
automatically. Updates all 11 unit-test BUILD files to use lm_cc_test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: 8cc588ab-971a-4824-8ba0-85a3676346cd
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (33 packages loaded, 10 targets configured)

Analyzing: target //:license-check (85 packages loaded, 10 targets configured)

Analyzing: target //:license-check (99 packages loaded, 33 targets configured)

Analyzing: target //:license-check (144 packages loaded, 2767 targets configured)

Analyzing: target //:license-check (152 packages loaded, 5482 targets configured)

Analyzing: target //:license-check (153 packages loaded, 6243 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8190 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (167 packages loaded, 10159 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

INFO: Analyzed target //:license-check (169 packages loaded, 10409 targets configured).
[1 / 1] no actions running
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
[16 / 16] no actions running
INFO: Elapsed time: 26.367s, Critical Path: 2.56s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@shegazyy

Copy link
Copy Markdown
Contributor Author

Hey @MaciejKaszynski 🙏 opened this to fix #368, would appreciate a review whenever you get a chance. Open to any feedback!

* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

#pragma once

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everywhere else we use #ifdefs so please change this.

namespace score::lcm::testing
{

inline void registerAssertionHandler() noexcept

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use the same assertion handler for the daemon as tests.

Would move this maybe into //score/launch_manager/src/daemon/src/common:assertion_handler and then also link it for the daemons cc_binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants