Skip to content

Commit

Permalink
Fix #1224, reinstate recipes for coverage test
Browse files Browse the repository at this point in the history
Also requires fixing up some include directives in UT headers
  • Loading branch information
jphickey committed Mar 16, 2021
1 parent 2b88448 commit 0aa290e
Show file tree
Hide file tree
Showing 14 changed files with 138 additions and 76 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 @@ -42,6 +42,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
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)

33 changes: 12 additions & 21 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 Expand Up @@ -136,7 +127,7 @@ void TestApps(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void TestERLog(void);

Expand All @@ -153,7 +144,7 @@ void TestERLog(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void TestTask(void);

Expand Down Expand Up @@ -185,7 +176,7 @@ void TestBackground(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void TestPerf(void);

Expand All @@ -200,7 +191,7 @@ void TestPerf(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void TestAPI(void);

Expand All @@ -216,7 +207,7 @@ void TestAPI(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void TestCDS(void);

Expand All @@ -233,7 +224,7 @@ void TestCDS(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void TestCDSMempool(void);

Expand All @@ -250,7 +241,7 @@ void TestCDSMempool(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void TestESMempool(void);

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)

39 changes: 15 additions & 24 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 All @@ -69,7 +60,7 @@
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_Init(void);

Expand All @@ -84,7 +75,7 @@ void Test_Init(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_IllegalAppID(void);

Expand All @@ -99,7 +90,7 @@ void Test_IllegalAppID(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_UnregisteredApp(void);

Expand All @@ -114,7 +105,7 @@ void Test_UnregisteredApp(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_FilterRegistration(void);

Expand All @@ -129,7 +120,7 @@ void Test_FilterRegistration(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_FilterReset(void);

Expand All @@ -146,7 +137,7 @@ void Test_FilterReset(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_Format(void);

Expand All @@ -161,7 +152,7 @@ void Test_Format(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_Ports(void);

Expand All @@ -176,7 +167,7 @@ void Test_Ports(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_Logging(void);

Expand All @@ -191,7 +182,7 @@ void Test_Logging(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_WriteApp(void);

Expand All @@ -208,7 +199,7 @@ void Test_WriteApp(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_BadAppCmd(void);

Expand All @@ -223,7 +214,7 @@ void Test_BadAppCmd(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_EventCmd(void);

Expand All @@ -238,7 +229,7 @@ void Test_EventCmd(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_FilterCmd(void);

Expand All @@ -255,7 +246,7 @@ void Test_FilterCmd(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_InvalidCmd(void);

Expand All @@ -270,7 +261,7 @@ void Test_InvalidCmd(void);
** None
**
** \returns
** This function does not return a value.
** This function does not return a value.
******************************************************************************/
void Test_Misc(void);

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
Loading

0 comments on commit 0aa290e

Please sign in to comment.