Added permutations and ranges to test defines
This is really more work for the bench runner. With this change defines can be manipulated at a rather high level at runtime. Which should be useful for generating benchmarks across various dimensions. The define grammar in the test_runner is now a bit more powerful, accepting: 1. A single value: -DN=42 2. A list of values, which get permuted: -DN=1,2,3 3. A range: -DN=range(10) 4. Some combo: -DN=1,2,range(3,0,-1) This is more complex in the test .toml defines, which can also be C expressions: 1. A single value: define=42 2. A single expression: define='42*42' 3. A list: define=[1,2,3] 4. A comma separated string: define='1,2,3' 5. A range: define='42*range(10)' 6. This mess: define=[1,2,'3,4,range(2)*range(2)+3']
This commit is contained in:
@@ -18,7 +18,7 @@ code = '''
|
||||
'''
|
||||
|
||||
[cases.many_dir_creation]
|
||||
defines.N = [3,6,9,12,21,33,57,66,72,93,99]
|
||||
defines.N = 'range(3, 100, 3)'
|
||||
if = 'N < BLOCK_COUNT/2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
@@ -55,7 +55,7 @@ code = '''
|
||||
'''
|
||||
|
||||
[cases.many_dir_removal]
|
||||
defines.N = [3,6,9,12,21,33,57,66,72,93,99]
|
||||
defines.N = 'range(3, 100, 11)'
|
||||
if = 'N < BLOCK_COUNT/2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
@@ -112,7 +112,7 @@ code = '''
|
||||
'''
|
||||
|
||||
[cases.many_dir_rename]
|
||||
defines.N = [3,6,9,12,21,33,57,66,72,93,99]
|
||||
defines.N = 'range(3, 100, 11)'
|
||||
if = 'N < BLOCK_COUNT/2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
@@ -266,7 +266,7 @@ code = '''
|
||||
'''
|
||||
|
||||
[cases.file_creation]
|
||||
defines.N = [3,6,9,12,21,33,57,66,72,93,99]
|
||||
defines.N = 'range(3, 100, 11)'
|
||||
if = 'N < BLOCK_COUNT/2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
@@ -306,7 +306,7 @@ code = '''
|
||||
'''
|
||||
|
||||
[cases.file_removal]
|
||||
defines.N = [3,6,9,12,21,33,57,66,72,93,99]
|
||||
defines.N = 'range(3, 100, 11)'
|
||||
if = 'N < BLOCK_COUNT/2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
@@ -366,7 +366,7 @@ code = '''
|
||||
'''
|
||||
|
||||
[cases.file_rename]
|
||||
defines.N = [3,6,9,12,21,33,57,66,72,93,99]
|
||||
defines.N = 'range(3, 100, 11)'
|
||||
if = 'N < BLOCK_COUNT/2'
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
|
||||
@@ -1586,7 +1586,7 @@ code = '''
|
||||
# move fix in relocation
|
||||
[cases.move_fix_relocation]
|
||||
in = "lfs.c"
|
||||
defines.RELOCATIONS = [0x0, 0x1, 0x2, 0x3]
|
||||
defines.RELOCATIONS = 'range(4)'
|
||||
defines.ERASE_CYCLES = 0xffffffff
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
@@ -1731,7 +1731,7 @@ code = '''
|
||||
# move fix in relocation with predecessor
|
||||
[cases.move_fix_relocation_predecessor]
|
||||
in = "lfs.c"
|
||||
defines.RELOCATIONS = [0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7]
|
||||
defines.RELOCATIONS = 'range(8)'
|
||||
defines.ERASE_CYCLES = 0xffffffff
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
|
||||
@@ -285,7 +285,7 @@ code = '''
|
||||
|
||||
# more aggressive general truncation tests
|
||||
[cases.aggressive_truncate]
|
||||
defines.CONFIG = [0,1,2,3,4,5]
|
||||
defines.CONFIG = 'range(6)'
|
||||
defines.SMALLSIZE = 32
|
||||
defines.MEDIUMSIZE = 2048
|
||||
defines.LARGESIZE = 8192
|
||||
|
||||
Reference in New Issue
Block a user