mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
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:
@@ -38,11 +38,11 @@ class RAMFS:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
bdev = RAMFS(50)
|
bdev = RAMFS(50)
|
||||||
|
uos.VfsFat.mkfs(bdev)
|
||||||
except MemoryError:
|
except MemoryError:
|
||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
uos.VfsFat.mkfs(bdev)
|
|
||||||
vfs = uos.VfsFat(bdev)
|
vfs = uos.VfsFat(bdev)
|
||||||
uos.mount(vfs, "/ramdisk")
|
uos.mount(vfs, "/ramdisk")
|
||||||
uos.chdir("/ramdisk")
|
uos.chdir("/ramdisk")
|
||||||
|
|||||||
@@ -38,11 +38,11 @@ class RAMFS:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
bdev = RAMFS(50)
|
bdev = RAMFS(50)
|
||||||
|
uos.VfsFat.mkfs(bdev)
|
||||||
except MemoryError:
|
except MemoryError:
|
||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
uos.VfsFat.mkfs(bdev)
|
|
||||||
vfs = uos.VfsFat(bdev)
|
vfs = uos.VfsFat(bdev)
|
||||||
uos.mount(vfs, "/ramdisk")
|
uos.mount(vfs, "/ramdisk")
|
||||||
uos.chdir("/ramdisk")
|
uos.chdir("/ramdisk")
|
||||||
|
|||||||
@@ -71,5 +71,10 @@ def test(bdev, vfs_class):
|
|||||||
vfs.open("/test", "w").close()
|
vfs.open("/test", "w").close()
|
||||||
|
|
||||||
|
|
||||||
bdev = RAMBlockDevice(30)
|
try:
|
||||||
|
bdev = RAMBlockDevice(30)
|
||||||
|
except MemoryError:
|
||||||
|
print("SKIP")
|
||||||
|
raise SystemExit
|
||||||
|
|
||||||
test(bdev, uos.VfsFat)
|
test(bdev, uos.VfsFat)
|
||||||
|
|||||||
@@ -38,12 +38,11 @@ class RAMFS:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
bdev = RAMFS(50)
|
bdev = RAMFS(50)
|
||||||
|
uos.VfsFat.mkfs(bdev)
|
||||||
except MemoryError:
|
except MemoryError:
|
||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
uos.VfsFat.mkfs(bdev)
|
|
||||||
|
|
||||||
print(b"FOO_FILETXT" not in bdev.data)
|
print(b"FOO_FILETXT" not in bdev.data)
|
||||||
print(b"hello!" not in bdev.data)
|
print(b"hello!" not in bdev.data)
|
||||||
|
|
||||||
|
|||||||
@@ -101,5 +101,10 @@ def test(bdev, vfs_class):
|
|||||||
vfs.umount()
|
vfs.umount()
|
||||||
|
|
||||||
|
|
||||||
bdev = RAMBlockDevice(30)
|
try:
|
||||||
|
bdev = RAMBlockDevice(30)
|
||||||
|
except MemoryError:
|
||||||
|
print("SKIP")
|
||||||
|
raise SystemExit
|
||||||
|
|
||||||
test(bdev, uos.VfsLfs2)
|
test(bdev, uos.VfsLfs2)
|
||||||
|
|||||||
Reference in New Issue
Block a user