Lit: Add %mkdir, %rm, and %rmdir substitutions.

This commit is contained in:
Frederich Munch 2017-02-16 22:20:15 -05:00 committed by sftnight
parent fa5c74997b
commit 42971e42cd
8 changed files with 22 additions and 9 deletions

View File

@ -1,5 +1,5 @@
//RUN: cat %s | %cling -Xclang -verify "-DCLING=\" %cling \"" | FileCheck %s
//RUN: rm -f /tmp/__cling_fwd_*
//RUN: %rm /tmp/__cling_fwd_*
//XFAIL:*
#include "cling/Interpreter/Interpreter.h"

View File

@ -1,4 +1,4 @@
// RUN: rm -f Inlines.h.pch
// RUN: %rm "Inlines.h.pch"
// RUN: %cling -x c++-header %S/Inputs/Inlines.h -o Inlines.h.pch
// RUN: cat %s | %cling -I%p -Xclang -trigraphs -Xclang -include-pch -Xclang Inlines.h.pch 2>&1 | FileCheck %s

View File

@ -1,6 +1,5 @@
// RUN: mkdir -p %T/Rel/Path
// RUN: rm -f CompGen.h.pch
// RUN: rm -f %T/Rel/Path/Relative.pch
// RUN: %mkdir "%T/Rel/Path" || true
// RUN: %rm "CompGen.h.pch" && %rm "%T/Rel/Path/Relative.pch"
// RUN: clang -x c++-header -fexceptions -fcxx-exceptions -std=c++14 -pthread %S/Inputs/CompGen.h -o CompGen.h.pch
// RUN: clang -x c++-header -fexceptions -fcxx-exceptions -std=c++14 -pthread %S/Inputs/CompGen.h -o %T/Rel/Path/Relative.pch
// RUN: cat %s | %cling -I%p -Xclang -include-pch -Xclang CompGen.h.pch 2>&1 | FileCheck %s

View File

@ -1,4 +1,4 @@
// RUN: rm -f CompGen2.h.pch
// RUN: %rm "CompGen2.h.pch"
// RUN: %cling -x c++-header %S/Inputs/CompGen.h -o CompGen2.h.pch
// RUN: cat %s | %cling -I%p -Xclang -include-pch -Xclang CompGen2.h.pch 2>&1 | FileCheck %s

View File

@ -7,7 +7,10 @@
//------------------------------------------------------------------------------
// Removing the cwd on Unix works but on Windows cannot be done.
// RUN: mkdir -p %T/Remove && cd %T/Remove && rm -rf %T/Remove && %cling %s -Xclang -verify 2>&1 | FileCheck %s
// RUN: %mkdir "%T/Remove"
// RUN: cd "%T/Remove"
// RUN: %rmdir "%T/Remove"
// RUN: %cling %s -Xclang -verify 2>&1 | FileCheck %s
// REQUIRES: not_system-windows
extern "C" {

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: echo "" | %cling -dM -E -xc++ -std=c++11 | grep CLING | FileCheck %s
// RUN: echo "" | %cling -dM -E -xc++ -std=c++11 | FileCheck %s
// CHECK: #define __CLING__ 1
// CHECK: #define __CLING__CXX11 1

View File

@ -6,7 +6,9 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: mkdir -p %T/subdir && clang -DCLING_EXPORT=%dllexport -shared %S/call_lib.c -o %T/subdir/libtest%shlibext
// RUN: %mkdir "%T/subdir" || true
// RUN: %rm "%T/subdir/libtest%shlibext"
// RUN: clang -DCLING_EXPORT=%dllexport -shared %S/call_lib.c -o %T/subdir/libtest%shlibext
// RUN: cat %s | %cling -I %S -DENVVAR_LIB="\"%/T/subdir\"" -DENVVAR_INC="\"%/p/subdir\"" -Xclang -verify 2>&1 | FileCheck %s
extern "C" int cling_testlibrary_function();

View File

@ -277,6 +277,15 @@ if platform.system() in ['Windows']:
else:
config.substitutions.append(('%dllexport', ''))
if platform.system() == 'Windows' and execute_external:
config.substitutions.append(('%mkdir', 'mkdir'))
config.substitutions.append(('%rmdir', 'rmdir /s /q'))
config.substitutions.append(('%rm', 'del /s /q'))
else:
config.substitutions.append(('%mkdir', 'mkdir -p'))
config.substitutions.append(('%rmdir', 'rm -rf'))
config.substitutions.append(('%rm', 'rm -f'))
# Don't add tests to history
os.environ['CLING_NOHISTORY'] = '1'