Add %built_cling substitution for lit so tests can be run from either the build or installations directories.

This commit is contained in:
Frederich Munch 2016-07-08 22:28:17 -04:00 committed by sftnight
parent d7bc590e03
commit e3265d1d8c
16 changed files with 26 additions and 15 deletions

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -I%p | FileCheck %s
// RUN: cat %s | %built_cling -I%p | FileCheck %s
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/InterpreterCallbacks.h"

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -I%p | FileCheck %s
// RUN: cat %s | %built_cling -I%p | FileCheck %s
// The tests shows the basic control flow structures that contain dynamic
// expressions. There are several cases that could be distinguished.

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -I%p | FileCheck %s
// RUN: cat %s | %built_cling -I%p | FileCheck %s
// We should revise the destruction of the LifetimeHandlers, because
// its destructor uses gCling and the CompilerInstance, which are
// already gone

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -I%p | FileCheck %s
// RUN: cat %s | %built_cling -I%p | FileCheck %s
// This test tests the hook that cling expects in clang and enables it
// at compile time. However that is not actual dynamic lookup because

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -I%p | FileCheck %s
// RUN: cat %s | %built_cling -I%p | FileCheck %s
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/InterpreterCallbacks.h"

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -I%p 2>&1 | FileCheck %s
// RUN: cat %s | %built_cling -I%p 2>&1 | FileCheck %s
// Test failures of dynamic lookups.

View File

@ -7,7 +7,7 @@
//------------------------------------------------------------------------------
// RUN: clang -shared %S/address_lib.c -olibaddress_lib%shlibext
// RUN: cat %s | %cling -L. -fno-rtti | FileCheck %s
// RUN: cat %s | %built_cling -L. -fno-rtti | FileCheck %s
extern "C" int printf(const char*,...);
#include "cling/Interpreter/Interpreter.h"

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -fno-rtti | FileCheck %s
// RUN: cat %s | %built_cling -fno-rtti | FileCheck %s
// This test makes sure the interpreter doesn't create many useless empty
// transactions.

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -fno-rtti 2>&1 | FileCheck %s
// RUN: cat %s | %built_cling -fno-rtti 2>&1 | FileCheck %s
// Test findArgList
#include "cling/Interpreter/Interpreter.h"

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -fno-rtti 2>&1 | FileCheck %s
// RUN: cat %s | %built_cling -fno-rtti 2>&1 | FileCheck %s
// Test lookupData
.rawInput 1

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -fno-rtti 2>&1 | FileCheck %s
// RUN: cat %s | %built_cling -fno-rtti 2>&1 | FileCheck %s
// Test lookupFunctionArgs()
.rawInput
#include "cling/Interpreter/Interpreter.h"

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -fno-rtti 2>&1 | FileCheck %s
// RUN: cat %s | %built_cling -fno-rtti 2>&1 | FileCheck %s
// Test findScope, which is esentially is a DeclContext.
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/LookupHelper.h"

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -fno-rtti 2>&1 | FileCheck %s
// RUN: cat %s | %built_cling -fno-rtti 2>&1 | FileCheck %s
// Test findClassTemplate, which is esentially is a DeclContext.
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/LookupHelper.h"

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -fno-rtti 2>&1 | FileCheck %s
// RUN: cat %s | %built_cling -fno-rtti 2>&1 | FileCheck %s
// Test Interpreter::lookupType()
//
#include "cling/Interpreter/Interpreter.h"

View File

@ -6,7 +6,7 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -fno-rtti | FileCheck %s
// RUN: cat %s | %built_cling -fno-rtti | FileCheck %s
// The test verifies the expected behavior in cling::utils::Transform class,
// which is supposed to provide different transformation of AST nodes and types.

View File

@ -240,6 +240,17 @@ if not lit_config.quiet:
#Start cling with nologo
config.substitutions.append( ('%cling', config.cling + ' --nologo') )
if not os.getenv('CLING'):
# Add a substitution for the builds generated include dir before install
incDir = os.path.join(config.llvm_obj_root, 'tools', 'clang', 'include')
config.substitutions.append( ('%built_cling', config.cling + ' --nologo -I%s'
% os.path.normpath(incDir)) )
if not lit_config.quiet:
lit_config.note('Running tests from build tree')
else:
config.substitutions.append( ('%built_cling', config.cling + ' --nologo') )
if not lit_config.quiet:
lit_config.note('Running tests from installation')
# FIXME: Find nicer way to prohibit this.
config.substitutions.append(