Skip to content

Enable ASAN/UBSAN integration and refactor linking logic #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 4, 2025

Conversation

ttldtor
Copy link
Collaborator

@ttldtor ttldtor commented Mar 24, 2025

Added ASAN/UBSAN flags to the build configuration for enhanced runtime checks. Introduced a reusable LinkAsanUbsan function to centralize and simplify target linking. Updated relevant build and test scripts to use the new function.

Added ASAN/UBSAN flags to the build configuration for enhanced runtime checks. Introduced a reusable `LinkAsanUbsan` function to centralize and simplify target linking. Updated relevant build and test scripts to use the new function.
Update LinkAsanUbsan to use the targetName parameter instead of PROJECT_NAME. This ensures the correct target is configured for sanitizers, improving flexibility and correctness.
Split ASAN and UBSAN configurations into separate options and functions. Updated build matrix and CMake logic to handle each sanitizer independently, improving flexibility and clarity.
Added sanitizers to workflow matrix names for better clarity. Adjusted test step to only run if the workflow is not canceled. Minor cleanup of formatting for consistency.
Added `continue-on-error` to ensure the pipeline proceeds despite test failures. Updated the ctest command to include `--output-on-failure` for better debugging and `--parallel` to specify the number of cores for faster execution.
Updated build workflows to exclude UBSAN on Windows and streamlined the ctest command. Added support for AddressSanitizer on Windows in CMake, including necessary compiler definitions, while removing unused VS-specific ASAN option.
The conditional check excluding UBSAN on Windows was removed as it is no longer necessary. This simplifies the workflow configuration and ensures consistency across builds. All relevant configurations will now be executed without exclusion.
Added the `--output-on-failure` flag to the ctest command in the GitHub Actions workflow. This ensures that test failures provide detailed output, improving debugging efficiency.
Removed `#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN` from all test files and introduced a central `main.cpp` for running tests. Updated CMake configuration to link the new shared main with test executables. Adjusted signal handling and stack trace features in the new `main.cpp` for better test execution control.
Added a copyright header with license information to the test file. Also reordered and grouped include statements for improved readability and maintainability.
@ttldtor ttldtor merged commit 37b78b6 into main Apr 4, 2025
63 checks passed
@ttldtor ttldtor deleted the enable-asan-for-tests branch April 4, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants