X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2Flit.cfg;h=9a2f74c21c93f368feffef976de0427ef8b97045;hb=5edf24efac40062766c643e08f11bc509d373370;hp=b5c5706ad6a5aa2f4e5bfbb5e5086b66123c9d14;hpb=70ecc97550635eec18d8c45577fc3ad24dcf8abc;p=oota-llvm.git diff --git a/test/lit.cfg b/test/lit.cfg index b5c5706ad6a..9a2f74c21c9 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -19,6 +19,18 @@ config.suffixes = [] # test_source_root: The root path where tests are located. config.test_source_root = os.path.dirname(__file__) +# Tweak PATH for Win32 +if sys.platform in ['win32']: + # Seek sane tools in directories and set to $PATH. + path = getattr(config, 'lit_tools_dir', None) + path = lit.getToolsPath(path, + config.environment['PATH'], + ['cmp.exe', 'grep.exe', 'sed.exe']) + if path is not None: + path = os.path.pathsep.join((path, + config.environment['PATH'])) + config.environment['PATH'] = path + # test_exec_root: The root path where tests should be run. llvm_obj_root = getattr(config, 'llvm_obj_root', None) if llvm_obj_root is not None: @@ -27,6 +39,18 @@ if llvm_obj_root is not None: # Tweak the PATH to include the scripts dir, the tools dir, and the llvm-gcc bin # dir (if available). if llvm_obj_root is not None: + # Include llvm-gcc first, as the llvm-gcc binaryies will not appear + # neither in the tools nor in the scripts dir. However it might be + # possible, that some old llvm tools are in the llvm-gcc dir. Adding + # llvm-gcc dir first ensures, that those will always be overwritten + # by the new tools in llvm_tools_dir. So now outdated tools are used + # for testing + llvmgcc_dir = getattr(config, 'llvmgcc_dir', None) + if llvmgcc_dir: + path = os.path.pathsep.join((os.path.join(llvmgcc_dir, 'bin'), + config.environment['PATH'])) + config.environment['PATH'] = path + llvm_src_root = getattr(config, 'llvm_src_root', None) if not llvm_src_root: lit.fatal('No LLVM source root set!') @@ -41,12 +65,6 @@ if llvm_obj_root is not None: path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH'])) config.environment['PATH'] = path - llvmgcc_dir = getattr(config, 'llvmgcc_dir', None) - if llvmgcc_dir: - path = os.path.pathsep.join((os.path.join(llvmgcc_dir, 'bin'), - config.environment['PATH'])) - config.environment['PATH'] = path - # Propagate 'HOME' through the environment. if 'HOME' in os.environ: config.environment['HOME'] = os.environ['HOME'] @@ -157,8 +175,12 @@ for sub in ['llvmgcc', 'llvmgxx', 'emitir', 'compile_cxx', 'compile_c', # (llvm_tools_dir in lit parlance). # Don't match 'bugpoint-' or 'clang-'. # Don't match '/clang'. +if os.pathsep == ';': + pathext = os.environ.get('PATHEXT', '').split(';') +else: + pathext = [''] for pattern in [r"\bbugpoint\b(?!-)", r"(?