Renamed internal runner field filter -> if_
This makes it more consistent with the actual test field, at the cost of the symbol collision.
This commit is contained in:
@@ -825,7 +825,7 @@ void perm_count(
|
|||||||
|
|
||||||
state->total += 1;
|
state->total += 1;
|
||||||
|
|
||||||
if (case_->filter && !case_->filter()) {
|
if (case_->if_ && !case_->if_()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1365,7 +1365,7 @@ void perm_run(
|
|||||||
bench_step += 1;
|
bench_step += 1;
|
||||||
|
|
||||||
// filter?
|
// filter?
|
||||||
if (case_->filter && !case_->filter()) {
|
if (case_->if_ && !case_->if_()) {
|
||||||
printf("skipped ");
|
printf("skipped ");
|
||||||
perm_printid(suite, case_);
|
perm_printid(suite, case_);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ struct bench_case {
|
|||||||
const bench_define_t *defines;
|
const bench_define_t *defines;
|
||||||
size_t permutations;
|
size_t permutations;
|
||||||
|
|
||||||
bool (*filter)(void);
|
bool (*if_)(void);
|
||||||
void (*run)(struct lfs_config *cfg);
|
void (*run)(struct lfs_config *cfg);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -854,7 +854,7 @@ void perm_count(
|
|||||||
|
|
||||||
state->total += 1;
|
state->total += 1;
|
||||||
|
|
||||||
if (case_->filter && !case_->filter()) {
|
if (case_->if_ && !case_->if_()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1951,7 +1951,7 @@ void perm_run(
|
|||||||
test_step += 1;
|
test_step += 1;
|
||||||
|
|
||||||
// filter?
|
// filter?
|
||||||
if (case_->filter && !case_->filter()) {
|
if (case_->if_ && !case_->if_()) {
|
||||||
printf("skipped ");
|
printf("skipped ");
|
||||||
perm_printid(suite, case_, NULL, 0);
|
perm_printid(suite, case_, NULL, 0);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ struct test_case {
|
|||||||
const test_define_t *defines;
|
const test_define_t *defines;
|
||||||
size_t permutations;
|
size_t permutations;
|
||||||
|
|
||||||
bool (*filter)(void);
|
bool (*if_)(void);
|
||||||
void (*run)(struct lfs_config *cfg);
|
void (*run)(struct lfs_config *cfg);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -390,9 +390,9 @@ def compile(bench_paths, **args):
|
|||||||
f.writeln('}')
|
f.writeln('}')
|
||||||
f.writeln()
|
f.writeln()
|
||||||
|
|
||||||
# create case filter function
|
# create case if function
|
||||||
if suite.if_ or case.if_:
|
if suite.if_ or case.if_:
|
||||||
f.writeln('bool __bench__%s__filter(void) {'
|
f.writeln('bool __bench__%s__if(void) {'
|
||||||
% (case.name))
|
% (case.name))
|
||||||
for if_ in it.chain(suite.if_, case.if_):
|
for if_ in it.chain(suite.if_, case.if_):
|
||||||
f.writeln(4*' '+'if (!(%s)) return false;' % (
|
f.writeln(4*' '+'if (!(%s)) return false;' % (
|
||||||
@@ -450,7 +450,7 @@ def compile(bench_paths, **args):
|
|||||||
'void *data, size_t i);'
|
'void *data, size_t i);'
|
||||||
% (case.name, k, i))
|
% (case.name, k, i))
|
||||||
if suite.if_ or case.if_:
|
if suite.if_ or case.if_:
|
||||||
f.writeln('extern bool __bench__%s__filter('
|
f.writeln('extern bool __bench__%s__if('
|
||||||
'void);'
|
'void);'
|
||||||
% (case.name))
|
% (case.name))
|
||||||
f.writeln('extern void __bench__%s__run('
|
f.writeln('extern void __bench__%s__run('
|
||||||
@@ -510,7 +510,7 @@ def compile(bench_paths, **args):
|
|||||||
f.writeln(12*' '+'.permutations = %d,'
|
f.writeln(12*' '+'.permutations = %d,'
|
||||||
% len(case.permutations))
|
% len(case.permutations))
|
||||||
if suite.if_ or case.if_:
|
if suite.if_ or case.if_:
|
||||||
f.writeln(12*' '+'.filter = __bench__%s__filter,'
|
f.writeln(12*' '+'.if_ = __bench__%s__if,'
|
||||||
% (case.name))
|
% (case.name))
|
||||||
f.writeln(12*' '+'.run = __bench__%s__run,'
|
f.writeln(12*' '+'.run = __bench__%s__run,'
|
||||||
% (case.name))
|
% (case.name))
|
||||||
|
|||||||
+4
-4
@@ -395,9 +395,9 @@ def compile(test_paths, **args):
|
|||||||
f.writeln('}')
|
f.writeln('}')
|
||||||
f.writeln()
|
f.writeln()
|
||||||
|
|
||||||
# create case filter function
|
# create case if function
|
||||||
if suite.if_ or case.if_:
|
if suite.if_ or case.if_:
|
||||||
f.writeln('bool __test__%s__filter(void) {'
|
f.writeln('bool __test__%s__if(void) {'
|
||||||
% (case.name))
|
% (case.name))
|
||||||
for if_ in it.chain(suite.if_, case.if_):
|
for if_ in it.chain(suite.if_, case.if_):
|
||||||
f.writeln(4*' '+'if (!(%s)) return false;' % (
|
f.writeln(4*' '+'if (!(%s)) return false;' % (
|
||||||
@@ -455,7 +455,7 @@ def compile(test_paths, **args):
|
|||||||
'void *data, size_t i);'
|
'void *data, size_t i);'
|
||||||
% (case.name, k, i))
|
% (case.name, k, i))
|
||||||
if suite.if_ or case.if_:
|
if suite.if_ or case.if_:
|
||||||
f.writeln('extern bool __test__%s__filter('
|
f.writeln('extern bool __test__%s__if('
|
||||||
'void);'
|
'void);'
|
||||||
% (case.name))
|
% (case.name))
|
||||||
f.writeln('extern void __test__%s__run('
|
f.writeln('extern void __test__%s__run('
|
||||||
@@ -517,7 +517,7 @@ def compile(test_paths, **args):
|
|||||||
f.writeln(12*' '+'.permutations = %d,'
|
f.writeln(12*' '+'.permutations = %d,'
|
||||||
% len(case.permutations))
|
% len(case.permutations))
|
||||||
if suite.if_ or case.if_:
|
if suite.if_ or case.if_:
|
||||||
f.writeln(12*' '+'.filter = __test__%s__filter,'
|
f.writeln(12*' '+'.if_ = __test__%s__if,'
|
||||||
% (case.name))
|
% (case.name))
|
||||||
f.writeln(12*' '+'.run = __test__%s__run,'
|
f.writeln(12*' '+'.run = __test__%s__run,'
|
||||||
% (case.name))
|
% (case.name))
|
||||||
|
|||||||
Reference in New Issue
Block a user