From 79ca4f19f9b13c29921a0416f08c3d97cb6e04b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sami=20Ky=C3=B6stil=C3=A4?= Date: Wed, 9 Dec 2009 11:22:45 +0200 Subject: [PATCH] Added option to list all tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Sami Kyöstilä --- glmemperf.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/glmemperf.cpp b/glmemperf.cpp index 82a6ab4..0a0f1cc 100644 --- a/glmemperf.cpp +++ b/glmemperf.cpp @@ -54,6 +54,7 @@ static struct int bitsPerPixel; bool verbose; int minTime; + bool listTests; std::list includedTests; std::list excludedTests; } options; @@ -196,6 +197,12 @@ void runTest(Test& test) int64_t minTime = options.minTime * 1000 * 1000 * 1000LL; struct timespec res, start, end; + if (options.listTests) + { + printf("%s\n", test.name().c_str()); + return; + } + if (!shouldRunTest(test.name())) { return; @@ -292,6 +299,7 @@ void showUsage() "Options:\n" " -h This text\n" " -v Verbose mode\n" + " -l List all tests without running them\n" " -i TEST Include a specific test (full name or substring)\n" " -e TEST Exclude a specific test (full name or substring)\n" " -t SECS Minimum time to run each test\n" @@ -306,6 +314,7 @@ void parseArguments(const std::list& args) options.verbose = false; options.minTime = 1; options.bitsPerPixel = 16; + options.listTests = false; for (i = args.begin(), i++; i != args.end(); ++i) { @@ -334,6 +343,10 @@ void parseArguments(const std::list& args) { options.verbose = true; } + else if (*i == "-l") + { + options.listTests = true; + } else { std::cerr << "Invalid option: " << *i << std::endl; -- 1.7.9.5