aboutsummaryrefslogtreecommitdiff
path: root/performance-test/T05-ruby.sh
diff options
context:
space:
mode:
authorDavid Bremner <bremner@debian.org>2023-12-01 07:51:09 -0400
committerDavid Bremner <bremner@debian.org>2023-12-01 07:51:09 -0400
commit126347b6942dd4b0291beb67b119431ebd750a2a (patch)
tree532c5163cb0972c8b9e6c8b4577b86afb9c6a6a2 /performance-test/T05-ruby.sh
Import notmuch_0.38.2.orig.tar.xz
[dgit import orig notmuch_0.38.2.orig.tar.xz]
Diffstat (limited to 'performance-test/T05-ruby.sh')
-rwxr-xr-xperformance-test/T05-ruby.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/performance-test/T05-ruby.sh b/performance-test/T05-ruby.sh
new file mode 100755
index 00000000..527ab28b
--- /dev/null
+++ b/performance-test/T05-ruby.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+test_description='ruby bindings'
+
+. $(dirname "$0")/perf-test-lib.sh || exit 1
+
+if [ "${NOTMUCH_HAVE_RUBY_DEV}" = "0" ]; then
+ echo "missing prerequisites: ruby development files"
+ exit 0
+fi
+
+time_start
+
+time_run 'print all messages' "$NOTMUCH_RUBY -I '$NOTMUCH_BUILDDIR/bindings/ruby' <<'EOF'
+require 'notmuch'
+db = Notmuch::Database.new('$MAIL_DIR')
+100.times.each do
+ db.query('').search_messages.each do |msg|
+ puts msg.message_id
+ end
+end
+EOF"
+
+time_done