perf-test: add argument parsing for performance tests
authorDavid Bremner <bremner@debian.org>
Mon, 3 Dec 2012 23:56:20 +0000 (19:56 -0400)
committerDavid Bremner <bremner@debian.org>
Sat, 15 Dec 2012 02:23:55 +0000 (22:23 -0400)
This patch just sets (non-exported) variables. The variable $debug is
already used, and $corpus_size will be used in following commits.

performance-test/perf-test-lib.sh

index fb15028fbd6712285956aa2898f8e98234effc57..3a4a23dceea98d2194efeee398630fc6d17d080f 100644 (file)
@@ -1,5 +1,30 @@
 . ./version.sh
 
+corpus_size=large
+
+while test "$#" -ne 0
+do
+       case "$1" in
+       -d|--debug)
+               debug=t;
+               shift
+               ;;
+       -s|--small)
+               corpus_size=small;
+               shift
+               ;;
+       -m|--medium)
+               corpus_size=medium;
+               shift
+               ;;
+       -l|--large)
+               corpus_size=large;
+               shift
+               ;;
+       *)
+               echo "error: unknown performance test option '$1'" >&2; exit 1 ;;
+       esac
+done
 . ../test/test-lib-common.sh
 
 set -e