Skip to content

Commit

Permalink
tests/extmod: Skip vfs tests if target doesn't have enough memory.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Feb 9, 2023
1 parent b1123a5 commit d99ebb3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/extmod/vfs_fat_fileio1.py
Expand Up @@ -38,11 +38,11 @@ def ioctl(self, op, arg):

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")
Expand Down
2 changes: 1 addition & 1 deletion tests/extmod/vfs_fat_fileio2.py
Expand Up @@ -38,11 +38,11 @@ def ioctl(self, op, arg):

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")
Expand Down
7 changes: 6 additions & 1 deletion tests/extmod/vfs_fat_ilistdir_del.py
Expand Up @@ -71,5 +71,10 @@ def test(bdev, vfs_class):
vfs.open("/test", "w").close()


bdev = RAMBlockDevice(30)
try:
bdev = RAMBlockDevice(30)
except MemoryError:
print("SKIP")
raise SystemExit

test(bdev, uos.VfsFat)
3 changes: 1 addition & 2 deletions tests/extmod/vfs_fat_ramdisk.py
Expand Up @@ -38,12 +38,11 @@ def ioctl(self, op, arg):

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)

Expand Down
7 changes: 6 additions & 1 deletion tests/extmod/vfs_lfs_mtime.py
Expand Up @@ -101,5 +101,10 @@ def test(bdev, vfs_class):
vfs.umount()


bdev = RAMBlockDevice(30)
try:
bdev = RAMBlockDevice(30)
except MemoryError:
print("SKIP")
raise SystemExit

test(bdev, uos.VfsLfs2)

0 comments on commit d99ebb3

Please sign in to comment.