Skip to content

Commit

Permalink
Update coverity version message (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinglee-iot authored Apr 9, 2024
1 parent e0cd4db commit 59875a9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CSDK
CSRS
ctest
DCMOCK
DCOV
decihours
Decihours
DECIHOURS
Expand All @@ -32,6 +33,7 @@ DNDEBUG
Drbg
DSYSTEM
DUNIT
DUNITTEST
DUNITY
ecdh
ecjpake
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Debug \
-DSYSTEM_TESTS=1 \
-DUNIT_TESTS=0 \
-DUNITTEST=0 \
-DCMAKE_C_FLAGS="${CFLAGS}"
make -C build/ all
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
cmake -S test -B build/ \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Debug \
-DUNIT_TESTS=1 \
-DUNITTEST=1 \
-DSYSTEM_TESTS=0 \
-DCMAKE_C_FLAGS="${CFLAGS}"
make -C build/ all
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
cmake -S test -B build/ \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Debug \
-DUNIT_TESTS=1 \
-DUNITTEST=1 \
-DSYSTEM_TESTS=0 \
-DCMAKE_C_FLAGS="${CFLAGS}"
make -C build/ all
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
run: |
cmake -S test -B build/ \
-G "Unix Makefiles" \
-DUNIT_TESTS=0 \
-DUNITTEST=0 \
-DSYSTEM_TESTS=0 \
-DCMAKE_C_FLAGS="${CFLAGS}"
- name: Install Python3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Coverage builds are validated on recent versions of Ubuntu Linux.

- You may specify your preferred build tool by appending `-G'Unix Makefiles'`
or `-GNinja` to the command above.
- You may append `-DUNIT_TESTS=0` or `-DSYSTEM_TESTS=0` to disable Unit Tests
- You may append `-DUNITTEST=0` or `-DSYSTEM_TESTS=0` to disable Unit Tests
or Integration Tests respectively.

1. Build the test binaries: `cmake --build ./build --target all`
Expand Down
16 changes: 9 additions & 7 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.13.0)
project("corePKCS11 tests" LANGUAGES C)
project( "corePKCS11 tests"
VERSION 3.5.0
LANGUAGES C)

# Allow the project to be organized into folders.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
Expand All @@ -18,8 +20,8 @@ get_filename_component(__MODULE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE
set(MODULE_ROOT_DIR ${__MODULE_ROOT_DIR} CACHE INTERNAL "corePKCS11 repository root.")

option(SYSTEM_TESTS "Set this to ON to build system tests" ON)
option(UNIT_TESTS "Set this to ON to build unit tests" ON)
option(COVERITY "Set this to ON to build coverity_analysis target" ON)
option(UNITTEST "Set this to ON to build unit tests" ON)
option(COV_ANALYSIS "Set this to ON to build coverity_analysis target" ON)

# Set output directories.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
Expand All @@ -28,7 +30,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

include(${MODULE_ROOT_DIR}/tools/mbedtls.cmake)

if(UNIT_TESTS OR SYSTEM_TESTS)
if(UNITTEST OR SYSTEM_TESTS)
include(${MODULE_ROOT_DIR}/tools/unity.cmake)
include(${MODULE_ROOT_DIR}/tools/cmock.cmake)
endif()
Expand All @@ -49,7 +51,7 @@ set(
# add_test()
enable_testing()

if(UNIT_TESTS)
if(UNITTEST)
add_subdirectory(pkcs11_mbedtls_utest)
add_subdirectory(pkcs11_utils_utest)
add_subdirectory(wrapper_utest)
Expand All @@ -59,15 +61,15 @@ if(SYSTEM_TESTS)
add_subdirectory(mbedtls_integration)
endif()

if(COVERITY)
if(COV_ANALYSIS)
add_subdirectory(coverity_analysis)
endif()

# ========================================
# Coverage Analysis configuration
# ========================================

if(UNIT_TESTS OR SYSTEM_TESTS)
if(UNITTEST OR SYSTEM_TESTS)
# Add a target for running coverage on tests.
add_custom_target(
coverage
Expand Down
6 changes: 3 additions & 3 deletions tools/coverity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ To that end, this directory provides a [configuration file](https://github.com/F
building a binary for the tool to analyze.

> **Note**
For generating the report as outlined below, we have used Coverity version 2018.09.
For generating the report as outlined below, we have used Coverity version 2023.6.1.

For details regarding the suppressed violations in the report (which can be generated using the instructions described below), please
see the [MISRA.md](https://github.com/FreeRTOS/corePKCS11/blob/main/MISRA.md) file.
Expand All @@ -31,7 +31,7 @@ Go to the root directory of the library and run the following commands in termin
~~~
2. Create the build files using CMake in a `build` directory
~~~
cmake -B build -S test
cmake -B build -S test -DCOV_ANALYSIS=1
~~~
3. Go to the build directory and copy the coverity configuration file
~~~
Expand Down Expand Up @@ -62,7 +62,7 @@ Go to the root directory of the library and run the following commands in termin
For your convenience the commands above are below to be copy/pasted into a UNIX command friendly terminal.
~~~
cov-configure --force --compiler cc --comptype gcc;
cmake -B build -S test;
cmake -B build -S test -DCOV_ANALYSIS=1;
cd build/;
cov-build --emit-complementary-info --dir cov-out make coverity_analysis;
cd cov-out/
Expand Down

0 comments on commit 59875a9

Please sign in to comment.