mirror of
https://github.com/nasa/fprime.git
synced 2025-12-10 00:44:37 -06:00
Enable AddressSanitizer on CI builds
This commit is contained in:
parent
81088b0e72
commit
dd01a4859e
4
.github/actions/spelling/expect.txt
vendored
4
.github/actions/spelling/expect.txt
vendored
@ -25,6 +25,7 @@ acwrap
|
||||
acxz
|
||||
addoffset
|
||||
addon
|
||||
AddressSanitizer
|
||||
adminlist
|
||||
aeiouy
|
||||
afterstatinfo
|
||||
@ -598,6 +599,7 @@ fputil
|
||||
frontend
|
||||
frox
|
||||
frsize
|
||||
fsanitize
|
||||
fscanf
|
||||
fstream
|
||||
fstrength
|
||||
@ -1239,10 +1241,10 @@ Prepends
|
||||
prepeneding
|
||||
pri
|
||||
PRId
|
||||
PRIu
|
||||
printables
|
||||
printf
|
||||
println
|
||||
PRIu
|
||||
prm
|
||||
PRMDB
|
||||
PRMDBFULL
|
||||
|
||||
@ -44,8 +44,9 @@ Fw::SerializeStatus UserSerializer::serialize(Fw::SerializeBufferBase& buffer) c
|
||||
|
||||
Fw::SerializeStatus UserSerializer::deserialize(Fw::SerializeBufferBase& buffer) {
|
||||
NATIVE_UINT_TYPE serSize = sizeof(m_struct);
|
||||
return buffer.deserialize((U8*)&m_struct,serSize);
|
||||
Fw::SerializeStatus stat = buffer.deserialize((U8*)&m_struct,serSize);
|
||||
FW_ASSERT(serSize == sizeof(m_struct));
|
||||
return stat;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -44,8 +44,9 @@ Fw::SerializeStatus UserSerializer::serialize(Fw::SerializeBufferBase& buffer) c
|
||||
|
||||
Fw::SerializeStatus UserSerializer::deserialize(Fw::SerializeBufferBase& buffer) {
|
||||
NATIVE_UINT_TYPE serSize = sizeof(m_struct);
|
||||
return buffer.deserialize((U8*)&m_struct,serSize);
|
||||
Fw::SerializeStatus stat = buffer.deserialize((U8*)&m_struct,serSize);
|
||||
FW_ASSERT(serSize == sizeof(m_struct));
|
||||
return stat;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -18,6 +18,11 @@ set(FPRIME_PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Root path of F p
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -Wno-unused-parameter")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-unused-parameter")
|
||||
|
||||
# For this testing cmake project, enable AddressSanitizer, a runtime memory sanitizer, on all unit tests
|
||||
set (CMAKE_C_FLAGS_TESTING "${CMAKE_C_FLAGS_TESTING} -fno-omit-frame-pointer -fsanitize=address")
|
||||
set (CMAKE_CXX_FLAGS_TESTING "${CMAKE_CXX_FLAGS_TESTING} -fno-omit-frame-pointer -fsanitize=address")
|
||||
set (CMAKE_LINKER_FLAGS_TESTING "${CMAKE_LINKER_FLAGS_TESTING} -fno-omit-frame-pointer -fsanitize=address")
|
||||
|
||||
# Include the build for F prime.
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cmake/FPrime.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cmake/FPrime-Code.cmake")
|
||||
|
||||
@ -130,9 +130,9 @@ endif()
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "-std=c++03" CACHE STRING "C++ flags." FORCE)
|
||||
SET(CMAKE_C_FLAGS_RELEASE "-std=c99" CACHE STRING "C flags." FORCE)
|
||||
# Raise C++ standard to C++11 while unit testing to support googletest
|
||||
SET(CMAKE_CXX_FLAGS_TESTING "-std=c++11 -g -DBUILD_UT -DPROTECTED=public -DPRIVATE=public -DSTATIC= -fprofile-arcs -ftest-coverage"
|
||||
SET(CMAKE_CXX_FLAGS_TESTING "${CMAKE_CXX_FLAGS_TESTING} -std=c++11 -g -DBUILD_UT -DPROTECTED=public -DPRIVATE=public -DSTATIC= -fprofile-arcs -ftest-coverage"
|
||||
CACHE STRING "Testing C++ flags." FORCE)
|
||||
SET(CMAKE_C_FLAGS_TESTING "-std=c99 -g -DBUILD_UT -DPROTECTED=public -DPRIVATE=public -DSTATIC= -fprofile-arcs -ftest-coverage"
|
||||
SET(CMAKE_C_FLAGS_TESTING "${CMAKE_C_FLAGS_TESTING} -std=c99 -g -DBUILD_UT -DPROTECTED=public -DPRIVATE=public -DSTATIC= -fprofile-arcs -ftest-coverage"
|
||||
CACHE STRING "Testing C flags." FORCE)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_TESTING "" CACHE STRING "Testing linker flags." FORCE)
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_TESTING "" CACHE STRING "Testing linker flags." FORCE)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user