Skip to content

Commit c6e9aaa

Browse files
committed
[add][testcases]add filesystem(dfs api & posix api) testcase.
1 parent 746d989 commit c6e9aaa

File tree

8 files changed

+915
-5
lines changed

8 files changed

+915
-5
lines changed

.github/utest/dfs/dfs.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CONFIG_UTEST_OBJECT_TC=y
2+
3+
# dependencies
4+
CONFIG_RT_USING_CI_ACTION=y
5+
CONFIG_RT_CONSOLEBUF_SIZE=1024
6+
7+
CONFIG_RT_UTEST_DFS_API_TC=y
8+
CONFIG_RT_UTEST_POSIX_API_TC=y
9+
CONFIG_RT_UTEST_DFS_MNT_PATH=""
10+
CONFIG_RT_UTEST_DFS_FS_TYPE="elm"
11+
CONFIG_RT_UTEST_DFS_BLOCK_DEV="sd0"
12+
CONFIG_RT_NAME_MAX=24

.github/utest/kernel/object.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ CONFIG_UTEST_OBJECT_TC=y
44
CONFIG_RT_USING_CI_ACTION=y
55
CONFIG_RT_USING_DEVICE=y
66
CONFIG_RT_USING_SEMAPHORE=y
7+
CONFIG_RT_NAME_MAX=24

.github/workflows/utest_auto_run.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ jobs:
4646

4747
config_file:
4848
- "default.cfg"
49+
- "kernel/object.cfg"
4950

50-
# kernel
51-
# - "kernel/object.cfg"
52-
53-
# cpp11
54-
# - "cpp11/cpp11.cfg"
51+
include:
52+
# dfs.cfg only run on qemu-vexpress-a9
53+
- platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" }
54+
config_file: "dfs/dfs.cfg"
55+
config_file: "cpp11/cpp11.cfg"
5556

5657
env:
5758
TEST_QEMU_ARCH: ${{ matrix.platform.QEMU_ARCH }}

Kconfig.utestcases

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ rsource "examples/utest/testcases/perf/Kconfig"
2222
rsource "src/klibc/utest/Kconfig"
2323

2424
rsource "components/drivers/audio/utest/Kconfig"
25+
rsource "components/dfs/utest/Kconfig"
2526

2627
endif
2728

components/dfs/utest/Kconfig

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
if RT_USING_DFS
2+
menu "File System Unit Testcase"
3+
4+
config RT_UTEST_DFS_API_TC
5+
bool "DFS API test"
6+
default n
7+
help
8+
Enable DFS API testcase
9+
10+
if RT_UTEST_DFS_API_TC
11+
12+
config RT_UTEST_POSIX_API_TC
13+
bool "POSIX API test"
14+
default n
15+
depends on RT_USING_POSIX_FS
16+
help
17+
Enable POSIX API testcase
18+
19+
config RT_UTEST_DFS_MNT_PATH
20+
string "Mount path for DFS test"
21+
default ""
22+
help
23+
The mount path for filesystem test
24+
25+
config RT_UTEST_DFS_FS_TYPE
26+
string "Filesystem type for test"
27+
default "elm"
28+
help
29+
The filesystem type (e.g., elm, fat)
30+
31+
config RT_UTEST_DFS_BLOCK_DEV
32+
string "Block device name for test"
33+
default "sd0"
34+
help
35+
The block device name (e.g., sd0, ram0)
36+
37+
endif
38+
endmenu
39+
endif

components/dfs/utest/SConscript

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Import('rtconfig')
2+
from building import *
3+
4+
cwd = GetCurrentDir()
5+
src = []
6+
CPPPATH = [cwd]
7+
8+
if GetDepend('RT_UTEST_DFS_API_TC'):
9+
10+
# Add DFS API test source if enabled
11+
src += ['tc_dfs_api.c']
12+
13+
# Add POSIX API test source if enabled (requires RT_USING_POSIX_FS)
14+
if GetDepend('RT_UTEST_POSIX_API_TC'):
15+
src += ['tc_posix_api.c']
16+
17+
# Define the test group with proper dependencies
18+
group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES', 'RT_USING_DFS'], CPPPATH = CPPPATH)
19+
20+
Return('group')

0 commit comments

Comments
 (0)