Commit Graph

167 Commits (16acae3bd01c29040f3ec102165b4a9bd7a97519)

Author SHA1 Message Date
Rajkumar Kanagaraj ef5c86f1dd CMake: unit-tests: Make events UNITTESTS only depend on headers it uses
Previously the events unit tests depended on `mbed-headers`, which
is a collection of all available headers in mbed-os. To make it easier
to separate the library, only depend on the headers we're using.
2021-06-24 03:03:40 -07: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
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
Rajkumar Kanagaraj 6d4caad83d CMake: Move CMAKE_CROSSCOMPILING check inside library CMake 2021-05-20 06:26:10 -07:00
Rajkumar Kanagaraj b6647355bf CMake: Refactor event unittest cmake
- Added CMake configuration file into events unittests
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
Eric Marks 4ba07d9413
Update UserAllocatedEvent.h 2021-03-17 09:55:13 -05:00
Eric Marks 956e5ce163
Update Event.h 2021-03-17 09:54:06 -05:00
Eric Marks a07c00e6c3
Update equeue.h 2021-03-17 09:52:20 -05:00
Eric Marks e8332aa7e9
Update EventQueue.h 2021-03-17 09:51:34 -05:00
Eric Marks 13351c9253
Update equeue.h 2021-03-17 09:50:44 -05:00
Eric Marks ecbef81572
Update README.md 2021-03-17 09:19:22 -05:00
Eric Marks 4638ce9bc3
Update README.md 2021-03-17 09:18:42 -05:00
Eric Marks 06b7ba0a55
Update README.md 2021-03-17 09:17:33 -05:00
Paul Szczepanek 86f8b0b818 extend the event generation int 2021-03-10 18:21:07 +00:00
Paul Szczepanek 3f9c734e1a bigger equeue generation size and only increment when needed
to mitigate against generation clash
2021-03-09 22:08:43 +00:00
Martin Kojtal 9607ceaebf
Merge pull request #13975 from adbridge/eventq
Update EventQueue API to use chrono times
2021-02-08 12:44:39 +00:00
adbridge c7c30fe9f7 Remove trailing space 2021-02-04 14:25:29 +00:00
adbridge d1b768ad9a Tweak events API update and update Greentea tests accordingly 2021-02-04 12:48:41 +00:00
Rajkumar Kanagaraj 6824b14e48 CMake: rename greentea test macro 2021-02-02 07:43:40 -08:00
Martin Kojtal 97c7c91655
Merge pull request #14087 from adbridge/events
Update events period method to check for invalid values
2021-01-18 16:29:30 +00:00
adbridge 81d7ac683b Minor formatting tweak to fix file permissions 2021-01-18 14:59:30 +00:00
adbridge 4f558743e1 Revert "one final whitespace change!"
This reverts commit c9a3375042.
2021-01-18 14:42:02 +00:00
adbridge c9a3375042 one final whitespace change! 2021-01-12 14:38:37 +00:00
adbridge 27689ef2b3 Further whitespace fixes 2021-01-12 13:29:26 +00:00
adbridge 1746ed0bc0 Fix whitespace to stop astyle complaining 2021-01-12 12:54:56 +00:00
adbridge 9e7c82ceed Fix astyle issues 2021-01-08 17:33:51 +00:00
adbridge 37f13bdeb2 Remove unecessary namespace qualified
(Also minor whitespace correction)
2021-01-08 17:15:13 +00:00
Rajkumar Kanagaraj bc4b3f5846
Apply suggestions from code review
Co-authored-by: Hugues Kamba <41612201+hugueskamba@users.noreply.github.com>
2021-01-08 03:20:15 -08:00
adbridge f2b86864d5 Fix some whitespace issues 2021-01-06 16:07:04 +00:00
adbridge c0a57ba3b9 Updated event period handling and greentea test
non_periodic constant has been moved out of the Event class and
made static within the events namespace so that it is available
both internally within the class and externally.

