Commit Graph

103 Commits (15a17dc0533f937c96cdb1f114f29313c69ab7c1)

Author SHA1 Message Date
Johannes Stratmann bf677aefb6 Revert "Merge branch 'fix-memmap-diff'"
This reverts commit 3d22c880d8.
2021-10-05 17:17:35 +02:00
Johannes Stratmann 3d22c880d8 Merge branch 'fix-memmap-diff' 2021-09-28 16:59:00 +02:00
Jerome Coutant bce33b01ff connectivity-netsocket-tests-tests-network-wifi update2
- add minor print to make debug easier
- remove not useful part
2021-09-09 10:23:42 +02:00
Jerome Coutant 787605cec4 connectivity-netsocket-tests-tests-network-wifi update
Use default NSAPI configuration
2021-09-09 10:23:33 +02:00
Martin Kojtal f89655f2da
Merge pull request #15040 from mat-kalinowski/sendrecv_message
New feature: send/recv message implementation added to network stack
2021-09-09 08:35:19 +01:00
Martin Kojtal 3305dc1494
Merge pull request #15010 from world-direct/feature/reduceTLSspam
Reduce spam on trace because of calling read/write while handshaking
2021-09-09 08:34:27 +01:00
mateusz.kalinowski ad0eb0eaa6 Moving alignment information in the nsapi_msghdr_t
Macro MBED_ALIGN expands in C to _Alignas which can't be used in the
type declaration. This patch moves it to the first type definition
which makes this code compile properly in CPP and C.
2021-09-08 15:26:41 +01:00
mateusz.kalinowski f8db068f8c Removing FIXME comment and adding empty line in the test file 2021-09-07 14:55:50 +01:00
mateusz.kalinowski 575f489ab7 Fixing documentation errors
Minor errors in the documentation were fixed. These caused failure
of the doxygen checks in the PR.
2021-09-06 11:34:34 +01:00
mateusz.kalinowski c3d16f733f Adding documentation and minor code changes
Doxygen documentation for MsgHeaderIterator was added. Type used
for alignment of the nsapi_msghdr_t struct was changed.
2021-09-06 11:14:54 +01:00
mateusz.kalinowski ec3f4379d9 Code improvements for the unresolved comments
This patch contains improvements mentioned in the unresolved PR
comments:
- function names were changed from socket_sendmsg/socket_recvmsg to
  socket_sendto_control/socket_recvfrom_control.
- default implementation of this functions was provided in the
  NetworkStack class.
- MsgHeaderIterator accesses elements on the aligned addresses.
2021-09-03 12:49:00 +01:00
Tymoteusz Bloch bdfd98e764 New feature: send/recv message implementation added to network stack 2021-09-01 09:13:57 +01:00
Lukas Karel 886b2e5000 prevent spam of console 2021-08-17 16:16:58 +02:00
Robert Walton 7842320ab7 CMake: Add option to enable greentea tests
Add an option to enable the greentea tests independently from the unit
tests.

We can't just use the typical BUILD_TESTING option to enable greentea
tests. BUILD_TESTING enables unit tests and fetches googletest, which
are compiled for the host. Greentea tests are cross compiled and require
a toolchain file. For this reason we add a new option just to enable
greentea tests, preventing build failures triggered by the unit tests
and googletest.
2021-08-10 16:35:11 +01:00
Lingkai Dong 71962481a4 Unit tests: Remove mbed.h stub from target_h
The header `mbed.h` is a convenient wrapper that pre-includes some
platform headers, for use by user applications. Libraries and tests
internal to Mbed OS should not use it, and they should explicitly
include headers they need. So a stub is not needed.
2021-08-02 17:42:42 +01:00
Robert Walton a09d08917b CMake: unittests: Show all tests in CTest report
Previously a test executable was recognised as a single test by CTest.
However, test executables usually contain multiple test cases, the
results of the test cases should be individually reported. With our
previous setup we could miss test case failures that didn't cause the
executable to return an error code.

