|
| 1 | +###################################################################### |
| 2 | +# |
| 3 | +# CMAKE build recipe for mcp750-vxworks PSP white-box coverage tests |
| 4 | +# |
| 5 | +###################################################################### |
| 6 | + |
| 7 | +include_directories("${CFEPSP_SOURCE_DIR}/fsw/mcp750-vxworks/inc") |
| 8 | +include_directories("${PSPCOVERAGE_SOURCE_DIR}/shared/inc") |
| 9 | + |
| 10 | +# The target names will be the PSP name with a "ut" prefix |
| 11 | +# this is to distinguish these test targets from the FSW targets. |
| 12 | +set(CFE_PSP_TARGETNAME "ut-${SETNAME}") |
| 13 | +add_subdirectory("${CFEPSP_SOURCE_DIR}/fsw/${SETNAME}" "${CFE_PSP_TARGETNAME}-impl") |
| 14 | +add_subdirectory("${CFEPSP_SOURCE_DIR}/fsw/shared" "${CFE_PSP_TARGETNAME}-shared") |
| 15 | +add_subdirectory(adaptors) |
| 16 | + |
| 17 | +# as UT assert defines OS_Application_Startup and OS_Application_Run, we need |
| 18 | +# to change the ones in this module to a different name. |
| 19 | +target_compile_definitions(psp-${CFE_PSP_TARGETNAME}-impl PRIVATE |
| 20 | + OS_Application_Startup=UT_OS_Application_Startup |
| 21 | + OS_Application_Run=UT_OS_Application_Run |
| 22 | +) |
| 23 | + |
| 24 | +# only the actual FSW src file gets the coverage instrumentation |
| 25 | +target_compile_options(psp-${CFE_PSP_TARGETNAME}-impl PRIVATE |
| 26 | + ${UT_COVERAGE_COMPILE_FLAGS} |
| 27 | +) |
| 28 | +target_compile_options(psp-${CFE_PSP_TARGETNAME}-shared PRIVATE |
| 29 | + ${UT_COVERAGE_COMPILE_FLAGS} |
| 30 | +) |
| 31 | + |
| 32 | +# both the FSW src file and the adaptor file get compiled with override includes |
| 33 | +target_include_directories(psp-${CFE_PSP_TARGETNAME}-impl BEFORE PRIVATE |
| 34 | + ${PSPCOVERAGE_SOURCE_DIR}/ut-stubs/override_inc |
| 35 | +) |
| 36 | +target_include_directories(psp-${CFE_PSP_TARGETNAME}-shared BEFORE PRIVATE |
| 37 | + ${PSPCOVERAGE_SOURCE_DIR}/ut-stubs/override_inc |
| 38 | +) |
| 39 | + |
| 40 | +add_executable(coverage-${CFE_PSP_TARGETNAME}-testrunner |
| 41 | + src/coveragetest-psp-mcp750-vxworks.c |
| 42 | + src/coveragetest-cfe-psp-start.c |
| 43 | + src/coveragetest-cfe-psp-support.c |
| 44 | + ${PSPCOVERAGE_SOURCE_DIR}/shared/src/coveragetest-cfe-psp-exceptionstorage.c |
| 45 | + $<TARGET_OBJECTS:psp-${CFE_PSP_TARGETNAME}-shared> |
| 46 | + $<TARGET_OBJECTS:psp-${CFE_PSP_TARGETNAME}-impl> |
| 47 | +) |
| 48 | + |
| 49 | +target_link_libraries(coverage-${CFE_PSP_TARGETNAME}-testrunner |
| 50 | + ${UT_COVERAGE_LINK_FLAGS} |
| 51 | + ut-adaptor-${CFE_PSP_TARGETNAME} |
| 52 | + ut_psp_cfe_stubs |
| 53 | + ut_psp_libc_stubs |
| 54 | + ut_osapi_stubs |
| 55 | + ut_assert |
| 56 | +) |
| 57 | + |
| 58 | +add_test(coverage-${CFE_PSP_TARGETNAME} coverage-${CFE_PSP_TARGETNAME}-testrunner) |
| 59 | + |
| 60 | +foreach(TGT ${INSTALL_TARGET_LIST}) |
| 61 | + install(TARGETS coverage-${CFE_PSP_TARGETNAME}-testrunner DESTINATION ${TGTNAME}/${UT_INSTALL_SUBDIR}) |
| 62 | +endforeach() |
| 63 | + |
0 commit comments