[llvm] r220919 - lit: PR21417: don't try to update OCAMLPATH if LibDir is empty.

Peter Zotov whitequark at whitequark.org
Thu Oct 30 12:26:43 PDT 2014


Author: whitequark
Date: Thu Oct 30 14:26:42 2014
New Revision: 220919

URL: http://llvm.org/viewvc/llvm-project?rev=220919&view=rev
Log:
lit: PR21417: don't try to update OCAMLPATH if LibDir is empty.

Modified:
    llvm/trunk/test/lit.cfg

Modified: llvm/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=220919&r1=220918&r2=220919&view=diff
==============================================================================
--- llvm/trunk/test/lit.cfg (original)
+++ llvm/trunk/test/lit.cfg Thu Oct 30 14:26:42 2014
@@ -101,12 +101,14 @@ for options in ['ASAN_OPTIONS', 'UBSAN_O
         config.environment[options] = os.environ[options]
 
 # Set up OCAMLPATH to include newly built OCaml libraries.
-llvm_ocaml_lib = os.path.join(getattr(config, 'llvm_lib_dir', None), 'ocaml')
-if 'OCAMLPATH' in os.environ:
-    ocamlpath = os.path.pathsep.join((llvm_ocaml_lib, os.environ['OCAMLPATH']))
-    config.environment['OCAMLPATH'] = ocamlpath
-else:
-    config.environment['OCAMLPATH'] = llvm_ocaml_lib
+llvm_lib_dir = getattr(config, 'llvm_lib_dir', None)
+if llvm_lib_dir: # empty llvm_lib_dir is falsey, reads as None
+    llvm_ocaml_lib = os.path.join(llvm_lib_dir, 'ocaml')
+    if 'OCAMLPATH' in os.environ:
+        ocamlpath = os.path.pathsep.join((llvm_ocaml_lib, os.environ['OCAMLPATH']))
+        config.environment['OCAMLPATH'] = ocamlpath
+    else:
+        config.environment['OCAMLPATH'] = llvm_ocaml_lib
 
 # Set up OCAMLRUNPARAM to enable backtraces in OCaml tests.
 config.environment['OCAMLRUNPARAM'] = 'b'





More information about the llvm-commits mailing list