This commit uses gtest_discover_test to discover all test cases in a
test executable. This enables CTest to match test passes and failures
from the googletest binary output.
2021-07-27 21:09:39 +01:00
Hari Limaye 14cab32df4 Unittests: Make netsocket test header dependencies explicit
The CMake target `mbed-headers` brings in all
headers, and we are gradually moving away from it and explicitly use
only headers needed by each unit test.
2021-07-19 10:37:45 +01:00
Hari Limaye 4e54bf94d0 Unittests: Replace files with stubs in netsocket unit tests
Some netsocket unit tests depend on nanostack-libservice library, but
should use stubs instead of including the source files. We remove the
source files and link to mbed-stubs-nanostack-libservice.
2021-07-19 10:37:25 +01:00
Hari Limaye 8ad216ae1a Unittests: Clean up unused sources from netsocket
Some source files included when building netsocket unit tests with CMake
were determined to be unused by removing the files from target_sources()
and verifying that the tests still built and ran successfully. These
files have been removed from CMake builds.
2021-07-19 10:37:16 +01:00
Hari Limaye 47943dcf3d Unittests: connectivity: remove trailing whitespace 2021-07-19 10:36:54 +01:00
Rajkumar Kanagaraj 22b2e9f800 CMake: Add mbed-headers-nanostack-libservice library
Previously all nanostack libservice headers part of
mbed-headers-connectivity. This PR moves all the nanostack
libservice headers into newly added mbed-headers-nanostack-libraries.
This makes the nanostack libservice stubs more self-contained and
improves the composition of the library.
2021-07-13 05:49:53 -07:00
Rajkumar Kanagaraj ef7699d824 CMake: Update netsocket, lorawan unittest to use mbed-stubs-mbedtls
Update netsocket and lorawan unit tests to link with a mbed-stubs-mbedtls
library that it depends on instead of link with mbed-stubs
which is a group of stubs libraries.
2021-07-12 07:18:41 -07:00
Rajkumar Kanagaraj 66019cb80e CMake: Move mbedtls stubs to the mbedtls dir
Move the connectivity mbedtls stubs into the connectivity/mbedtls
component directory. So we can avoid duplicating the mbed-os source
tree in a central UNITTESTS folder.
2021-07-12 07:18:41 -07:00
Rajkumar Kanagaraj bb3cd37a5e CMake: Remove mbed-stubs-rtos-headers library
- Previous changes moved all rtos stubs headers into mbed-stubs-rtos-headers
lib, but the decision to keep all stubs headers under the respective
component stubs library so moved all stubs rtos headers under
mbed-stubs-rtos and updated it depend component CMake
- Remove unnecessary add_definition call for UNITTEST as any of the stubs library
added from UNITTEST/CMakeLists.txt is not required this macro
2021-07-08 07:14:56 -07:00
Rajkumar Kanagaraj ef0e3f99e4 CMake: Move netsocket stub headers to the netsocket doubles dir
Previously all the netsocket stubs headers under mbed-stubs-headers,
so this PR move all netsocket stubs headers under
netsocket/tests/UNITTESTS/double directory and update CMake to include
stubs headers into mbed-stubs-netsocket library to make netsocket stubs
to be self-contained.
2021-07-07 01:33:36 -07:00
Rajkumar Kanagaraj 68b46f6199 CMake: Add mbed-headers-netsocket headers library
- Previously, all netsocket headers made as a part of the
mbed-headers-connectivity library. To make it easier to separate all
the netsocket headers into the separate mbed-headers-netsocket library
and keep them, as part of netsocket stubs CMake. This makes the
netsocket stubs more self-contained and improves the composition of the library.
- Update cellular, netsocket unit tests to link only with a mbed-headers-netsocket
library that it depends on instead of link with mbed-headers
which is a group of headers libraries.
2021-07-07 01:33:36 -07:00
Rajkumar Kanagaraj cb343f9ba9 CMake: Update netsocket, cellular unittest to use mbed-stubs-netsocket
Update netsocket and cellular unit tests to link with a mbed-stubs-netsocket
library that it depends on instead of link with mbed-stubs
which is a group of stubs libraries.
2021-07-07 01:33:36 -07:00
Rajkumar Kanagaraj 5433365b81 CMake: Move netsocket stubs to the netsocket dir
Move the connectivity netsocket stubs into the connectivity/netsocket
component directory. So we can avoid duplicating the mbed-os source
tree in a central UNITTESTS folder.
2021-07-07 01:33:36 -07:00
Martin Kojtal 022b5a2b85
Merge pull request #14834 from ARMmbed/move_connectivity_cellular_stubs
Move connectivity cellular stubs
2021-06-30 17:18:28 +02:00
Jaeden Amero 270ea5deb7
Merge pull request #14815 from LDong-Arm/test_psa_k64f_k66f
Enable PSA tests on K64F/K66F and fix missing PSA Crypto init in TLSSocketWrapper
2021-06-30 15:20:05 +01:00
Rajkumar Kanagaraj ee67310922 CMake: unit-tests: Add mbed-headers-cellular headers library
- Previously all cellular header made as a part of the
mbed-headers-connectivity library. To make it easier to separate all
the cellular headers into the separate mbed-headers-cellular library
and keep them as part of cellular stub CMake. This makes the cellular
stubs more self-contained and improves the composition of the library.
- Update all unit test that depends on cellular headers with mbed-headers-cellular library
2021-06-30 06:01:42 -07:00
Rajkumar Kanagaraj fa0ab53692 CMake: Move connectivity/cellular stubs to the mbed-os/connectivity/cellular dir
Move the connectivity cellular into the connectivity/cellular component
directory. So we can avoid duplicating the mbed-os source tree in a
central UNITTESTS folder.
2021-06-30 06:01:42 -07:00
Lingkai Dong 929956d16a TLSSocketWrapper: Initialize PSA Crypto if used by Mbed TLS
When `MBEDTLS_USE_PSA_CRYPTO` is set, Mbed TLS uses the PSA Crypto API
where possible. It is necessary to initialize PSA Crypto beforehand.
2021-06-29 18:16:51 +01:00
Jaeden Amero 472c688a83
Merge pull request #14828 from hazzlim/add-cmake-supports-psa-tests
CMake: Add CMake to mbed-psa greentea tests
2021-06-29 15:17:01 +01:00
Hari Limaye f95052cf6f CMake: Require TEST_SOURCES in greentea CMake file
Assumption that greentea test file is always named main.cpp is
incorrect. Updated mbed_greentea_add_test() macro to make TEST_SOURCES
parameter compulsory, which is used to specify greentea test
file(s). This allows tests to use C, or have a different name.
Therefore also updated all pre-existing greentea test CMake files to
explicity add main.cpp to TEST_SOURCES.
2021-06-29 13:33:42 +01:00
Martin Kojtal 16acae3bd0
Merge pull request #14716 from boraozgen/at-handler-buffer-size-config
Cellular: Add AT handler buffer size to configuration
2021-06-29 11:29:48 +02:00
Martin Kojtal 3cf5f8e14f
Merge pull request #14752 from tymoteuszblochmobica/sockets
LWIP Broadcast  socket option added
2021-06-15 15:08:53 +02:00
Bora Özgen 8705a6a510 Cellular: Add AT handler buffer size to configuration 2021-06-15 15:03:57 +02:00
Robert Walton a0befae2d4 CMake: Only build unit tests if Mbed OS is the current project
Typically when adding a unit test directory to a CMake project a check
will be used to ensure the subdirectory is added only if the following
are true:

