Skip to content

Commit 688fbe7

Browse files
committed
Enabled the sleep,sleep_manager,watchdog_reset test case for bare metal greentea test
1 parent f1139eb commit 688fbe7

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

TESTS/mbed_hal/sleep/main.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
17-
#if !defined(MBED_CONF_RTOS_PRESENT)
18-
#error [NOT_SUPPORTED] sleep test cases requires RTOS to run.
19-
#else
20-
2116
#if !DEVICE_SLEEP
2217
#error [NOT_SUPPORTED] sleep not supported for this target
2318
#else
@@ -220,7 +215,9 @@ utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
220215
{
221216
GREENTEA_SETUP(60, "default_auto");
222217
/* Suspend RTOS Kernel to enable sleep modes. */
218+
#if defined(MBED_CONF_RTOS_PRESENT)
223219
osKernelSuspend();
220+
#endif
224221
#if DEVICE_LPTICKER
225222
ticker_suspend(get_lp_ticker_data());
226223
#if DEVICE_LPTICKER && (LPTICKER_DELAY_TICKS > 0)
@@ -246,8 +243,9 @@ void greentea_test_teardown(const size_t passed, const size_t failed, const fail
246243
#endif
247244
ticker_resume(get_lp_ticker_data());
248245
#endif
246+
#if defined(MBED_CONF_RTOS_PRESENT)
249247
osKernelResume(0);
250-
248+
#endif
251249
greentea_test_teardown_handler(passed, failed, failure);
252250
}
253251

@@ -267,4 +265,3 @@ int main()
267265
}
268266

269267
#endif // !DEVICE_SLEEP
270-
#endif // !defined(MBED_CONF_RTOS_PRESENT)

TESTS/mbed_hal/sleep_manager/main.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
#if !defined(MBED_CONF_RTOS_PRESENT)
17-
#error [NOT_SUPPORTED] sleep manager test cases requires RTOS to run.
18-
#else
19-
2016
#include "utest/utest.h"
2117
#include "unity/unity.h"
2218
#include "greentea-client/test_env.h"
@@ -92,7 +88,9 @@ void test_lock_eq_ushrt_max()
9288
utest::v1::status_t testcase_setup(const Case *const source, const size_t index_of_case)
9389
{
9490
// Suspend the RTOS kernel scheduler to prevent interference with duration of sleep.
91+
#if defined(MBED_RTOS_PRESENT)
9592
osKernelSuspend();
93+
#endif
9694
#if DEVICE_LPTICKER
9795
ticker_suspend(get_lp_ticker_data());
9896
#if (LPTICKER_DELAY_TICKS > 0)
@@ -119,7 +117,9 @@ utest::v1::status_t testcase_teardown(const Case *const source, const size_t pas
119117
#endif
120118
ticker_resume(get_lp_ticker_data());
121119
#endif
120+
#if defined(MBED_RTOS_PRESENT)
122121
osKernelResume(0);
122+
#endif
123123
return utest::v1::greentea_case_teardown_handler(source, passed, failed, failure);
124124
}
125125

@@ -340,4 +340,3 @@ int main()
340340
}
341341

342342
#endif // !DEVICE_SLEEP
343-
#endif // !defined(MBED_CONF_RTOS_PRESENT)

TESTS/mbed_hal/watchdog_reset/main.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
#if !defined(MBED_CONF_RTOS_PRESENT)
18-
#error [NOT_SUPPORTED] Watchdog reset test cases requires RTOS to run.
19-
#else
20-
2117
#if !DEVICE_WATCHDOG
2218
#error [NOT_SUPPORTED] Watchdog not supported for this target
2319
#else
@@ -325,4 +321,3 @@ int main()
325321
}
326322

327323
#endif // !DEVICE_WATCHDOG
328-
#endif // !defined(MBED_CONF_RTOS_PRESENT)

0 commit comments

Comments
 (0)