Commit Graph

33842 Commits (e60ffed6f45cc36ac1fa783d96f53f8268f9d6cc)

Author SHA1 Message Date
Lingkai Dong e60ffed6f4 CMake: turn mbed_greentea_add_test() into a function
Unlike a macro, a function is more self-contained and can return
early if necessary.
2021-08-11 11:40:10 +01:00
Jaeden Amero 159f8325c5
Merge pull request #14892 from rwalton-arm/greentea_ctest
Add CTest support for `mbed-drivers-ticker` greentea test
2021-08-11 11:38:29 +01:00
Robert Walton 1a7a89a8ed ci: Use new mbed-os-env docker image in "multiple executables" test
The github workflow to test building multiple executables was using the
soon to be deprecated docker image "mbedos/mbed-os-env:latest". This
commit points it at the new docker image on ghcr.io.
2021-08-11 10:15:42 +01:00
Robert Walton a437ed4047 targets: Add "bare-metal" to supported_application_profiles
We weren't setting the "supported_application_profiles" correctly for
some baremetal supported targets. This didn't cause build failures with
mbed-cli 1 as it just seems to ignore this config parameter. In our CMake
build system we have added a hard dependency on the
supported_application_profiles; we fail the build if the profile we're
trying to build isn't in the list.
2021-08-11 10:15:42 +01:00
Robert Walton cfc68a0918 CMake: Use CMAKE_MODULE_PATH to locate nuvoton post build hook
We were previously relying on the global MBED_PATH variable to provide
the root for the include path to the post build hooks. We can't
guarantee that MBED_PATH will be set by any application building us, so
use CMAKE_MODULE_PATH (which we always set) like we do for the other
post-build hooks.
2021-08-11 10:15:42 +01:00
Robert Walton 1dda219d3c ci: Add github action to build greentea tests with cmake
Build for two targets, one with baremetal profile and one full profile.
2021-08-11 10:15:42 +01:00
Robert Walton 00dbf4c71d CMake: greentea: Use more specific name for baremetal option
Make it obvious the option is used for greentea tests.
2021-08-10 16:54:27 +01:00
Robert Walton 40154ee2b1 CMake: greentea: Port mbed-drivers-ticker to CTest
Call add_test in mbed_greentea_add_test and specify mbedhtrun as the
command to run.

An MBED_HTRUN_ARGUMENTS variable has been added, which is a semicolon
separated list of arguments to forward to htrun. The user is required to
pass in any arguments mbedhtrun needs to communicate with the device
under test at CMake configuration time.

We automate passing some of the htrun arguments in CMake using data
provided by mbed_config.cmake or gathered from the CMake environment.
The following arguments are passed to htrun from CMake:

* -f/--image-path
* -e/--enum-host-tests
* -m/--micro
* -R/--reset-timeout

--baud-rate is also passed if the MBED_CONF_PLATFORM_STDIO_BAUD_RATE
config parameter is defined.

Temporary checks have been added to mbed_greentea_add_test to keep the
old flow working until we port all of the greentea tests to CTest. These
checks should be removed after we make all greentea tests runnable by
CTest.
2021-08-10 16:54:03 +01:00
Robert Walton 2a12566c70 CMake: greentea: Set variables usually defined by external apps
We rely on external applications to set MBED_CONFIG_PATH and include
app.cmake. Mbed OS can't build for a target without those parameters
set. When building greentea tests there is no external application. So,
we define the appropriate settings in our root CMakeLists.txt for
greentea tests.
2021-08-10 16:37:48 +01: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
Jaeden Amero d4b15348a9
Merge pull request #14983 from LDong-Arm/sfdp_sector_map
SFDP: Add unit tests for Sector Map Parameter Table parsing
2021-08-06 16:54:04 +01:00
Lingkai Dong a16c2bf173 SFDP: Add unit tests for Sector Map Parameter Table parsing
Add tests for `sfdp_parse_sector_map_table()` which currently (at the
time of this commit) supports flash devices with
* no Sector Map Parameter Table (i.e. the whole flash is uniform and
non-configurable)
* a single descriptor in the Sector Map Parameter Table (i.e. the
flash layout is non-configurable and has multiple regions)

Support and unit tests for flashes with multiple configurable layouts
will be added in the future.

