summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/suite/run.py
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2019-02-04 14:39:32 +1100
committerLuke Chen <luke.chen@mongodb.com>2019-02-04 14:39:32 +1100
commit4ee4343cc481a9becbec21143930d145b8a66157 (patch)
treea5697c84a063357ff316cc9fe69122e1316c5b38 /src/third_party/wiredtiger/test/suite/run.py
parent065f3ef77de57609d92fce482c1e4e36b15cf29c (diff)
downloadmongo-4ee4343cc481a9becbec21143930d145b8a66157.tar.gz
Import wiredtiger: 92719d6bc9a83ce45c337db6a67adcc1354cca32 from branch mongodb-4.2
ref: e727b7296c..92719d6bc9 for: 4.1.8 WT-4508 Fix a leak of index structure memory WT-4536 Compile wiredtiger under build_posix directory for Evergreen tests WT-4548 Skip test_wt2853_perf for slow machines WT-4549 Enable wtperf_config.py to work with python2/3
Diffstat (limited to 'src/third_party/wiredtiger/test/suite/run.py')
-rwxr-xr-x[-rw-r--r--]src/third_party/wiredtiger/test/suite/run.py29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/test/suite/run.py b/src/third_party/wiredtiger/test/suite/run.py
index 8e4ce4824a6..b82a77fe97c 100644..100755
--- a/src/third_party/wiredtiger/test/suite/run.py
+++ b/src/third_party/wiredtiger/test/suite/run.py
@@ -40,9 +40,15 @@ wt_3rdpartydir = os.path.join(wt_disttop, 'test', '3rdparty')
# Check for a local build that contains the wt utility. First check in
# current working directory, then in build_posix and finally in the disttop
# directory. This isn't ideal - if a user has multiple builds in a tree we
-# could pick the wrong one.
-if os.path.isfile(os.path.join(os.getcwd(), 'wt')):
- wt_builddir = os.getcwd()
+# could pick the wrong one. We also need to account for the fact that there
+# may be an executable 'wt' file the build directory and a subordinate .libs
+# directory.
+curdir = os.getcwd()
+if os.path.basename(curdir) == '.libs' and \
+ os.path.isfile(os.path.join(curdir, os.pardir, 'wt')):
+ wt_builddir = os.path.join(curdir, os.pardir)
+elif os.path.isfile(os.path.join(curdir, 'wt')):
+ wt_builddir = curdir
elif os.path.isfile(os.path.join(wt_disttop, 'wt')):
wt_builddir = wt_disttop
elif os.path.isfile(os.path.join(wt_disttop, 'build_posix', 'wt')):
@@ -59,6 +65,23 @@ else:
sys.path.insert(1, os.path.join(wt_builddir, 'lang', 'python'))
sys.path.insert(1, os.path.join(wt_disttop, 'lang', 'python'))
+# Append to a colon separated path in the environment
+def append_env_path(name, value):
+ path = os.environ.get(name)
+ if path == None:
+ v = value
+ else:
+ v = path + ':' + value
+ os.environ[name] = v
+
+# If we built with libtool, explicitly put its install directory in our library
+# search path. This only affects library loading for subprocesses, like 'wt'.
+libsdir = os.path.join(wt_builddir, '.libs')
+if os.path.isdir(libsdir):
+ append_env_path('LD_LIBRARY_PATH', libsdir)
+ if sys.platform == "darwin":
+ append_env_path('DYLD_LIBRARY_PATH', libsdir)
+
# Add all 3rd party directories: some have code in subdirectories
for d in os.listdir(wt_3rdpartydir):
for subdir in ('lib', 'python', ''):