Lit: Add setenv transformation to use export/set on Unix/Windows.

This commit is contained in:
Frederich Munch 2016-09-30 16:52:55 -04:00 committed by sftnight
parent e8cade29c7
commit 52cd30dbef
3 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,4 @@
//RUN: cd "%testexecdir/../../clang/test" && CLANG="%p/clangTestUnloader.sh" python "%llvmsrcdir/utils/lit/lit.py" -v -sv --param clang_site_config="%testexecdir/../../clang/test/lit.site.cfg" "%p/../../../clang/test/Sema/address-constant.c"
// RUN: cd "%testexecdir/../../clang/test" && %setenv CLANG="%/p/clangTestUnloader.sh" && python "%llvmsrcdir/utils/lit/lit.py" -v -sv --param clang_site_config="%testexecdir/../../clang/test/lit.site.cfg" "%/p/../../../clang/test/Sema/address-constant.c"
// Current SemaCXX failures:
// Expected Passes : 392

View File

@ -7,7 +7,7 @@
//------------------------------------------------------------------------------
// RUN: mkdir -p %T/subdir && clang -shared %S/call_lib.c -o %T/subdir/libtest%shlibext
// RUN: export ENVVAR_LIB="%T/subdir" ; export ENVVAR_INC="%S/subdir"
// RUN: %setenv ENVVAR_LIB="%T/subdir" && %setenv ENVVAR_INC="%S/subdir"
// RUN: cat %s | %cling -I %S -Xclang -verify 2>&1 | FileCheck %s
#pragma cling add_include_path("$ENVVAR_INC")

View File

@ -266,8 +266,10 @@ else:
# Windows needs -nostdinc
if platform.system() in ['Windows']:
config.substitutions.append( ('%nostdincxx', '-nostdinc') )
config.substitutions.append(('%setenv', 'set'))
else:
config.substitutions.append( ('%nostdincxx', '-nostdinc++') )
config.substitutions.append(('%setenv', 'export'))
#Don't add tests to history
os.environ['CLING_NOHISTORY'] = '1'