-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from nasa-itc/nos3#176-unit-tests
[nasa/nos3#176] Unit Tests
- Loading branch information
Showing
5 changed files
with
639 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
################################################################## | ||
# | ||
# Coverage Unit Test build recipe | ||
# | ||
# This CMake file contains the recipe for building the sample unit tests. | ||
# It is invoked from the parent directory when unit tests are enabled. | ||
# | ||
################################################################## | ||
|
||
# | ||
# | ||
# NOTE on the subdirectory structures here: | ||
# | ||
# - "inc" provides local header files shared between the coveragetest, | ||
# wrappers, and overrides source code units | ||
# - "coveragetest" contains source code for the actual unit test cases | ||
# The primary objective is to get line/path coverage on the FSW | ||
# code units. | ||
# | ||
|
||
# Use the UT assert public API, and allow direct | ||
# inclusion of source files that are normally private | ||
include_directories(${PROJECT_SOURCE_DIR}/fsw/src) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc) | ||
include_directories(${hwlib_MISSION_DIR}/fsw/public_inc) | ||
|
||
|
||
# Add a coverage test executable called "sample-ALL" that | ||
# covers all of the functions in sample_app. | ||
# | ||
# Also note in a more complex app/lib the coverage test can also | ||
# be broken down into smaller units (in which case one should use | ||
# a unique suffix other than "ALL" for each unit). For example, | ||
# OSAL implements a separate coverage test per source unit. | ||
add_cfe_coverage_test(sample ALL | ||
"coveragetest/coveragetest_sample_app.c" | ||
"../src/sample_app.c" | ||
"../src/sample_device.c" | ||
"../../../../fsw/apps/hwlib/fsw/stubs/libuart.c" | ||
) | ||
|
||
# The sample uses library functions provided by sample_lib so must be linked | ||
# with the sample_lib stub library (this is mainly just an example of how this | ||
# can be done). | ||
#add_cfe_coverage_dependency(sample ALL sample_lib) | ||
|
Oops, something went wrong.