Add further bsp platform and safety lib Bazel tests - #626
Merged
Merged
Conversation
DominikAFischer
marked this pull request as draft
September 18, 2026 06:22
DominikAFischer
force-pushed
the
cr-1215936
branch
3 times, most recently
from
September 18, 2026 15:49
8a2046b to
8bae10f
Compare
New cc_test targets with build_variant:unit_test constraint: - platforms/s32k1xx/bsp/bspCore: bsp_core_test - platforms/s32k1xx/bsp/bspIo: bsp_io_test - platforms/s32k1xx/bsp/bspEepromDriver: bsp_eeprom_driver_test_s32k1 - platforms/posix/bsp/bspEepromDriver: bsp_eeprom_driver_test - platforms/s32k1xx/bsp/bspUart: bsp_uart_test - executables/referenceApp/platforms/posix/safety/safeLifecycle: safe_lifecycle_test Fix platforms/s32k1xx/bsp/bspIo: - Collapse bsp_io_headers and bsp_io_impl into a single bsp_io target to match the CMake bspIo library. - Remove bsp_io_mock because the CMake bspIoMock never builds and nothing depends on it. - Drop bsp_adc and the redundant bsp_eeprom_driver and bsp_mcu deps that are not part of the CMake bspIo. - Update bsp_io consumers to reference bsp_io. Fix platforms/s32k1xx/bsp/bspAdc: - Split bspAdc into bsp_adc_headers and bsp_adc so bsp_configuration_headers can depend on the adc headers without a cycle. NOTE: safe_lifecycle_test uses linkstatic = True because symbols in its transitive dep graph have no unit-test-compatible provider, so static linking pulls in only the objects the include test references. Change-Id: I3f91cad55ea5eec9f6106bed37b1a575806dc5a4
DominikAFischer
force-pushed
the
cr-1215936
branch
from
September 22, 2026 10:26
8bae10f to
969eb8e
Compare
DominikAFischer
marked this pull request as ready for review
September 22, 2026 11:19
christophruethingbmw
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Bazel cc_test targets: bsp platform and safety libs
New
cc_testtargets with thebuild_variant:unit_testconstraint:platforms/s32k1xx/bsp/bspCore:bsp_core_testplatforms/s32k1xx/bsp/bspIo:bsp_io_testplatforms/s32k1xx/bsp/bspEepromDriver:bsp_eeprom_driver_test_s32k1platforms/posix/bsp/bspEepromDriver:bsp_eeprom_driver_testplatforms/s32k1xx/bsp/bspUart:bsp_uart_testexecutables/referenceApp/platforms/posix/safety/safeLifecycle:safe_lifecycle_testFix
platforms/s32k1xx/bsp/bspIobsp_io_headersandbsp_io_implinto a singlebsp_iotarget to match the CMakebspIolibrary.bsp_io_mockbecause the CMakebspIoMocknever builds and nothing depends on it.bsp_adcand the redundantbsp_eeprom_driverandbsp_mcudeps that are not part of the CMakebspIo.bsp_ioconsumers to referencebsp_io.Fix
platforms/s32k1xx/bsp/bspAdcbspAdcintobsp_adc_headersandbsp_adcsobsp_configuration_headerscan depend on the ADC headers without a cycle.NOTE:
safe_lifecycle_testuseslinkstatic = TrueBazel links
cc_testtargets dynamically by default, so all shared library symbols must resolve at link time. CMake links test executables statically, so unused translation units are never pulled from archives and their symbols are never referenced.safe_lifecycle_testuseslinkstatic = Trueto replicate CMake's static linking behavior for two symbols that have no unit-test-compatible provider.util::logger::SAFETYis declared viaDECLARE_LOGGER_COMPONENTinsafeUtils/SafetyLogger.hbut defined only in the application layer, so no unit-test dep graph provides it. A clean fix is to addDEFINE_LOGGER_COMPONENT(SAFETY)insidesafeLifecycleinSafetyManager.cppor a dedicatedSafetyLogger.cpp, following the same pattern asblob/Logger.cppandcan/CanLogger.cpp.terminal_cleanupis called byplatforms/posix/bsp/bspMcuand defined only inplatforms/posix/bsp/bspStdio, which carries the full posix UART stack and is not suitable as a unit-test dep. A clean fix would be a unit-test-specific stub.