aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenĂ© Meusel <[email protected]>2020-03-10 10:42:14 +0100
committerRenĂ© Meusel <[email protected]>2020-03-10 15:39:25 +0100
commit9c701658661101916deb22304ad4b1da2a7ceaa4 (patch)
treeeec24c59529d2c7dceac6535f4c2c51c87f0b470
parent50e528820d19f4aab54223721de86dfcb5e168ec (diff)
set 'LD_LIBRARY_PATH=' in `make check` on Linux
-rw-r--r--src/scripts/check.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/scripts/check.py b/src/scripts/check.py
index 801688b5f..702541a2c 100644
--- a/src/scripts/check.py
+++ b/src/scripts/check.py
@@ -18,6 +18,10 @@ import platform
def is_macos():
return platform.system() == "Darwin"
+def is_linux():
+ return platform.system() == "Linux"
+
+
def run_and_check(cmd_line, env=None, cwd=None):
logging.info("Starting %s", ' '.join(cmd_line))
@@ -33,6 +37,20 @@ def run_and_check(cmd_line, env=None, cwd=None):
sys.exit(1)
+def get_environment(shared_lib):
+ if not shared_lib:
+ return None
+
+ env = os.environ.copy()
+
+ if is_macos():
+ env["DYLD_LIBRARY_PATH"] = os.path.abspath(".")
+ elif is_linux():
+ env["LD_LIBRARY_PATH"] = os.path.abspath(".")
+
+ return env
+
+
def parse_options(args):
parser = optparse.OptionParser()
parser.add_option('--test-exe', default='botan-test', metavar='BINARY',
@@ -62,11 +80,7 @@ def main(args=None):
if shared_lib and not os.path.isfile(shared_lib):
raise Exception("Shared library %s not found" % shared_lib)
- env = os.environ.copy()
- if shared_lib and is_macos():
- env["DYLD_LIBRARY_PATH"] = "."
-
- run_and_check([ test_exe ], env)
+ run_and_check([ test_exe ], get_environment(shared_lib))
return 0