Note: The implementation of `sfdp_parse_sector_map_table()` assumes
the table to be valid if read succeeds, so the SFDP reader callback
needs to ensure it reads data correctly or return an error.
2021-08-06 15:27:28 +01:00
Lingkai Dong f08c3cdfb5 SFDP: TestEraseTypeAlgorithm: Move setup into test case
The test data `struct mbed::sfdp_smptbl_info smptbl` is only relevant
to `TestEraseTypeAlgorithm` and not shared with other test cases.
2021-08-06 14:30:16 +01:00
Lingkai Dong 651099225e SFDP: Set region count to 1 for no sector map
A flash device with no sector map table has uniform sectors, and we
treat the whole flash as one region. In this case the function
`sfdp_parse_sector_map_table()` sets the single region's size and high
boundary accordingly, but it lacks setting of region count to 1, so
users of the SFDP parser may not get the correct number of regions.
This commit fixes the issue.
2021-08-06 14:30:16 +01:00
Martin Kojtal e14b9617dd
Merge pull request #14980 from saheerb/master
github action fix for uppercase repository owner
2021-08-05 15:59:52 +01:00
Martin Kojtal 3244f979eb
Merge pull request #14979 from moshe-shahar/patch-1
requirements.txt - remove manifest-tool 1.5.2 and mbed-cloud-sdk
2021-08-05 14:29:35 +01:00
Saheer 7698035be9 github action fix for uppercase repository owner 2021-08-05 14:06:12 +01:00
Moshe Shahar 25838edc7a
requirements.txt - remove mbed-cloud-sdk 2021-08-05 14:15:02 +03:00
Moshe Shahar af1d44a78f
Update LICENSE.md 2021-08-05 14:13:57 +03:00
Martin Kojtal eec5a7581d
Merge pull request #14978 from jamesbeyond/fix_docker
DOCKER: fix a bug in docker building GHA
2021-08-05 10:57:56 +01:00
Moshe Shahar 93117e6483
requirements.txt - remove manifest-tool 1.5.2 2021-08-05 11:52:39 +03:00
Lingkai Dong 68694255b5 SFDP: Move handling of no sector map into `if`
When a flash chip's SFDP table has no sector map, we treat the whole
flash as a single region. As an optimization, this should only be
done if there is indeed no sector map.
2021-08-04 14:03:24 +01:00
Qinghao Shi 740e52f64c DOCKER: fix a bug in docker building GHA 2021-08-04 13:30:21 +01:00
Martin Kojtal 06c9799db4
Merge pull request #14952 from saheerb/master
github actions for mbed-os-env docker management
2021-08-04 08:56:20 +01:00
Jaeden Amero 7acd5b4091
Merge pull request #14929 from LDong-Arm/move_target_h
Unit tests: Move target_h/ stubs into libraries' test doubles
2021-08-03 16:31:10 +01:00
Saheer Babu 5b0c1df525 github actions for mbed-os-env docker management 2021-08-03 16:28:14 +01:00
Lingkai Dong 81eb6cb855 Travis: Enable maximum verbosity of pinvalidate.py
Run pinvalidate.py with -vvv to print the cause of failure, making
it easier for authors of pull requests to fix pin names.
2021-08-02 17:42:43 +01:00
Lingkai Dong 578843067b Unit tests: Fix pin validation failure
The test script pinvalidate.py requires the following which are
missing in the unit test stub PinName.h:
* A comment "MBED TARGET LIST"
* `CONSOLE_TX` and `CONSOLE_RX` in the `PinName` enum

This commit adds them.
2021-08-02 17:42:43 +01:00
Lingkai Dong dca2aa79a0 Unit tests: Remove redundant CMake target mbed-headers-base
Individual libraries' `target_h` stub headers have now all been moved
from `mbed-headers-base` to `mbed-headers-<library>`.

Note: Even though headers previously in `target_h` are technically
stubs/fakes too, they are used by not only unit tests but also regular
libraries when compiled for unit tests, because no target-specific HAL
implementation exists in this case. In order for regular library
sources to pick up `target_h` headers, those headers must

* have the same names as regular headers
* appear first in include paths

This is why those headers are part of `mbed-headers-<library>` and not
`mbed-stubs-<library>`. Before this refactoring, `mbed-headers-base`
was the first in unit tests' include paths.
2021-08-02 17:42:43 +01:00
Lingkai Dong 6731f553ce Unit tests: Fix style in hal gpio_object.h stub 2021-08-02 17:42:43 +01:00
Lingkai Dong 825e3491b0 Unit tests: Move hal target_h stubs
Stubs previously in UNITTESTS/target_h/ have the same names as
regular Mbed OS headers, intending to override the latter directly.
We move hal target_h stubs into hal/tests/UNITTESTS/doubles/.

