[PATCH 04/24] perf-test: use $(dirname "$0") for sourcing perf-test-lib.sh

Jani Nikula jani at nikula.org
Mon Sep 25 13:38:20 PDT 2017


Don't assume the tests are always run from within the source tree.
---
 performance-test/M00-new.sh          | 2 +-
 performance-test/M01-dump-restore.sh | 2 +-
 performance-test/M02-show.sh         | 2 +-
 performance-test/M03-search.sh       | 2 +-
 performance-test/M04-reply.sh        | 2 +-
 performance-test/M05-reindex.sh      | 2 +-
 performance-test/M06-insert.sh       | 2 +-
 performance-test/T00-new.sh          | 2 +-
 performance-test/T01-dump-restore.sh | 2 +-
 performance-test/T02-tag.sh          | 2 +-
 performance-test/T03-reindex.sh      | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/performance-test/M00-new.sh b/performance-test/M00-new.sh
index a040a97e043a..aab36e6953e2 100755
--- a/performance-test/M00-new.sh
+++ b/performance-test/M00-new.sh
@@ -2,7 +2,7 @@
 
 test_description='notmuch new'
 
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
 
 # ensure initial 'notmuch new' is run by memory_start
 uncache_database
diff --git a/performance-test/M01-dump-restore.sh b/performance-test/M01-dump-restore.sh
index 8fea98242d2c..32ab8dc9c0b9 100755
--- a/performance-test/M01-dump-restore.sh
+++ b/performance-test/M01-dump-restore.sh
@@ -2,7 +2,7 @@
 
 test_description='dump and restore'
 
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
 
 memory_start
 
diff --git a/performance-test/M02-show.sh b/performance-test/M02-show.sh
index d73035ea1197..2e218fd3c4b6 100755
--- a/performance-test/M02-show.sh
+++ b/performance-test/M02-show.sh
@@ -2,7 +2,7 @@
 
 test_description='show'
 
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
 
 memory_start
 
diff --git a/performance-test/M03-search.sh b/performance-test/M03-search.sh
index 8d026eee3662..343f5c7cfc24 100755
--- a/performance-test/M03-search.sh
+++ b/performance-test/M03-search.sh
@@ -2,7 +2,7 @@
 
 test_description='search'
 
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
 
 memory_start
 
diff --git a/performance-test/M04-reply.sh b/performance-test/M04-reply.sh
index 0e1ce0876925..3c1205dbc412 100755
--- a/performance-test/M04-reply.sh
+++ b/performance-test/M04-reply.sh
@@ -2,7 +2,7 @@
 
 test_description='search'
 
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
 
 memory_start
 
diff --git a/performance-test/M05-reindex.sh b/performance-test/M05-reindex.sh
index d36e061b7549..17e2c824698a 100755
--- a/performance-test/M05-reindex.sh
+++ b/performance-test/M05-reindex.sh
@@ -2,7 +2,7 @@
 
 test_description='reindex'
 
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
 
 memory_start
 
diff --git a/performance-test/M06-insert.sh b/performance-test/M06-insert.sh
index 9fcc2a0c9ff1..5ae0656a505b 100755
--- a/performance-test/M06-insert.sh
+++ b/performance-test/M06-insert.sh
@@ -2,7 +2,7 @@
 
 test_description='search'
 
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
 
 memory_start
 
diff --git a/performance-test/T00-new.sh b/performance-test/T00-new.sh
index b9f211581f5a..687501294e2c 100755
--- a/performance-test/T00-new.sh
+++ b/performance-test/T00-new.sh
@@ -2,7 +2,7 @@
 
 test_description='notmuch new'
 
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
 
 uncache_database
 
diff --git a/performance-test/T01-dump-restore.sh b/performance-test/T01-dump-restore.sh
index 9cfd5cd624ac..12f12e660533 100755
--- a/performance-test/T01-dump-restore.sh
+++ b/performance-test/T01-dump-restore.sh
@@ -2,7 +2,7 @@
 
 test_description='dump and restore'
 
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
 
 time_start
 
diff --git a/performance-test/T02-tag.sh b/performance-test/T02-tag.sh
index dacb50b8bbf8..8c5dfd680316 100755
--- a/performance-test/T02-tag.sh
+++ b/performance-test/T02-tag.sh
@@ -2,7 +2,7 @@
 
 test_description='tagging'
 
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
 
 time_start
 
diff --git a/performance-test/T03-reindex.sh b/performance-test/T03-reindex.sh
index 7af2d22d3df8..d6d5c3c3ae83 100755
--- a/performance-test/T03-reindex.sh
+++ b/performance-test/T03-reindex.sh
@@ -2,7 +2,7 @@
 
 test_description='tagging'
 
-. ./perf-test-lib.sh || exit 1
+. $(dirname "$0")/perf-test-lib.sh || exit 1
 
 time_start
 
-- 
2.11.0



More information about the notmuch mailing list