mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 16:14:16 +01:00 
			
		
		
		
	Added reentrant and gdb testing mechanisms to test framework
Aside from reworking the internals of test_.py to work well with inherited TestCase classes, this also provides the two main features that were the main reason for revamping the test framework 1. ./scripts/test_.py --reentrant Runs reentrant tests (tests with reentrant=true in the .toml configuration) under gdb such that the program is killed on every call to lfs_emubd_prog or lfs_emubd_erase. Currently this just increments a number of prog/erases to skip, which means it doesn't necessarily check every possible branch of the test, but this should still provide a good coverage of power-loss tests. 2. ./scripts/test_.py --gdb Run the tests and if a failure is hit, drop into GDB. In theory this will be very useful for reproducing and debugging test failures. Note this can be combined with --reentrant to drop into GDB on the exact cycle of power-loss where the tests fail.
This commit is contained in:
		| @@ -10,6 +10,17 @@ code = """ | ||||
|     lfs_unmount(&lfs) => 0; | ||||
| """ | ||||
|  | ||||
| [[case]] # reentrant format | ||||
| code = """ | ||||
|     int err = lfs_mount(&lfs, &cfg); | ||||
|     if (err) { | ||||
|         lfs_format(&lfs, &cfg) => 0; | ||||
|         lfs_mount(&lfs, &cfg) => 0; | ||||
|     } | ||||
|     lfs_unmount(&lfs) => 0; | ||||
| """ | ||||
| reentrant = true | ||||
|  | ||||
| [[case]] # root | ||||
| code = """ | ||||
|     lfs_format(&lfs, &cfg) => 0; | ||||
| @@ -53,7 +64,7 @@ code = """ | ||||
|     } | ||||
|     lfs_dir_read(&lfs, &dir, &info) => 0; | ||||
|     lfs_dir_close(&lfs, &dir) => 0; | ||||
|     lfs_unmount(&lfs); | ||||
|     lfs_unmount(&lfs) => 0; | ||||
| """ | ||||
| define.N = 'range(0, 100, 3)' | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user