Note: In Mbed OS, the standard include format requires each header to
be prefixed with its module name, for example "hal/gpio_api.h". This
requires headers to be organized in a module directory. But unit tests
stubs for hal correspond to what a real Mbed target would have
implemented (in a non-test scenario), and targets do not currently put
headers in hal/, so we similary put stub headers directly in
hal/tests/UNITTESTS/doubles/ instead of add a hal/ subdirectory there.
2021-08-02 17:42:43 +01:00
Lingkai Dong c775e30b2d Unit tests: Move randLIB.h
The stub header randLIB.h overrides the header of the same name in
platform/randlib/ which is an external repository vendored into
the mbed-os codebase. As the repository is synchronized regularly,
it is better not to put overrides there, so we put the randLIB.h
stub into the regular platform doubles directory.
2021-08-02 17:42:43 +01:00
Lingkai Dong e75a45d041 Unit tests: Move drivers target_h stubs 2021-08-02 17:42:43 +01:00
Lingkai Dong 5fe0f8916b Unit tests: Fix style in rtos Thread.h stubs 2021-08-02 17:42:42 +01:00
Lingkai Dong 1f99729474 Unit tests: Move rtos target_h stubs 2021-08-02 17:42:42 +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
Lingkai Dong 4011e2ef85 Unit tests: Move platform target_h stubs
Stubs previously in UNITTESTS/target_h/ have the same names as
regular Mbed OS headers, intending to override the latter directly.
We move platform target_h stubs into
platform/tests/UNITTESTS/doubles/platform/.

Note: nvic_wrapper.h is normally implemented and used by Mbed targets
as needed. But as unit tests do not have a real target, we treat it
as a stub for the platform.
2021-08-02 17:42:42 +01:00
Lingkai Dong 7e3565b5f5 Unit tests: Move cmsis target_h stubs
This creates a new mbed-headers-cmsis which is always and only used
by mbed-headers-platform, so we add the former to the laters' linked
targets.
2021-08-02 17:42:42 +01:00
Lingkai Dong 44cd64a3e4 Unit tests: Fix style in cellular myCellularContext.h stub 2021-08-02 13:47:57 +01:00
Lingkai Dong 57dd6812c3 Unit tests: Move cellular target_h stubs
We move test-specific files from the top-level UNITTESTS directory
into individual components' UNITTESTS/doubles subdirectories.
2021-08-02 13:47:57 +01:00
Lingkai Dong dcc240d578 Unit tests: Remove unused syslimits.h 2021-08-02 13:47:57 +01:00
Lingkai Dong 34656e8a92 Unit tests: Remove unused nsapi_ppp.h stub 2021-08-02 13:47:57 +01:00
Lingkai Dong 56d7bb9941 Unit tests: Remove unused arm_math.h 2021-08-02 13:47:57 +01:00
Martin Kojtal 7214fe9c99
Merge pull request #14970 from MubeenHCLite/USBSerial_connect_blocking_resolution
USB connect problem in non blocking mode
2021-08-02 09:52:30 +01:00
Martin Kojtal 3318720ada
Merge pull request #14941 from hazzlim/update-tests-to-use-chrono
Update references to time values to use chrono
2021-07-30 12:02:10 +01:00
Martin Kojtal 334be7bbf2
Merge pull request #14911 from DDC-NDRS/fatfs_0.14b
FatFs: upgrade to R0.14b
2021-07-30 11:46:42 +01:00
Jaeden Amero 744814f0a0
Merge pull request #14900 from 0xc0170/feature_CMSIS_5_13b9f72f2
Update CMSIS to 5.8.0
2021-07-30 09:43:11 +01:00
Martin Kojtal 049d1f145d cmsis importer: add commits for Mbed OS changes
See specific SHA for details.
2021-07-30 08:35:04 +01:00
Mohammed Mubeen b429aeb5f7 Added PCD Start so that connection is established when a host is
connected in non blocking mode (cinnect_blocking = false)
2021-07-30 10:52:00 +05:30
Martin Kojtal 5e29db6e30 rtos: fix delay with 0
Fixes error osErrorParameter that triggers our assert.
RTX delay ignored 0 previously, it now returns osErrorParameter instead.
2021-07-29 14:31:39 +01:00