Skip to content

Commit e822ba6

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

File tree

7 files changed

+913
-2
lines changed

7 files changed

+913
-2
lines changed

.github/utest/dfs/dfs.cfg

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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"

.github/workflows/utest_auto_run.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ jobs:
4848
- "default.cfg"
4949

5050
# kernel
51-
# - "kernel/object.cfg"
51+
- "kernel/object.cfg"
52+
53+
# DFSV1/DFSV2
54+
- "kernel/dfs.cfg"
5255

5356
# cpp11
54-
# - "cpp11/cpp11.cfg"
57+
- "cpp11/cpp11.cfg"
5558

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

0 commit comments

Comments
 (0)