Skip to content

Commit 032f799

Browse files
authored
Remove demo platform unit tests (#1832)
Each of the libraries included in CSDK has its own unit tests. The tests in this repo are for the demos' platform integration; these are not nessesary for demo code, and require large effort to update when updating and adding demos.
1 parent a243cae commit 032f799

28 files changed

+8
-4708
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
make -C build/ help | grep demo | tr -d '. ' | xargs make -C build/
4646
make -C demos/jobs/jobs_demo_mosquitto
4747
build-check-demos-cpp:
48-
runs-on: ubuntu-latest
48+
runs-on: ubuntu-20.04
4949
steps:
5050
- name: Clone This Repo
5151
uses: actions/checkout@v2
@@ -88,39 +88,6 @@ jobs:
8888
- name: Build Demos
8989
run: |
9090
make -C build/ help | grep demo | tr -d '. ' | xargs make -C build/
91-
build-check-system-tests:
92-
runs-on: ubuntu-18.04
93-
steps:
94-
- name: Clone This Repo
95-
uses: actions/checkout@v2
96-
with:
97-
submodules: recursive
98-
- name: Configure CMake build
99-
run: |
100-
curl https://cmake.org/files/v3.2/cmake-3.2.0-Linux-x86_64.tar.gz -o cmake.tar.gz
101-
tar -xf cmake.tar.gz
102-
mkdir build && cd build
103-
../cmake-3.2.0-Linux-x86_64/bin/cmake .. \
104-
-G "Unix Makefiles" \
105-
-DCMAKE_BUILD_TYPE=Release \
106-
-DBUILD_TESTS=1 \
107-
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror' \
108-
-DAWS_IOT_ENDPOINT="aws-iot-endpoint" \
109-
-DBROKER_ENDPOINT="broker-endpoint" \
110-
-DCLIENT_CERT_PATH="cert/path" \
111-
-DROOT_CA_CERT_PATH="cert/path" \
112-
-DCLIENT_PRIVATE_KEY_PATH="key/path" \
113-
-DCLIENT_IDENTIFIER="ci-identifier" \
114-
-DTHING_NAME="thing-name" \
115-
-DS3_PRESIGNED_GET_URL="get-url" \
116-
-DS3_PRESIGNED_PUT_URL="put-url" \
117-
-DCLAIM_CERT_PATH="cert/path" \
118-
-DCLAIM_PRIVATE_KEY_PATH="key/path" \
119-
-DPROVISIONING_TEMPLATE_NAME="template-name" \
120-
-DDEVICE_SERIAL_NUMBER="00000" \
121-
-DCSR_SUBJECT_NAME="CN=Fleet Provisioning Demo"
122-
- name: Build System Tests
123-
run: make -C build/ help | grep system | tr -d '. ' | xargs make -C build/
12491
build-check-install:
12592
runs-on: ubuntu-18.04
12693
steps:
@@ -134,7 +101,7 @@ jobs:
134101
tar -xf cmake.tar.gz
135102
mkdir build && cd build
136103
../cmake-3.2.0-Linux-x86_64/bin/cmake .. \
137-
-DBUILD_DEMOS=0 -DBUILD_TESTS=0 \
104+
-DBUILD_DEMOS=0 \
138105
-DCSDK_HEADER_INSTALL_PATH="$PWD/../shared-libs-headers-install-dir" -DCSDK_LIB_INSTALL_PATH="$PWD/../shared-libs-install-dir"
139106
- name: Install shared libraries and verify custom install location
140107
run: |
@@ -154,7 +121,7 @@ jobs:
154121
cd build
155122
../cmake-3.2.0-Linux-x86_64/bin/cmake .. \
156123
-DBUILD_SHARED_LIBRARIES=OFF \
157-
-DBUILD_DEMOS=0 -DBUILD_TESTS=0 \
124+
-DBUILD_DEMOS=0 \
158125
-DCSDK_HEADER_INSTALL_PATH="$PWD/../static-libs-headers-install-dir" -DCSDK_LIB_INSTALL_PATH="$PWD/../static-libs-install-dir"
159126
- name: Install static libraries and verify custom install location
160127
run: |
@@ -195,58 +162,6 @@ jobs:
195162
fi
196163
# Each line of install_manifest.txt contains the location of an installed library or header
197164
done <install_manifest.txt
198-
unittest:
199-
runs-on: ubuntu-18.04
200-
steps:
201-
- name: Clone This Repo
202-
uses: actions/checkout@v2
203-
with:
204-
submodules: recursive
205-
- name: Download CMake 3.2.0
206-
run: |
207-
curl https://cmake.org/files/v3.2/cmake-3.2.0-Linux-x86_64.tar.gz -o cmake.tar.gz
208-
tar -xf cmake.tar.gz
209-
mkdir build
210-
cmake-3.2.0-Linux-x86_64/bin/cmake . -Bbuild/ \
211-
-G "Unix Makefiles" \
212-
-DBUILD_TESTS=1 \
213-
-DCMAKE_BUILD_TYPE=Debug \
214-
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG'
215-
make -C build/ help | grep utest | tr -d '. ' | xargs make -C build/
216-
- name: Build Unit Tests
217-
run: |
218-
sudo apt-get install -y lcov
219-
make -C build/ help | grep utest | tr -d '. ' | xargs make -C build/
220-
- name: Run ctest
221-
run: |
222-
cd build/
223-
ctest -E system --output-on-failure
224-
cd ..
225-
- name: Run Coverage
226-
run: |
227-
make -C build/ coverage
228-
declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*3rdparty\*" "\*netdb\*" "*openssl/*")
229-
echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info
230-
lcov --rc lcov_branch_coverage=1 --list build/coverage.info
231-
- name: Check Coverage
232-
env:
233-
MIN_COVERAGE: 100
234-
run: |
235-
LINE_COVERAGE=$(lcov --list build/coverage.info | tail -n 1 | cut -d '|' -f 2 | sed -n "s/\([^%]*\)%.*/\1/p")
236-
BRANCH_COVERAGE=$(lcov --rc lcov_branch_coverage=1 --list build/coverage.info | tail -n 1 | cut -d '|' -f 4 | sed -n "s/\([^%]*\)%.*/\1/p")
237-
RESULT=0
238-
echo "Required line and branch coverages: $MIN_COVERAGE"
239-
echo "Line coverage: $LINE_COVERAGE"
240-
if [[ $(echo "$LINE_COVERAGE < $MIN_COVERAGE" | bc) -ne 0 ]]; then
241-
echo "Line Coverage is too low."
242-
RESULT=1
243-
fi
244-
echo "Branch coverage: $BRANCH_COVERAGE"
245-
if [[ $(echo "$BRANCH_COVERAGE < $MIN_COVERAGE" | bc) -ne 0 ]]; then
246-
echo "Branch Coverage is too low."
247-
RESULT=1
248-
fi
249-
exit $RESULT
250165
complexity:
251166
runs-on: ubuntu-18.04
252167
steps:
@@ -305,7 +220,7 @@ jobs:
305220
exit 0
306221
fi
307222
doxygen:
308-
runs-on: ubuntu-latest
223+
runs-on: ubuntu-20.04
309224
steps:
310225
- uses: actions/checkout@v2
311226
with:
@@ -371,7 +286,7 @@ jobs:
371286
include-file-types: .c,.h,.dox
372287
allowlist-file: ./.github/links_allowlist.txt
373288
verify-manifest:
374-
runs-on: ubuntu-latest
289+
runs-on: ubuntu-20.04
375290
steps:
376291
- uses: actions/checkout@v2
377292
with:

CMakeLists.txt

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ set(3RDPARTY_DIR "${MODULES_DIR}/3rdparty" CACHE INTERNAL "3rdparty libraries ro
3232
include( "demos/logging-stack/logging.cmake" )
3333

3434
# Configure options to always show in CMake GUI.
35-
option( BUILD_TESTS
36-
"Set this to ON to build test executables."
37-
OFF )
3835
option( BUILD_DEMOS
3936
"Set this to ON to build demo executables."
4037
ON )
@@ -79,25 +76,6 @@ if(DEFINED ENV{PWD})
7976
endif()
8077
endif()
8178

82-
# Build the tests if flag enabled.
83-
if(BUILD_TESTS)
84-
enable_testing()
85-
include(${ROOT_DIR}/tools/cmock/cmock_dependencies.cmake)
86-
87-
# Create a list for each unit test target.
88-
set(utest_targets
89-
openssl_utest sockets_utest
90-
plaintext_utest clock_utest ota_pal_posix_utest)
91-
92-
# Add a target for running coverage on tests.
93-
add_custom_target(coverage
94-
COMMAND ${CMAKE_COMMAND} -DROOT_DIR=${ROOT_DIR}
95-
-P ${CMAKE_SOURCE_DIR}/tools/cmock/coverage.cmake
96-
DEPENDS cmock unity ${utest_targets}
97-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
98-
)
99-
endif()
100-
10179
include(GNUInstallDirs)
10280

10381
# Try installing to /opt if the directory exists, or use the home directory otherwise.
@@ -141,21 +119,13 @@ include( tools/cmake/utility.cmake )
141119
# Make THING_NAME an alias for CLIENT_IDENTIFIER
142120
set_alias( "CLIENT_IDENTIFIER" ALIASES "THING_NAME" )
143121

144-
if(BUILD_TESTS)
145-
# Add build configuration for integration tests.
146-
add_subdirectory( integration-test )
147-
endif()
148122
if(BUILD_DEMOS)
149123
# Add build configuration for demos.
150124
add_subdirectory( demos )
151125
endif()
152126

153127
if(DOWNLOAD_CERTS)
154-
if(BUILD_TESTS)
155-
set(CERT_DOWNLOAD_DIR ${SYSTEM_TEST_DIR}/certificates)
156-
else()
157-
set(CERT_DOWNLOAD_DIR ${DEMOS_DIR}/certificates)
158-
endif()
128+
set(CERT_DOWNLOAD_DIR ${DEMOS_DIR}/certificates)
159129
file(MAKE_DIRECTORY ${CERT_DOWNLOAD_DIR})
160130
# Download the Amazon Root CA certificate.
161131
message( "Downloading the Amazon Root CA certificate..." )
@@ -166,8 +136,4 @@ if(DOWNLOAD_CERTS)
166136
# Copy certificates to the build directory.
167137
file(COPY "${CERT_DOWNLOAD_DIR}"
168138
DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
169-
if(BUILD_TESTS)
170-
file(COPY "${CERT_DOWNLOAD_DIR}"
171-
DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests)
172-
endif()
173139
endif()

docs/utest_guide.md

Lines changed: 0 additions & 126 deletions
This file was deleted.

libraries/standard/coreMQTT

Submodule coreMQTT updated 53 files

manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: |-
88
See dependencies for included libraries."
99
dependencies:
1010
- name: "coreMQTT"
11-
version: "v2.1.0"
11+
version: "v2.1.1"
1212
repository:
1313
type: "git"
1414
url: "https://github.com/FreeRTOS/coreMQTT"

0 commit comments

Comments
 (0)