Add a simple benchmark for scaling images.
[dcpomatic.git] / run / benchmark
1 #!/bin/bash
2 #
3 # run/benchmark <name>
4
5 executable=build/benchmark/$1
6
7 if [ "$1" == "--debug" ]; then
8     shift;
9     gdb --args $executable --catch_system_errors=no --log_level=test_suite 
10 elif [ "$1" == "--backtrace" ]; then
11     shift;
12     gdb -batch -ex "run" -ex "thread apply all bt" -return-child-result --args $executable --catch_system_errors=yes 
13 elif [ "$1" == "--valgrind" ]; then
14     shift;
15     valgrind --tool="memcheck" --suppressions=suppressions $executable 
16 elif [ "$1" == "--callgrind" ]; then
17     shift;
18     valgrind --tool="callgrind" $executable 
19 elif [ "$1" == "--quiet" ]; then
20     shift;
21     $executable --catch_system_errors=no 
22 elif [ "$1" == "--drd" ]; then
23     shift;
24     valgrind --tool="drd" $executable 
25 elif [ "$1" == "--helgrind" ]; then
26     shift;
27     valgrind --tool="helgrind" $executable 
28 else
29     ulimit -c unlimited
30     $executable --catch_system_errors=no --log_level=test_suite
31 fi