X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=glmemperf.cpp;fp=glmemperf.cpp;h=0a0f1ccc2bc1a1a585e379837e644009656ea2aa;hb=79ca4f19f9b13c29921a0416f08c3d97cb6e04b4;hp=82a6ab4fb72e0d75938476854b1b359c33ad1e0f;hpb=c72807863fcff447f59b9b52d066ddf32676936d;p=glmemperf 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;