From: Peter Zotov Date: Thu, 30 Oct 2014 19:26:42 +0000 (+0000) Subject: lit: PR21417: don't try to update OCAMLPATH if LibDir is empty. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=a8111668bb3ea372cd5ae1ec856458f27f4ff16c;ds=sidebyside lit: PR21417: don't try to update OCAMLPATH if LibDir is empty. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220919 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/lit.cfg b/test/lit.cfg index af446b26ec3..335b86dae7d 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -101,12 +101,14 @@ for options in ['ASAN_OPTIONS', 'UBSAN_OPTIONS']: 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'