Skip to content

Commit 3f63a42

Browse files
authored
Merge pull request #184 from nasa/integration-candidate
Integration candidate 2020-07-29
2 parents e54cd35 + a53f65c commit 3f63a42

File tree

92 files changed

+3898
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+3898
-13
lines changed

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ add_library(psp-${CFE_PSP_TARGETNAME} STATIC
2828
)
2929

3030
if (ENABLE_UNIT_TESTS)
31-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/fsw/ut-stubs)
31+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ut-stubs)
32+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/unit-test-coverage)
3233
endif (ENABLE_UNIT_TESTS)
3334

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ This is a collection of APIs abstracting platform specific functionality to be l
88

99
## Version History
1010

11+
### Development Build: 1.4.0+dev76
12+
13+
- Provide a new framework and perform PSP coverage tests. New coverage test executable is built and several files within PSP are targeted.
14+
- See <https://github.com/nasa/PSP/pull/184>
15+
1116
### Development Build: 1.4.0+dev71
1217

1318
- Restructure code to make more amicable for rebuilding in a unit test environment. No major changes, primarily just shifting code between locations/headers to support unit testing.
@@ -35,7 +40,7 @@ This is a collection of APIs abstracting platform specific functionality to be l
3540
- Exception handling is now implemented on POSIX. There is no longer a separate handler for SIGINT - it is now treated as an exception and goes through the normal process which ends up "restarting" CFE. On pc-linux causes the process to exit normally. There is now a mechanism to capture the CTRL+C exception code and use it during normal test cycles.
3641
- See <https://github.com/nasa/PSP/pull/160>
3742

38-
#### Development Build: 1.4.10
43+
### Development Build: 1.4.10
3944

4045
- Implements full-precision microsecond conversion
4146
- See <https://github.com/nasa/PSP/pull/155>

fsw/mcp750-vxworks/inc/psp_version.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/*
3030
* Development Build Macro Definitions
3131
*/
32-
#define CFE_PSP_IMPL_BUILD_NUMBER 71
32+
#define CFE_PSP_IMPL_BUILD_NUMBER 76
3333
#define CFE_PSP_IMPL_BUILD_BASELINE "v1.4.0+dev"
3434

3535
/*
@@ -57,7 +57,7 @@
5757
* See @ref cfsversions for format differences between development and release versions.
5858
*/
5959
#define CFE_PSP_IMPL_VERSION_STRING \
60-
" PSP Development Build\n " CFE_PSP_IMPL_VERSION " (Codename: Bootes)" /* Codename for current development */ \
61-
"\n Last Official Release: psp v1.4.0" /* For full support please use this version */
60+
" PSP Development Build " CFE_PSP_IMPL_VERSION /* Codename for current development */ \
61+
", Last Official Release: psp v1.4.0" /* For full support please use this version */
6262

6363
#endif /* _psp_version_ */

fsw/pc-linux/inc/psp_version.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/*
3030
* Development Build Macro Definitions
3131
*/
32-
#define CFE_PSP_IMPL_BUILD_NUMBER 71
32+
#define CFE_PSP_IMPL_BUILD_NUMBER 76
3333
#define CFE_PSP_IMPL_BUILD_BASELINE "v1.4.0+dev"
3434

3535
/*
@@ -57,7 +57,7 @@
5757
* See @ref cfsversions for format differences between development and release versions.
5858
*/
5959
#define CFE_PSP_IMPL_VERSION_STRING \
60-
" PSP Development Build\n " CFE_PSP_IMPL_VERSION " (Codename: Bootes)" /* Codename for current development */ \
61-
"\n Last Official Release: psp v1.4.0" /* For full support please use this version */
60+
" PSP DEVELOPMENT BUILD " CFE_PSP_IMPL_VERSION \
61+
", Last Official Release: psp v1.4.0" /* For full support please use this version */
6262

6363
#endif /* _psp_version_ */

