|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| ConfigFiles/ | H | 06-Mar-2024 | - | 1,090 | 418 |
| FreeRTOS_ARP/ | H | 06-Mar-2024 | - | 3,434 | 2,251 |
| FreeRTOS_ARP_DataLenLessThanMinPacket/ | H | 06-Mar-2024 | - | 710 | 350 |
| FreeRTOS_BitConfig/ | H | 06-Mar-2024 | - | 758 | 451 |
| FreeRTOS_DHCP/ | H | 06-Mar-2024 | - | 6,521 | 3,673 |
| FreeRTOS_DHCPv6/ | H | 06-Mar-2024 | - | 5,094 | 3,270 |
| FreeRTOS_DNS/ | H | 06-Mar-2024 | - | 2,755 | 1,646 |
| FreeRTOS_DNS_Cache/ | H | 06-Mar-2024 | - | 976 | 621 |
| FreeRTOS_DNS_Callback/ | H | 06-Mar-2024 | - | 730 | 465 |
| FreeRTOS_DNS_ConfigNoCallback/ | H | 06-Mar-2024 | - | 808 | 368 |
| FreeRTOS_DNS_Networking/ | H | 06-Mar-2024 | - | 415 | 245 |
| FreeRTOS_DNS_Parser/ | H | 06-Mar-2024 | - | 3,954 | 2,586 |
| FreeRTOS_ICMP/ | H | 06-Mar-2024 | - | 537 | 331 |
| FreeRTOS_ICMP_wo_assert/ | H | 06-Mar-2024 | - | 403 | 237 |
| FreeRTOS_IP/ | H | 06-Mar-2024 | - | 4,119 | 2,377 |
| FreeRTOS_IP_DiffConfig/ | H | 06-Mar-2024 | - | 1,387 | 676 |
| FreeRTOS_IP_DiffConfig1/ | H | 06-Mar-2024 | - | 1,455 | 747 |
| FreeRTOS_IP_DiffConfig2/ | H | 06-Mar-2024 | - | 957 | 423 |
| FreeRTOS_IP_DiffConfig3/ | H | 06-Mar-2024 | - | 1,020 | 447 |
| FreeRTOS_IP_Timers/ | H | 06-Mar-2024 | - | 1,349 | 742 |
| FreeRTOS_IP_Utils/ | H | 06-Mar-2024 | - | 3,748 | 2,148 |
| FreeRTOS_IP_Utils_DiffConfig/ | H | 06-Mar-2024 | - | 1,086 | 484 |
| FreeRTOS_IPv4/ | H | 06-Mar-2024 | - | 1,004 | 598 |
| FreeRTOS_IPv4_DiffConfig/ | H | 06-Mar-2024 | - | 993 | 455 |
| FreeRTOS_IPv4_DiffConfig1/ | H | 06-Mar-2024 | - | 1,307 | 652 |
| FreeRTOS_IPv4_Sockets/ | H | 06-Mar-2024 | - | 525 | 335 |
| FreeRTOS_IPv4_Utils/ | H | 06-Mar-2024 | - | 312 | 199 |
| FreeRTOS_IPv6/ | H | 06-Mar-2024 | - | 1,478 | 741 |
| FreeRTOS_IPv6_ConfigDriverCheckChecksum/ | H | 06-Mar-2024 | - | 952 | 411 |
| FreeRTOS_IPv6_Utils/ | H | 06-Mar-2024 | - | 1,255 | 637 |
| FreeRTOS_ND/ | H | 06-Mar-2024 | - | 2,150 | 1,315 |
| FreeRTOS_RA/ | H | 06-Mar-2024 | - | 1,478 | 920 |
| FreeRTOS_Routing/ | H | 06-Mar-2024 | - | 4,178 | 2,029 |
| FreeRTOS_Routing_ConfigCompatibleWithSingle/ | H | 06-Mar-2024 | - | 1,656 | 729 |
| FreeRTOS_Routing_ConfigV4Only/ | H | 06-Mar-2024 | - | 727 | 289 |
| FreeRTOS_Sockets/ | H | 06-Mar-2024 | - | 10,482 | 6,520 |
| FreeRTOS_Sockets_DiffConfig/ | H | 06-Mar-2024 | - | 878 | 357 |
| FreeRTOS_Sockets_DiffConfig1/ | H | 06-Mar-2024 | - | 889 | 362 |
| FreeRTOS_Sockets_DiffConfig2/ | H | 06-Mar-2024 | - | 1,394 | 626 |
| FreeRTOS_Sockets_IPv6/ | H | 06-Mar-2024 | - | 1,503 | 894 |
| FreeRTOS_Stream_Buffer/ | H | 06-Mar-2024 | - | 1,463 | 804 |
| FreeRTOS_TCP_IP/ | H | 06-Mar-2024 | - | 2,772 | 1,720 |
| FreeRTOS_TCP_IP_DiffConfig/ | H | 06-Mar-2024 | - | 956 | 409 |
| FreeRTOS_TCP_Reception/ | H | 06-Mar-2024 | - | 1,180 | 807 |
| FreeRTOS_TCP_State_Handling/ | H | 06-Mar-2024 | - | 2,053 | 1,384 |
| FreeRTOS_TCP_State_Handling_IPv4/ | H | 06-Mar-2024 | - | 536 | 322 |
| FreeRTOS_TCP_State_Handling_IPv6/ | H | 06-Mar-2024 | - | 612 | 377 |
| FreeRTOS_TCP_Transmission/ | H | 06-Mar-2024 | - | 2,786 | 2,004 |
| FreeRTOS_TCP_Transmission_IPv6/ | H | 06-Mar-2024 | - | 800 | 487 |
| FreeRTOS_TCP_Utils/ | H | 06-Mar-2024 | - | 372 | 189 |
| FreeRTOS_TCP_Utils_IPv6/ | H | 06-Mar-2024 | - | 231 | 138 |
| FreeRTOS_TCP_Utils_IPv6_ConfigLowTCPMSS/ | H | 06-Mar-2024 | - | 533 | 200 |
| FreeRTOS_TCP_WIN/ | H | 06-Mar-2024 | - | 3,024 | 2,116 |
| FreeRTOS_Tiny_TCP/ | H | 06-Mar-2024 | - | 1,184 | 705 |
| FreeRTOS_UDP_IP/ | H | 06-Mar-2024 | - | 459 | 263 |
| FreeRTOS_UDP_IPv4/ | H | 06-Mar-2024 | - | 2,407 | 1,477 |
| FreeRTOS_UDP_IPv6/ | H | 06-Mar-2024 | - | 2,133 | 1,268 |
| cmock/ | H | 06-Mar-2024 | - | 314 | 284 |
| CMakeLists.txt | HD | 06-Mar-2024 | 18.4 KiB | 383 | 336 |
| README.md | HD | 06-Mar-2024 | 4 KiB | 91 | 78 |
| TCPFilePaths.cmake | HD | 06-Mar-2024 | 3.7 KiB | 64 | 60 |
| catch_assert.h | HD | 06-Mar-2024 | 2.9 KiB | 78 | 39 |
| cmock_build.cmake | HD | 06-Mar-2024 | 2.1 KiB | 59 | 49 |
README.md
1# Unit Tests for FreeRTOS-Plus-TCP library
2This directory is made for the purpose of Unit testing and tries to provide the tools for developing unit tests. To that end, this directory submodules the [CMock](https://github.com/ThrowTheSwitch/CMock) framework (which submodules [Unity](https://github.com/throwtheswitch/unity/tree/cf949f45ca6d172a177b00da2.3.1607b97bc7a7)) and the [FreeRTOS-Kernel](https://github.com/FreeRTOS/FreeRTOS-Kernel/).
3
4## Getting Started
5### Prerequisites
6You can run this on any GNU Make compatible systems. But in case of DOS based systems some tweaking is required with the makefile.
7To compile and run this project successfully, you must have the following:
81. Make (You can check whether you have this by typing `make --version`)
9 - Not found? Try `apt-get install make`.
102. Ruby (You can check whether you have this by typing `ruby --version`)
11 - Not found? Try `apt-get install ruby`.
123. CMake version > 3.13.0 (You can check whether you have this by typing `cmake --version`)
13 - Not found? Try `apt-get install cmake`
14 - Try the `cmake --version` command. If still the version number is >= 3.13.0, skip to (4.) or else, continue.
15 - You will need to get the latest CMake version using curl or wget (or similar command).
16 - Uninstall the current version of CMake using `sudo apt remove --purge --auto-remove cmake`.
17 - Download the 3.13.0 version using `wget https://cmake.org/files/v3.13/cmake-3.13.0.tar.gz`.
18 - Extract the cmake download using `tar -xzvf cmake-3.13.0.tar.gz`.
19 - Go to the extracted folder (`cd cmake-3.13.0`) and run `./bootstrap`.
20 - Run `make -j$(nproc)' and then run `sudo make install`.
21 - Check the version using `cmake --version` command.
224. lcov version 1.14 ( check with --version option )
23 - 'sudo apt-get install lcov'
245. unifdef version 2.10 ( check with -V option )
25 - 'sudo apt-get install unifdef'
266. Download the repo and include the submodules using the following commands.
27 - `git clone https://github.com/FreeRTOS/FreeRTOS.git ./FreeRTOS_Dir`
28 - `git submodule update --checkout --init --recursive tools/CMock test/FreeRTOS-Kernel`
29
30### To run the Unit tests:
31Go to the root directory of the FreeRTOS+TCP repo and run the following script:
32~~~
33#!/bin/bash
34# This script should be run from the root directory of the FreeRTOS+TCP repo.
35
36if [[ ! -d source ]]; then
37 echo "Please run this script from the root directory of the FreeRTOS+TCP repo."
38 exit 1
39fi
40
41UNIT_TEST_DIR="test/unit-test"
42BUILD_DIR="${UNIT_TEST_DIR}/build/"
43
44# Create the build directory using CMake:
45rm -rf ${BUILD_DIR}
46cmake -S ${UNIT_TEST_DIR} -B ${BUILD_DIR}
47
48# Create the executables:
49make -C ${BUILD_DIR} all
50
51pushd ${BUILD_DIR}
52# Run the tests for all units
53ctest -E system --output-on-failure
54popd
55
56# Calculate the coverage
57make -C ${BUILD_DIR} coverage
58lcov --list --rc lcov_branch_coverage=1 ${BUILD_DIR}coverage.info
59~~~
60
61You should see an output similar to this:
62
63```
64-----------------------
656 Tests 0 Failures 0 Ignored
66OK
67Capturing coverage data from .
68... <Skipped some lines here for the sake of brevity>
69Overall coverage rate:
70 lines......: 84.8% (56 of 66 lines)
71 functions..: 85.7% (12 of 14 functions)
72 branches...: 50.0% (2 of 4 branches)
73```
74
75And also:
76
77```
78Reading tracefile test/unit-test/build/coverage.info
79 |Lines |Functions |Branches
80Filename |Rate Num|Rate Num|Rate Num
81======================================================================
82[/home/hein/freertos_plus_tcp/]
83FreeRTOS_ARP.c | 100% 238| 100% 14|99.3% 137
84FreeRTOS_DHCP.c |98.7% 314|92.9% 14| 100% 150
85FreeRTOS_Sockets.c | 3.5% 1150| 1.6% 61| 4.2% 722
86FreeRTOS_Stream_Buffer.c | 100% 107| 100% 12| 100% 54
87FreeRTOS_UDP_IP.c | 100% 97| 100% 2| 100% 58
88======================================================================
89 Total:|41.6% 1906|40.8% 103|38.2% 1121
90```
91