Skip to content

Commit 9191cac

Browse files
Revert change for stripping static keywords for testing
1 parent cd4fa14 commit 9191cac

File tree

3 files changed

+2
-30
lines changed

3 files changed

+2
-30
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Run Coverage
2828
run: |
2929
make -C build/ coverage
30-
declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*source\*" "\*vendor/unity\*" "\*_deps\*")
30+
declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*vendor/unity\*" "\*_deps\*")
3131
echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info
3232
lcov --rc lcov_branch_coverage=1 --list build/coverage.info
3333
- name: Check Coverage

test/unit-test/CMakeLists.txt

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,43 +31,16 @@ list(APPEND mock_define_list "")
3131

3232
# ================= Create the library under test here (edit) ==================
3333

34-
# Base name for temporary files
35-
set( TEMP_BASE "${CMAKE_BINARY_DIR}/MQTTFileDownloader_base64" )
36-
37-
# Strip static constraints so unit tests may call internal functions
38-
execute_process( COMMAND sed "s/^static //"
39-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
40-
INPUT_FILE ../source/MQTTFileDownloader_base64.c
41-
OUTPUT_FILE ${TEMP_BASE}.c
42-
)
43-
44-
# Generate a header file for internal functions
45-
execute_process( COMMAND sed -n "/^static.*(/,/^{\$/{s/^static //; s/)\$/&;/; /{/d; p;}"
46-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
47-
INPUT_FILE ../source/MQTTFileDownloader_base64.c
48-
OUTPUT_FILE ${TEMP_BASE}_annex.h
49-
)
50-
51-
execute_process(COMMAND cp ./source/MQTTFileDownloader.c ./build/MQTTFileDownloader.c )
52-
53-
execute_process(COMMAND cp ./source/MQTTFileDownloader_cbor.c ./build/MQTTFileDownloader_cbor.c )
54-
55-
set (TEST_SOURCES
56-
${MODULE_ROOT_DIR}/build/MQTTFileDownloader.c
57-
${MODULE_ROOT_DIR}/build/MQTTFileDownloader_base64.c
58-
${MODULE_ROOT_DIR}/build/MQTTFileDownloader_cbor.c)
59-
6034
# list the files you would like to test here
35+
list(APPEND real_source_files ${MQTT_FILE_DOWNLOADER_SOURCES} ${JSON_SOURCES} ${TINYCBOR_SOURCES})
6136
list(APPEND real_source_files ${TEST_SOURCES} ${JSON_SOURCES} ${TINYCBOR_SOURCES})
6237
# list the directories the module under test includes
6338
list(APPEND real_include_directories .
6439
${MQTT_FILE_DOWNLOADER_INCLUDES}
6540
${JSON_INCLUDE_PUBLIC_DIRS}
66-
"${MODULE_ROOT_DIR}/build/"
6741
"${MODULE_ROOT_DIR}/test/unit-test/dependencies/"
6842
)
6943

70-
7144
# ===================== Create UnitTest Code here (edit) =====================
7245

7346
# list the directories your test needs to include

test/unit-test/downloader_base64_utest.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "MQTTFileDownloader.h"
1616

1717
#include "MQTTFileDownloader_base64.h"
18-
#include "MQTTFileDownloader_base64_annex.h"
1918

2019
#define GET_STREAM_REQUEST_BUFFER_SIZE 256U
2120

0 commit comments

Comments
 (0)