From 7a104d2793ed0fde70b2ce3185823912d2455075 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Wed, 19 Jun 2013 18:47:15 +0400 Subject: [PATCH] Added an option to print available implementation variants. --- modules/ts/src/ts_perf.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/ts/src/ts_perf.cpp b/modules/ts/src/ts_perf.cpp index e61878e..c2c1ee6 100644 --- a/modules/ts/src/ts_perf.cpp +++ b/modules/ts/src/ts_perf.cpp @@ -646,6 +646,7 @@ void TestBase::Init(const std::vector & availableImpls, "{ |perf_verify_sanity |false |fail tests having no regression data for sanity checks}" "{ |perf_impl |" + available_impls[0] + "|the implementation variant of functions under test}" + "{ |perf_list_impls |false |list available implementation variants and exit}" "{ |perf_run_cpu |false |deprecated, equivalent to --perf_impl=plain}" #ifdef ANDROID "{ |perf_time_limit |6.0 |default time limit for a single test (in seconds)}" @@ -687,6 +688,19 @@ void TestBase::Init(const std::vector & availableImpls, log_power_checkpoints = args.get("perf_log_power_checkpoints"); #endif + bool param_list_impls = args.get("perf_list_impls"); + + if (param_list_impls) + { + fputs("Available implementation variants:", stdout); + for (size_t i = 0; i < available_impls.size(); ++i) { + putchar(' '); + fputs(available_impls[i].c_str(), stdout); + } + putchar('\n'); + exit(0); + } + if (std::find(available_impls.begin(), available_impls.end(), param_impl) == available_impls.end()) { printf("No such implementation: %s\n", param_impl.c_str()); -- 2.7.4