* The BUILD_TESTING option is set to ON.
* The current CMake project is the top-level project.

The reason being, if a downstream project includes our project they
generally don't want to build our unit tests.

In mbed-os, we do correctly specify the above condition before adding
the central UNITTEST subdirectory, which fetches googletest and adds the
"stub" libraries the unit tests depend on. However, we only check if
CMAKE_CROSSCOMPILING is OFF (or undefined) before actually adding the
unit tests. This mismatched logic would lead to unexpected build
failures in various scenarios. One likely case could be: a downstream
project including mbed-os happens to set CMAKE_CROSSCOMPILING to
OFF/undefined for any reason (possibly to build its own unit tests).
mbed-os would go ahead and attempt to build its tests without fetching
googletest or adding the required stub targets.

To fix the issue replace the check for CMAKE_CROSSCOMPILING in the unit
tests with the same BUILD_TESTING idiom we use for adding the central
UNITTESTS subdirectory.
2021-06-10 23:34:14 +01:00
Tymoteusz Bloch 580fd2c55a Add LWIP Broadcast option for UDP socket. 2021-06-09 01:44:51 +02:00
Chris Swinchatt 053eb24ab0 Fix 'netsocket: several dynamic allocation results not checked' (#14210)
Incorporates PR #14223 + changes required for spellchecker
2021-06-07 14:54:37 +01:00
Rajkumar Kanagaraj 50fc85dc44 CMake: Remove all unittest.cmake script from test suite
- Remove redundant cmake script as already added the CMake configuration file
- Remove redundant empty_baseline as it is no longer needed with the help of CMake configuration file
2021-05-26 07:09:14 -07:00
Anna Bridge 4e586a93d3
Merge pull request #14426 from ARMmbed/feature_unittest_refactor
CMake: Refactor UNITTESTS CMake
2021-05-24 13:04:22 +01:00
Rajkumar Kanagaraj f096b3b3c3 Fix missing newline 2021-05-11 04:22:26 -07:00
Martin Kojtal 125f58449d
Merge pull request #14497 from jarlamsa/no_duplicate_status_cb
Check for duplicate status callbacks before adding to the list
2021-05-11 11:41:06 +02:00
Rajkumar Kanagaraj 4ade0bdbea CMake: Fix DTLS socket unittest
- Binding the socket address into network stack to avoid socket connect API call hangs in the unittest
2021-05-11 02:29:56 -07:00
Rajkumar Kanagaraj c5a4fecd28 CMake: Refactor netsocket unittest CMake
- Add Cmake configuration file
- Fix the header inclusion in DTLSSocketWrapper and TLSSocketWrapper test
2021-05-11 02:29:56 -07:00
Rajkumar Kanagaraj ba04c1cf76 CMake: Add add_subdirectory of unittests
- add every libraries unittest directory into respective CMake
  which allows to include unittest source into build based on
  MBED_BUILD_UNITTESTS flag
2021-05-11 02:29:56 -07:00
plan-do-break-fix 915b45af23 fix(docs): corrects various typos in project documentation 2021-04-23 23:31:11 -05:00
jarlamsa bc747dce09 Check for duplicate status callbacks before adding to the list
Duplicate status callbacks don't bring any value and can cause
memory leaks if caller calls for this function multiple times with
same status_cb. Also remove all the instances of the status_cb when
removing event listener.
2021-04-01 13:22:07 +03:00