diff --git a/.github/workflows/basic_checks.yml b/.github/workflows/basic_checks.yml index f476d18..3ec2e19 100644 --- a/.github/workflows/basic_checks.yml +++ b/.github/workflows/basic_checks.yml @@ -1,4 +1,4 @@ -# This workflow performs the checks like license check, + This workflow performs the checks like license check, # doxygen, unit tests etc. name: Basic Checks diff --git a/.github/workflows/host_tests.yml b/.github/workflows/host_tests.yml deleted file mode 100644 index 57fc1d9..0000000 --- a/.github/workflows/host_tests.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Run host tests with CMake - -on: [pull_request] - -jobs: - host-tests: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install dev tools - run: sudo apt-get install -y cmake ninja-build - - - name: Compile and test for host - run: | - mkdir __build && cd __build - cmake .. -GNinja -DMBED_BUILD_GREENTEA_TESTS=FALSE -DMBED_ENABLE_TESTING=TRUE - ninja - ctest . --output-on-failure diff --git a/drivers/tests/UNITTESTS/doubles/CMakeLists.txt b/drivers/tests/UNITTESTS/doubles/CMakeLists.txt index 042d02c..3873703 100644 --- a/drivers/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/drivers/tests/UNITTESTS/doubles/CMakeLists.txt @@ -31,4 +31,5 @@ mbed-headers-hal mbed-headers-drivers mbed-headers-platform + mbed-stubs-rtos ) diff --git a/events/include/events/internal/equeue_platform.h b/events/include/events/internal/equeue_platform.h index 24e95a0..10c7710 100644 --- a/events/include/events/internal/equeue_platform.h +++ b/events/include/events/internal/equeue_platform.h @@ -48,7 +48,7 @@ // Platform includes #if defined(EQUEUE_PLATFORM_POSIX) #include -#elif defined(EQUEUE_PLATFORM_MBED) && defined(MBED_CONF_RTOS_PRESENT) +#elif defined(EQUEUE_PLATFORM_MBED) #include "cmsis_os2.h" #include "mbed_rtos_storage.h" #endif @@ -118,12 +118,9 @@ typedef struct equeue_sema { // We will actually store a C++ rtos:EventQueue in here; // attempt to match layout for storage, and assert size in equeue_mbed.cpp -#if MBED_CONF_RTOS_PRESENT osEventFlagsId_t _id; mbed_rtos_storage_event_flags_t _obj_mem; -#else uint32_t _flags; -#endif } equeue_sema_t; #elif defined(EQUEUE_PLATFORM_MBED) typedef int equeue_sema_t; diff --git a/platform/tests/UNITTESTS/doubles/CMakeLists.txt b/platform/tests/UNITTESTS/doubles/CMakeLists.txt index 827466b..e3c21e5 100644 --- a/platform/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/platform/tests/UNITTESTS/doubles/CMakeLists.txt @@ -41,5 +41,6 @@ PUBLIC mbed-headers-hal mbed-headers-platform + mbed-stubs-rtos gmock_main ) diff --git a/rtos/source/Mutex.cpp b/rtos/source/Mutex.cpp index 4902938..9a0e888 100644 --- a/rtos/source/Mutex.cpp +++ b/rtos/source/Mutex.cpp @@ -27,8 +27,7 @@ #include "platform/mbed_error.h" #include "platform/mbed_assert.h" -namespace rtos -{ +namespace rtos { #if MBED_CONF_RTOS_PRESENT // Actual Mutex implementation, enabled in Mbed OS diff --git a/rtos/tests/UNITTESTS/doubles/CMakeLists.txt b/rtos/tests/UNITTESTS/doubles/CMakeLists.txt index 70d414e..1dcd44d 100644 --- a/rtos/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/rtos/tests/UNITTESTS/doubles/CMakeLists.txt @@ -15,6 +15,7 @@ target_include_directories(mbed-stubs-rtos INTERFACE . + rtos ) target_compile_definitions(mbed-stubs-rtos @@ -40,4 +41,5 @@ mbed-headers-platform mbed-headers-drivers mbed-headers-hal + mbed-headers-cmsis ) diff --git a/rtos/tests/UNITTESTS/doubles/rtos/mbed_rtos_types.h b/rtos/tests/UNITTESTS/doubles/rtos/mbed_rtos_types.h new file mode 100644 index 0000000..c5593bf --- /dev/null +++ b/rtos/tests/UNITTESTS/doubles/rtos/mbed_rtos_types.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022, Arm Limited and affiliates. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _MBED_RTOS_TYPES_H +#define _MBED_RTOS_TYPES_H + +#include "cmsis_os2.h" + +#endif //_MBED_RTOS_TYPES_H diff --git a/storage/blockdevice/tests/UNITTESTS/doubles/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/doubles/CMakeLists.txt index bd1295d..74e7081 100644 --- a/storage/blockdevice/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/doubles/CMakeLists.txt @@ -34,4 +34,5 @@ PRIVATE mbed-headers-platform mbed-headers-blockdevice + mbed-stubs-rtos )