Fix progress display for inactive type axis values.

When type axis values were disabled they were still counted towards
a benchmark's total number of configs.
This commit is contained in:
Allison Vacanti
2021-12-21 20:36:52 -05:00
parent 0f5c8624f6
commit c9ab8e2eb3
4 changed files with 38 additions and 7 deletions

View File

@@ -286,6 +286,23 @@ void test_clone()
ASSERT(clone->get_states().empty());
}
void test_get_config_count()
{
lots_of_types_bench bench;
bench.set_type_axes_names({"Integer", "Float", "Other"});
bench.get_axes().get_type_axis(0).set_active_inputs({"I16", "I32"}); // 2, 2
bench.get_axes().get_type_axis(1).set_active_inputs({"F32", "F64"}); // 2, 4
bench.get_axes().get_type_axis(2).set_active_inputs({"bool"}); // 1, 4
bench.add_float64_axis("foo", {0.4, 2.3, 4.3}); // 3, 12
bench.add_int64_axis("bar", {4, 6, 15}); // 3, 36
bench.add_string_axis("baz", {"str", "ing"}); // 2, 72
bench.add_string_axis("baz", {"single"}); // 1, 72
ASSERT_MSG(bench.get_config_count() == 72,
"Got {}",
bench.get_config_count());
}
int main()
{
test_type_axes();
@@ -296,4 +313,5 @@ int main()
test_string_axes();
test_run();
test_clone();
test_get_config_count();
}