diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 188: Main: If benchmark list contains only option-setting descriptions, add the default benchmarks.

Message ID 20120117154613.4137.60598.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org Jan. 17, 2012, 3:46 p.m. UTC
------------------------------------------------------------
revno: 188
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Tue 2012-01-17 17:44:04 +0200
message:
  Main: If benchmark list contains only option-setting descriptions, add the default benchmarks.
  
  This allows easy access to the default benchmarks, while changing some 
  option for all of them e.g. 'glmark2 -b :duration=3.0'
modified:
  src/main.cpp


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/main.cpp'
--- src/main.cpp	2011-12-13 14:27:23 +0000
+++ src/main.cpp	2012-01-17 15:44:04 +0000
@@ -116,6 +116,21 @@ 
     }
 }
 
+static bool
+benchmarks_contain_normal_scenes(vector<Benchmark *> &benchmarks)
+{
+    for (vector<Benchmark *>::const_iterator bench_iter = benchmarks.begin();
+         bench_iter != benchmarks.end();
+         bench_iter++)
+    {
+        const Benchmark *bench = *bench_iter;
+        if (!bench->scene().name().empty())
+            return true;
+    }
+
+    return false;
+}
+
 static void
 list_scenes()
 {
@@ -300,7 +315,8 @@ 
         add_custom_benchmarks(benchmarks);
     else if (!Options::benchmark_files.empty())
         add_custom_benchmarks_from_files(benchmarks);
-    else
+
+    if (!benchmarks_contain_normal_scenes(benchmarks))
         add_default_benchmarks(benchmarks);
 
     Log::info("=======================================================\n");