-
Notifications
You must be signed in to change notification settings - Fork 253
Description
Describe the bug
The tests in the "unit test" directory use an entirely different result reporting mechanism. Although they do currently link with UT assert, they keep a local record of test cases and do not use any of the UT assert functions.
This is a maintenance issue. The code makes extensive use of macros which makes it difficult to understand and also duplicates much of the logic that UT assert already has. Furthermore, the tests do not run on all OSAL platforms (e.g. RTEMS) because the macros are incomplete, even though UT assert does support this platform.
To Reproduce
Build with ENABLE_UNIT_TESTS=TRUE and run all tests. The osal "unit-tests" produce entirely different log files than the rest of the tests.
Expected behavior
The osal "unit-tests" should be more consistent in behavior and log file format with all the other tests.
System observed on:
- Ubuntu 18.04 LTS 64-bit
Additional context
This is becoming more of an issue due to a parallel effort to avoid clobbering CMAKE_C_FLAGS (#312). But this unit test build currently relies on CMAKE_C_FLAGS and OS-specific definitions (e.g. _LINUX_OS_, _VXWORKS_OS_, etc) to pick the right macros to use. So this breaks the unit test if not setting CMAKE_C_FLAGS anymore.
Although it could probably be patched up again with some more hacks, it is probably worth some extra effort to just clean this up properly so it stops being a perpetual issue.
Since most things are macro based already, it is likely that simply changing the macro definitions to direct the output to UT assert instead of the local structure is probably sufficient.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.