runners: Reworked test/bench for out-of-tree extensions
The main changes:
- Added TEST_DEFINES and BENCH_DEFINES to allow overriding the default
test/bench define header:
-DTEST_DEFINES=my_test_defines.h
Note these are VERY different from LFS_DEFINES upstream. They aren't a
typical header file, and are included multiple times with various
query macros.
It's hacky, but works surprisingly well.
Or maybe I'll just do anything to avoid having to write multiline
macros. Ugh, backslashes.
- Moved more logic into bench/test_defines.h, including everything
needed to integrate other filesystems out-of-tree.
This mostly meant moving all of the cfg initialization logic into its
own query macro (replacing the BENCH/TEST_CFG field macros).
But this also includes a bunch of small tweaks encountered while trying
to get external benchmarks running again.
The external benchmarks include several other filesystems (littlefs2,
SPIFFS, Yaffs2), and I'm hoping this injectable/queryable header thing
will do a good job at avoiding a maintenance headache. (At least a
better job than forking bench_runner.c, which was the previous
solution.)
This commit is contained in:
+2
-2
@@ -495,7 +495,7 @@ def compile(test_paths, **args):
|
||||
# create case run function
|
||||
f.writeln('void __test__%s__run('
|
||||
'__attribute__((unused)) '
|
||||
'struct lfs3_cfg *CFG) {' % (
|
||||
'const struct lfs3_cfg *CFG) {' % (
|
||||
case.name))
|
||||
f.writeln(4*' '+'// test case %s' % case.name)
|
||||
if case.code_lineno is not None:
|
||||
@@ -562,7 +562,7 @@ def compile(test_paths, **args):
|
||||
'void);' % (
|
||||
case.name))
|
||||
f.writeln('extern void __test__%s__run('
|
||||
'struct lfs3_cfg *CFG);' % (
|
||||
'const struct lfs3_cfg *CFG);' % (
|
||||
case.name))
|
||||
f.writeln()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user