The MBED_ASSERT has been changed to MBED_WARNING.

The greentea test has been updated:
1) timings reduced to make the test cases run faster
2) The call handler simplified
2021-01-06 16:07:04 +00:00
adbridge 6b2a0fe1d4 Update events period method to check for invalid values
The period method currently allows any ms value positive, negative
and zero. A negative value means dispatch a non periodic event
ie just once. 0 is unspecified behaviour. This commit forces the
user to use either positive periods or a new constant non_periodic
and should any other value be provided will default to
non_periodic.

A Greentea test case is also provided to check this works as
expected.
2021-01-06 16:07:04 +00:00
Rajkumar Kanagaraj accf24aeaf CMake: Add CMake support for events greentea test 2021-01-05 09:11:06 -08:00
adbridge 8ab6290f23 Review feedback - capitilise argument descriptions 2020-12-09 16:03:23 +00:00
adbridge 8a5671b1f5 Update Event period and delay parameter comments 2020-11-26 16:04:11 +00:00
adbridge 95f40aa8ff Fix the time units stated in the delay and period functon headers
delay() and period() still stated that the units were milliseconds
whereas in fact they are now a Chrono duration.
2020-11-25 17:34:25 +00:00
Martin Kojtal 57bbb4739b
Merge pull request #13085 from pea-pod/remove-deprecated-mbed-assert
Change MBED_STATIC_ASSERTs version for built-in
2020-11-24 13:38:07 +00:00
Hugues Kamba 794e32df74 CMake: Use relative paths to list source files and directories
The absolute path is still required for listing linker
files as they are referenced from a function in the top
level CMake input source file.
2020-11-09 12:32:30 +00:00
Hugues Kamba bf84a5b329 CMake: Rename CMake targets
* mbed-os renamed mbed-core
* mbed-os-<COMPONENT> renamed mbed-<COMPONENT>
2020-11-06 17:25:22 +00:00
Martin Kojtal 8529e88e61 cmake: fix present inclusion
We use only _PRESENT macros for components if they are enabled. Use the same in
the mbed.h file or anywhere else.
2020-11-06 17:25:21 +00:00
Hugues Kamba fa98689639 CMake: Componentize Mbed OS into multiple CMake targets (#13732)
Aside from the core mbed-os CMake target, a number of targets have been created so they can optionally be included by application executables that require them using `target_link_libraries()`.

Co-authored-by: Martin Kojtal <martin.kojtal@arm.com>
Co-authored-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@arm.com>
2020-11-06 17:25:21 +00:00
Hugues Kamba 8b21238e08 CMake: Fix failure due to events and netsocket dirs changes 2020-11-06 17:25:17 +00:00
Hugues Kamba a63fa605e4 CMake: Add support for events dir 2020-11-06 17:25:15 +00:00
pea-pod 507181d262 Change MBED_STATIC_ASSERTs version for built-in 2020-10-27 08:30:40 -05:00
Harrison Mutai 4fad1112e5 Add SPDX license identifier to Arm files
Add license identifier to files which Arm owns the copyright to,
and contain either BSD-3 or Apache-2.0 licenses. This is to address
license errors raised by scancode analysis.
2020-10-15 10:47:27 +01:00
Martin Kojtal a6ce2c53a0 platform: move internal headers to internal/
They belong to internal folder to follow our guideline, not in source as they were.
2020-08-20 08:58:00 +01:00
George Psimenos fe7ae8a50f Remove deprecated local unit tests 2020-07-28 09:17:19 +01:00
George Psimenos d480fab08b CI & local unit test fixes 2020-07-28 09:17:19 +01:00
George Psimenos 76f37fb2bc Restructure events directory & move tests 2020-07-28 09:17:19 +01:00
Kevin Bracey 0eff3340d2 Add Chrono support to Event/EventQueue 2020-04-27 10:19:08 +03:00