[PATCH 1/3] performance-test: add argument parsing for performance tests.

david at tethera.net david at tethera.net
Mon Dec 3 17:17:02 PST 2012


From: David Bremner <bremner at debian.org>

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 |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/performance-test/perf-test-lib.sh b/performance-test/perf-test-lib.sh
index 1399d05..bba793d 100644
--- a/performance-test/perf-test-lib.sh
+++ b/performance-test/perf-test-lib.sh
@@ -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
-- 
1.7.10.4



More information about the notmuch mailing list