fsw/pc-rtems/inc/psp_version.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/*
3030
* Development Build Macro Definitions
3131
*/
32-
#define CFE_PSP_IMPL_BUILD_NUMBER 71
32+
#define CFE_PSP_IMPL_BUILD_NUMBER 76
3333
#define CFE_PSP_IMPL_BUILD_BASELINE "v1.4.0+dev"
3434

3535
/*
@@ -57,7 +57,7 @@
5757
* See @ref cfsversions for format differences between development and release versions.
5858
*/
5959
#define CFE_PSP_IMPL_VERSION_STRING \
60-
" PSP Development Build\n " CFE_PSP_IMPL_VERSION " (Codename: Bootes)" /* Codename for current development */ \
61-
"\n Last Official Release: psp v1.4.0" /* For full support please use this version */
60+
" PSP DEVELOPMENT BUILD " CFE_PSP_IMPL_VERSION /* Codename for current development */ \
61+
", Last Official Release: psp v1.4.0" /* For full support please use this version */
6262

6363
#endif /* _psp_version_ */

fsw/ut-stubs/CMakeLists.txt

-2
This file was deleted.

unit-test-coverage/.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*~
2+
*.o
3+
*.gcov
4+
*.gcda
5+
*.gcno
6+
*.exe
7+
*_log.txt

