From 52f16e0f553c4a9286c814cfa2cc7d6ccbc3c38a Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 17 Apr 2019 15:19:33 +0300 Subject: [PATCH] tests: workaround for DYLD_LIBRARY_PATH on Apple MacOSX --- modules/java/test/pure_test/build.xml | 1 + modules/ts/misc/run_utils.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/modules/java/test/pure_test/build.xml b/modules/java/test/pure_test/build.xml index 7729b41b2b..870dd44d74 100644 --- a/modules/java/test/pure_test/build.xml +++ b/modules/java/test/pure_test/build.xml @@ -41,6 +41,7 @@ + diff --git a/modules/ts/misc/run_utils.py b/modules/ts/misc/run_utils.py index 4fc84cc8ef..8c942ba9d1 100644 --- a/modules/ts/misc/run_utils.py +++ b/modules/ts/misc/run_utils.py @@ -37,6 +37,13 @@ def execute(cmd, silent=False, cwd=".", env=None): new_env = os.environ.copy() new_env.update(env) env = new_env + + if sys.platform == 'darwin': # https://github.com/opencv/opencv/issues/14351 + if env is None: + env = os.environ.copy() + if 'DYLD_LIBRARY_PATH' in env: + env['OPENCV_SAVED_DYLD_LIBRARY_PATH'] = env['DYLD_LIBRARY_PATH'] + if silent: return check_output(cmd, stderr=STDOUT, cwd=cwd, env=env).decode("latin-1") else: