Skip to content

Commit

Permalink
Merge pull request #1225 from jphickey/fix-1224-core-coverage-tests
Browse files Browse the repository at this point in the history
Fix #1224, reinstate recipes for coverage test
  • Loading branch information
astrogeco authored Mar 17, 2021
2 parents 7f8e475 + c37b6f3 commit fa10af7
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 54 deletions.
2 changes: 2 additions & 0 deletions modules/core_private/fsw/inc/cfe_time_resetvars_typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include "common_types.h"
#include "cfe_time_extern_typedefs.h"

#define CFE_TIME_RESET_SIGNATURE 0xA5A55A5A

/**
** \brief Time related variables that are maintained through a Processor Reset
**
Expand Down
6 changes: 6 additions & 0 deletions modules/core_private/ut-stubs/src/ut_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
** Includes
*/
#include "ut_support.h"
#include "cfe_core_resourceid_basevalues.h"

#include <string.h>

Expand Down Expand Up @@ -164,6 +165,11 @@ void UT_InitData(void)
*/
UT_SetDataBuffer(UT_KEY(CFE_ES_GetAppName), (uint8 *)UT_appname, sizeof(UT_appname), false);

/*
* Set up CFE_ES_GetAppID() to return the equivalent of AppID 1 by default
*/
UT_SetAppID(CFE_ES_APPID_C(CFE_ResourceId_FromInteger(CFE_ES_APPID_BASE + 1)));

/*
* Reset the OSAL stubs to the default state
*/
Expand Down
17 changes: 16 additions & 1 deletion modules/es/ut-coverage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,19 @@
#
##################################################################

# Nothing yet - placeholder for future use
foreach(SRC ${es_SOURCES})
list(APPEND UT_SOURCES "${CFE_ES_SOURCE_DIR}/${SRC}")
endforeach()

add_cfe_coverage_test(es ALL
"es_UT.c"
"${UT_SOURCES}"
)

# This permits UT test cases to directly access private headers in the fsw/src dir
target_include_directories(coverage-es-ALL-testrunner PRIVATE
${CFE_ES_SOURCE_DIR}/fsw/src
)

target_link_libraries(coverage-es-ALL-testrunner ut_core_private_stubs)

19 changes: 5 additions & 14 deletions modules/es/ut-coverage/es_UT.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,12 @@
** Includes
*/
#include <string.h>
#include "cfe.h"
#include "common_types.h"
#include "osapi.h"
#include "cfe_es_module_all.h"
#include "cfe_time_core_internal.h"
#include "cfe_tbl_core_internal.h"
#include "cfe_evs_core_internal.h"
#include "cfe_sb_core_internal.h"
#include "cfe_version.h"
#include "cfe_es.h"
#include "cfe_es_cds.h"
#include "cfe_es_cds_mempool.h"
#include "cfe_es_generic_pool.h"
#include "cfe_es_global.h"
#include "cfe_es_resource.h"
#include "cfe_es_log.h"
#include "cfe_es_perf.h"
#include "cfe_es_task.h"
#include "cfe_es_verify.h"
#include "cfe_es_start.h"
#include "ut_support.h"
#include "ut_osprintf_stubs.h"

Expand Down
18 changes: 17 additions & 1 deletion modules/evs/ut-coverage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,20 @@
#
##################################################################

# Nothing yet - placeholder for future use

foreach(SRC ${evs_SOURCES})
list(APPEND UT_SOURCES "${CFE_EVS_SOURCE_DIR}/${SRC}")
endforeach()

add_cfe_coverage_test(evs ALL
"evs_UT.c"
"${UT_SOURCES}"
)

# This permits UT test cases to directly access private headers in the fsw/src dir
target_include_directories(coverage-evs-ALL-testrunner PRIVATE
${CFE_EVS_SOURCE_DIR}/fsw/src
)

target_link_libraries(coverage-evs-ALL-testrunner ut_core_private_stubs)

11 changes: 1 addition & 10 deletions modules/evs/ut-coverage/evs_UT.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,7 @@
** Includes
*/
#include <string.h>
#include "cfe.h"
#include "common_types.h"
#include "osapi.h"
#include "cfe_evs.h"
#include "cfe_evs_log.h"
#include "cfe_evs_task.h"
#include "cfe_evs_utils.h"
#include "cfe_sb.h"
#include "cfe_es.h"
#include "cfe_time.h"
#include "cfe_evs_module_all.h"
#include "ut_support.h"

/* EVS unit test functions */
Expand Down
18 changes: 17 additions & 1 deletion modules/fs/ut-coverage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,20 @@
#
##################################################################

# Nothing yet - placeholder for future use

foreach(SRC ${fs_SOURCES})
list(APPEND UT_SOURCES "${CFE_FS_SOURCE_DIR}/${SRC}")
endforeach()