unit-test-coverage/CMakeLists.txt

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
######################################################################
2+
#
3+
# CMAKE build recipe for PSP white-box coverage tests
4+
#
5+
######################################################################
6+
7+
# The following cache variables are recognized:
8+
# PSPCOVERAGE_TARGETS -> the intended PSP module(s) that run on the actual target
9+
#
10+
# Like OSAL coverage testing, the actual underlying OS calls are stubbed out, there
11+
# is no dependency on the actual underlying OS. All coverage tests can be built on
12+
# all platforms regardless of the actual PSP in use for flight software.
13+
14+
project(PSPCOVERAGE C)
15+
16+
# Currently only mcp750-vxworks is implemented a demonstration of how this works.
17+
set(PSPCOVERAGE_TARGETS "mcp750-vxworks" CACHE STRING "PSP target(s) to build coverage tests for (default=all)")
18+
19+
# Check that coverage has been implemented for this PSPTYPE
20+
foreach(PSPTYPE ${PSPCOVERAGE_TARGETS})
21+
if (NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${PSPTYPE})
22+
message(FATAL_ERROR "No coverage tests implemented for ${PSPTYPE}")
23+
endif (NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${PSPTYPE})
24+
endforeach(PSPTYPE ${PSPCOVERAGE_TARGETS})
25+
26+
message(STATUS "PSP Coverage Test Targets: ${PSPCOVERAGE_TARGETS}")
27+
28+
# Utilize the shared UT assert library, along with the standard OSAL includes
29+
include_directories(${UT_ASSERT_SOURCE_DIR}/inc)
30+
include_directories(${PSPCOVERAGE_SOURCE_DIR}/ut-stubs/inc)
31+
32+
add_subdirectory(ut-stubs)
33+
34+
# Build targets for each of the indicated PSPs
35+
foreach(SETNAME ${PSPCOVERAGE_TARGETS})
36+
add_subdirectory(${SETNAME})
37+
endforeach(SETNAME ${PSPCOVERAGE_TARGETS})
38+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# Copyright (c) 2019, United States government as represented by the
3+
# administrator of the National Aeronautics Space Administration.
4+
# All rights reserved. This software was created at NASA Goddard
5+
# Space Flight Center pursuant to government contracts.
6+
#
7+
# This is governed by the NASA Open Source Agreement and may be used,
8+
# distributed and modified only according to the terms of that agreement.
9+
#
10+
11+
12+
# "Adaptors" help enable the unit test code to reach functions/objects that
13+
# are otherwise not exposed.
14+
15+
# NOTE: These source files are compile with OVERRIDES on the headers just like
16+
# the FSW code is compiled. This is how it is able to include internal headers
17+
# which otherwise would fail. But that also means that adaptor code cannot call
18+
# any library functions, as this would also reach a stub, not the real function.
19+
20+
add_library(ut-adaptor-${CFE_PSP_TARGETNAME} STATIC
21+
src/ut-adaptor-bootrec.c
22+
${PSPCOVERAGE_SOURCE_DIR}/shared/adaptors/src/ut-adaptor-exceptions.c
23+
)
24+
25+
# the "override_inc" dir contains replacement versions of the C-library include files.
26+
target_include_directories(ut-adaptor-${CFE_PSP_TARGETNAME} BEFORE PRIVATE
27+
${PSPCOVERAGE_SOURCE_DIR}/ut-stubs/override_inc
28+
)
29+
30+
target_include_directories(ut-adaptor-${CFE_PSP_TARGETNAME} PUBLIC
31+
${CMAKE_CURRENT_SOURCE_DIR}/inc
32+
${PSPCOVERAGE_SOURCE_DIR}/shared/adaptors/inc
33+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
*
3+
* Copyright (c) 2020, United States government as represented by the
4+
* administrator of the National Aeronautics Space Administration.
5+
* All rights reserved. This software was created at NASA Goddard
6+
* Space Flight Center pursuant to government contracts.
7+
*
8+
* This is governed by the NASA Open Source Agreement and may be used,
9+
* distributed and modified only according to the terms of that agreement.
10+
*
11+
*/
12+
13+
14+
/**
15+
* \file ut-adaptor-bootrec.h
16+
* \ingroup adaptors
17+
* \author joseph.p.hickey@nasa.gov
18+
*
19+
*/
20+
21+
#ifndef INCLUDE_UT_ADAPTOR_BOOTREC_H_
22+
#define INCLUDE_UT_ADAPTOR_BOOTREC_H_
23+
24+
#include <common_types.h>
25+
26+
void UT_Setup_ReservedMem_BootRec(void);
27+
uint32 UT_Get_ReservedMem_BootType(void);
28+
void UT_Set_ReservedMem_BootType(uint32 reset_type);
29+
30+
31+
#endif /* INCLUDE_UT_ADAPTOR_BOOTREC_H_ */
32+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
*
3+
* Copyright (c) 2020, United States government as represented by the
4+
* administrator of the National Aeronautics Space Administration.
5+
* All rights reserved. This software was created at NASA Goddard
6+
* Space Flight Center pursuant to government contracts.
7+
*
8+
* This is governed by the NASA Open Source Agreement and may be used,
9+
* distributed and modified only according to the terms of that agreement.
10+
*
11+
*/
12+
13+
14+
/**
15+
* \file ut-adaptor-bootrec.c
16+
* \ingroup adaptors
17+
* \author joseph.p.hickey@nasa.gov
18+
*
19+
*/
20+
21+
#include "ut-adaptor-bootrec.h"
22+
#include <cfe_psp_config.h>
23+
#include <cfe_psp_memory.h>
24+
25+
26+
static CFE_PSP_ReservedMemoryBootRecord_t UT_BOOTREC;
27+
28+
static const CFE_PSP_ReservedMemoryBootRecord_t UT_DEFAULT_BOOTREC = { 0 };
29+
30+
31+
void UT_Setup_ReservedMem_BootRec(void)
32+
{
33+
UT_BOOTREC = UT_DEFAULT_BOOTREC;
34+
CFE_PSP_ReservedMemoryMap.BootPtr = &UT_BOOTREC;
35+
}
36+
37+
uint32 UT_Get_ReservedMem_BootType(void)
38+
{
39+
return UT_BOOTREC.bsp_reset_type;
40+
}
41+
42+
void UT_Set_ReservedMem_BootType(uint32 reset_type)
43+
{
44+
UT_BOOTREC.bsp_reset_type = reset_type;
45+
}
46+
47+

0 commit comments

Comments
 (0)