Allow benchmarks to be specified by index with --benchmark.

This commit is contained in:
Allison Vacanti
2021-02-10 21:40:39 -05:00
parent 2561816f15
commit 3bc8291b28
2 changed files with 39 additions and 9 deletions

View File

@@ -153,10 +153,19 @@ void test_benchmark_long() // --benchmark
| 8 | 8 | U8 | F64 | 42 | 8 | 3.14 | 'S1' |
)expected";
nvbench::option_parser parser;
parser.parse({"--benchmark", "TestBench"});
const auto test = parser_to_state_string(parser);
ASSERT_MSG(test == ref, "Expected:\n\"{}\"\n\nActual:\n\"{}\"", ref, test);
{
nvbench::option_parser parser;
parser.parse({"--benchmark", "TestBench"});
const auto test = parser_to_state_string(parser);
ASSERT_MSG(test == ref, "Expected:\n\"{}\"\n\nActual:\n\"{}\"", ref, test);
}
{
nvbench::option_parser parser;
parser.parse({"--benchmark", "1"});
const auto test = parser_to_state_string(parser);
ASSERT_MSG(test == ref, "Expected:\n\"{}\"\n\nActual:\n\"{}\"", ref, test);
}
}
void test_benchmark_short() // -b
@@ -175,10 +184,19 @@ void test_benchmark_short() // -b
| 8 | 8 | U8 | F64 | 42 | 8 | 3.14 | 'S1' |
)expected";
nvbench::option_parser parser;
parser.parse({"-b", "TestBench"});
const auto test = parser_to_state_string(parser);
ASSERT_MSG(test == ref, "Expected:\n\"{}\"\n\nActual:\n\"{}\"", ref, test);
{
nvbench::option_parser parser;
parser.parse({"-b", "TestBench"});
const auto test = parser_to_state_string(parser);
ASSERT_MSG(test == ref, "Expected:\n\"{}\"\n\nActual:\n\"{}\"", ref, test);
}
{
nvbench::option_parser parser;
parser.parse({"-b", "1"});
const auto test = parser_to_state_string(parser);
ASSERT_MSG(test == ref, "Expected:\n\"{}\"\n\nActual:\n\"{}\"", ref, test);
}
}
void test_int64_axis_single()