add_cfe_coverage_test(fs ALL
"fs_UT.c"
"${UT_SOURCES}"
)

# This permits UT test cases to directly access private headers in the fsw/src dir
target_include_directories(coverage-fs-ALL-testrunner PRIVATE
${CFE_FS_SOURCE_DIR}/fsw/src
)

target_link_libraries(coverage-fs-ALL-testrunner ut_core_private_stubs)

5 changes: 1 addition & 4 deletions modules/fs/ut-coverage/fs_UT.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "cfe.h"
#include "cfe_fs.h"
#include "cfe_fs_priv.h"
#include "common_types.h"
#include "cfe_fs_module_all.h"
#include "ut_support.h"

/* FS unit test functions */
Expand Down
18 changes: 17 additions & 1 deletion modules/sb/ut-coverage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,20 @@
#
##################################################################

# Nothing yet - placeholder for future use
foreach(SRC ${sb_SOURCES})
list(APPEND UT_SOURCES "${CFE_SB_SOURCE_DIR}/${SRC}")
endforeach()

add_cfe_coverage_test(sb ALL
"sb_UT.c"
"${UT_SOURCES}"
)

# This permits UT test cases to directly access private headers in the fsw/src dir
target_include_directories(coverage-sb-ALL-testrunner PRIVATE
${CFE_SB_SOURCE_DIR}/fsw/src
)

# The SB tests currently link with the _real_ SBR implementation (not a stub)
target_link_libraries(coverage-sb-ALL-testrunner ut_core_private_stubs sbr)

6 changes: 1 addition & 5 deletions modules/sb/ut-coverage/sb_UT.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@
** Includes
*/
#include <string.h>
#include "cfe.h"
#include "cfe_sb_events.h"
#include "cfe_sb_priv.h"
#include "osapi.h"
#include "common_types.h"
#include "cfe_sb_module_all.h"
#include "ut_support.h"

/*
Expand Down
19 changes: 18 additions & 1 deletion modules/tbl/ut-coverage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,21 @@
#
##################################################################

# Nothing yet - placeholder for future use

foreach(SRC ${tbl_SOURCES})
list(APPEND UT_SOURCES "${CFE_TBL_SOURCE_DIR}/${SRC}")
endforeach()

add_cfe_coverage_test(tbl ALL
"tbl_UT.c"
"${UT_SOURCES}"
)

# This permits UT test cases to directly access private headers in the fsw/src dir
target_include_directories(coverage-tbl-ALL-testrunner PRIVATE
${CFE_TBL_SOURCE_DIR}/fsw/src
)

target_link_libraries(coverage-tbl-ALL-testrunner ut_core_private_stubs)


8 changes: 1 addition & 7 deletions modules/tbl/ut-coverage/tbl_UT.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,8 @@
** Includes
*/
#include <string.h>
#include "cfe.h"
#include "cfe_tbl.h"
#include "common_types.h"
#include "ut_support.h"
#include "cfe_tbl_msg.h"
#include "cfe_tbl_module_all.h"
#include "cfe_tbl_task.h"
#include "cfe_tbl_task_cmds.h"
#include "ut_support.h"

typedef struct
{
Expand Down
3 changes: 1 addition & 2 deletions modules/time/fsw/src/cfe_time_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
/*
** Main task definitions...
*/
#define CFE_TIME_TASK_NAME "CFE_TIME"
#define CFE_TIME_RESET_SIGNATURE 0xA5A55A5A
#define CFE_TIME_TASK_NAME "CFE_TIME"

/*
** Interrupt task definitions...
Expand Down
19 changes: 18 additions & 1 deletion modules/time/ut-coverage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,21 @@
#
##################################################################

# Nothing yet - placeholder for future use

foreach(SRC ${time_SOURCES})
list(APPEND UT_SOURCES "${CFE_TIME_SOURCE_DIR}/${SRC}")
endforeach()

add_cfe_coverage_test(time ALL
"time_UT.c"
"${UT_SOURCES}"
)

# This permits UT test cases to directly access private headers in the fsw/src dir
target_include_directories(coverage-time-ALL-testrunner PRIVATE
${CFE_TIME_SOURCE_DIR}/fsw/src
)

target_link_libraries(coverage-time-ALL-testrunner ut_core_private_stubs)


7 changes: 1 addition & 6 deletions modules/time/ut-coverage/time_UT.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@
** Includes
*/
#include <string.h>
#include "cfe_platform_cfg.h"
#include "cfe_sb.h"
#include "cfe_time.h"
#include "cfe_time_msg.h"
#include "cfe_time_utils.h"
#include "common_types.h"
#include "cfe_time_module_all.h"
#include "ut_support.h"

/*
Expand Down

0 comments on commit fa10af7

Please sign in to comment.