Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2ef3cc4

Browse filesBrowse files
committed
[core][utest] add HIL test cases
1 parent dcb58d7 commit 2ef3cc4
Copy full SHA for 2ef3cc4

File tree

Expand file treeCollapse file tree

2 files changed

+33
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+33
-0
lines changed

‎core/utest/SConscript

Copy file name to clipboardExpand all lines: core/utest/SConscript
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ src = []
55
if GetDepend('RT_USING_CI_ACTION') or GetDepend('RTDUINO_UTEST_CORE'):
66
src += Glob('TC_*.c')
77
src += Glob('TC_*.cpp')
8+
if not GetDepend('RTDUINO_UTEST_HIL'):
9+
SrcRemove(src, Glob('TC_HIL_*.c'))
10+
SrcRemove(src, Glob('TC_HIL_*.cpp'))
811

912
group = DefineGroup('utestcases', src, depend = [''])
1013

‎core/utest/TC_HIL_IO.cpp

Copy file name to clipboard
+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2021-2025, RTduino Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* https://github.com/RTduino/RTduino
7+
* https://gitee.com/rtduino/RTduino
8+
*
9+
* Change Logs:
10+
* Date Author Notes
11+
* 2025-01-04 Meco Man first version
12+
*/
13+
#include <RTduino.h>
14+
#include <utest.h>
15+
16+
static void TC_digital(void)
17+
{
18+
digitalWrite(D3, LOW);
19+
uassert_true(digitalRead(D3) == LOW);
20+
digitalWrite(D3, HIGH);
21+
uassert_true(digitalRead(D3) == HIGH);
22+
}
23+
24+
/* Utest function to run all test cases */
25+
static void utest_do_tc(void)
26+
{
27+
UTEST_UNIT_RUN(TC_digital);
28+
}
29+
30+
UTEST_TC_EXPORT(utest_do_tc, "RTduino.core.HIL.IO", RT_NULL, RT_NULL, 1000);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.