Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/utest/default.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
CONFIG_RT_USING_CI_ACTION=y
CONFIG_RT_CONSOLEBUF_SIZE=1024
# dependencies
CONFIG_RT_CONSOLEBUF_SIZE=1024
CONFIG_RT_USING_CI_ACTION=y
10 changes: 10 additions & 0 deletions .github/utest/dfs/dfs.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# dependencies
CONFIG_RT_CONSOLEBUF_SIZE=1024
CONFIG_RT_NAME_MAX=24
CONFIG_RT_USING_CI_ACTION=y

CONFIG_RT_UTEST_DFS_API_TC=y
CONFIG_RT_UTEST_POSIX_API_TC=y
CONFIG_RT_UTEST_DFS_MNT_PATH=""
CONFIG_RT_UTEST_DFS_FS_TYPE="elm"
CONFIG_RT_UTEST_DFS_BLOCK_DEV="sd0"
7 changes: 3 additions & 4 deletions .github/utest/kernel/object.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
CONFIG_UTEST_OBJECT_TC=y

# dependencies
CONFIG_RT_CONSOLEBUF_SIZE=1024
CONFIG_RT_USING_CI_ACTION=y
CONFIG_RT_USING_DEVICE=y
CONFIG_RT_USING_SEMAPHORE=y
CONFIG_UTEST_OBJECT_TC=y
CONFIG_UTEST_THR_STACK_SIZE=8192
13 changes: 9 additions & 4 deletions .github/workflows/utest_auto_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@ jobs:
config_file:
- "default.cfg"

# kernel
# - "kernel/object.cfg"
include:
# only run on qemu-vexpress-a9
- platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" }
config_file: "kernel/object.cfg"

# cpp11
# - "cpp11/cpp11.cfg"
- platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" }
config_file: "dfs/dfs.cfg"

- platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" }
config_file: "cpp11/cpp11.cfg"

env:
TEST_QEMU_ARCH: ${{ matrix.platform.QEMU_ARCH }}
Expand Down
1 change: 1 addition & 0 deletions Kconfig.utestcases
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ rsource "examples/utest/testcases/perf/Kconfig"
rsource "src/klibc/utest/Kconfig"

rsource "components/drivers/audio/utest/Kconfig"
rsource "components/dfs/utest/Kconfig"

endif

Expand Down
44 changes: 44 additions & 0 deletions components/dfs/utest/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
if RT_USING_DFS
menu "File System Unit Testcase"

config RT_UTEST_TC_USING_DFS_API
bool "DFS API test"
default n
help
Enable DFS native API unit tests including file operations like open,
read, write, close, stat, unlink and rename

if RT_UTEST_TC_USING_DFS_API

config RT_UTEST_TC_USING_POSIX_API
bool "POSIX API test"
default n
depends on RT_USING_POSIX_FS
help
Enable POSIX filesystem API unit tests including file operations,
directory operations, and file permission tests

config RT_UTEST_DFS_MNT_PATH
string "Mount path for DFS test"
default ""
help
Configure the mount point path where the test filesystem will be mounted.
All test files and directories will be created under this path

config RT_UTEST_DFS_FS_TYPE
string "Filesystem type for test"
default "elm"
help
Configure the filesystem type for unit test (e.g., elm, fat).
This will be used for dfs_mkfs() and dfs_mount() operations

config RT_UTEST_DFS_BLOCK_DEV
string "Block device name for test"
default "sd0"
help
Configure the block device name for unit test (e.g., sd0, sd1).
This device will be formatted and mounted during testing

endif
endmenu
endif
20 changes: 20 additions & 0 deletions components/dfs/utest/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Import('rtconfig')
from building import *

cwd = GetCurrentDir()
src = []
CPPPATH = [cwd]

if GetDepend('RT_UTEST_TC_USING_DFS_API'):

# Add DFS API test source if enabled
src += ['tc_dfs_api.c']

# Add POSIX API test source if enabled (requires RT_USING_POSIX_FS)
if GetDepend('RT_UTEST_TC_USING_POSIX_API'):
src += ['tc_posix_api.c']

# Define the test group with proper dependencies
group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES', 'RT_USING_DFS'], CPPPATH = CPPPATH)

Return('group')
Loading