tests/extmod: Skip vfs tests if target doesn't have enough memory.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2023-02-09 15:21:57 +11:00
parent b1123a54c1
commit d99ebb310c
5 changed files with 15 additions and 6 deletions

View File

@ -38,11 +38,11 @@ class RAMFS:
try:
bdev = RAMFS(50)
uos.VfsFat.mkfs(bdev)
except MemoryError:
print("SKIP")
raise SystemExit
uos.VfsFat.mkfs(bdev)
vfs = uos.VfsFat(bdev)
uos.mount(vfs, "/ramdisk")
uos.chdir("/ramdisk")

View File

@ -38,11 +38,11 @@ class RAMFS:
try:
bdev = RAMFS(50)
uos.VfsFat.mkfs(bdev)
except MemoryError:
print("SKIP")
raise SystemExit
uos.VfsFat.mkfs(bdev)
vfs = uos.VfsFat(bdev)
uos.mount(vfs, "/ramdisk")
uos.chdir("/ramdisk")

View File

@ -71,5 +71,10 @@ def test(bdev, vfs_class):
vfs.open("/test", "w").close()
try:
bdev = RAMBlockDevice(30)
except MemoryError:
print("SKIP")
raise SystemExit
test(bdev, uos.VfsFat)

View File

@ -38,12 +38,11 @@ class RAMFS:
try:
bdev = RAMFS(50)
uos.VfsFat.mkfs(bdev)
except MemoryError:
print("SKIP")
raise SystemExit
uos.VfsFat.mkfs(bdev)
print(b"FOO_FILETXT" not in bdev.data)
print(b"hello!" not in bdev.data)

View File

@ -101,5 +101,10 @@ def test(bdev, vfs_class):
vfs.umount()
try:
bdev = RAMBlockDevice(30)
except MemoryError:
print("SKIP")
raise SystemExit
test(bdev, uos.VfsLfs2)