2014-01-07 09:55:59 +01:00
##===- cling/test/Makefile ---------------------------------*- Makefile -*-===##
#
# The Cling Interpreter
#
# This file is dual-licensed: you can choose to license it under the University
# of Illinois Open Source License or the GNU Lesser General Public License. See
# LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
2012-09-05 09:37:39 +00:00
LEVEL = ../../..
i n c l u d e $( LEVEL ) / M a k e f i l e . c o m m o n
# Test in all immediate subdirectories if unset.
i f d e f T E S T S U I T E
TESTDIRS := $( TESTSUITE:%= $( PROJ_SRC_DIR) /%)
e l s e
TESTDIRS ?= $( PROJ_SRC_DIR)
e n d i f
# 'lit' wants objdir paths, so it will pick up the lit.site.cfg.
TESTDIRS := $( TESTDIRS:$( PROJ_SRC_DIR) %= $( PROJ_OBJ_DIR) %)
# Allow EXTRA_TESTDIRS to provide additional test directories.
TESTDIRS += $( EXTRA_TESTDIRS)
i f n d e f T E S T A R G S
i f d e f V E R B O S E
TESTARGS = -v
e l s e
TESTARGS = -s -v
e n d i f
e n d i f
# Make sure any extra test suites can find the main site config.
LIT_ARGS := --param cling_site_config = $( PROJ_OBJ_DIR) /lit.site.cfg
i f d e f V G
LIT_ARGS += "--vg"
e n d i f
all :: lit .site .cfg
@ echo '--- Running cling tests for $(TARGET_TRIPLE) ---'
@ $( PYTHON) $( LLVM_SRC_ROOT) /utils/lit/lit.py \
$( LIT_ARGS) $( TESTARGS) $( TESTDIRS)
FORCE :
lit.site.cfg : FORCE
@echo "Making Cling 'lit.site.cfg' file..."
@sed -e " s#@LLVM_SOURCE_DIR@# $( LLVM_SRC_ROOT) #g " \
-e " s#@LLVM_BINARY_DIR@# $( LLVM_OBJ_ROOT) #g " \
-e " s#@LLVM_TOOLS_DIR@# $( ToolDir) #g " \
-e " s#@LLVM_LIBS_DIR@# $( LibDir) #g " \
-e " s#@CLING_SOURCE_DIR@# $( PROJ_SRC_DIR) /..#g " \
-e " s#@CLING_BINARY_DIR@# $( PROJ_OBJ_DIR) /..#g " \
-e " s#@TARGET_TRIPLE@# $( TARGET_TRIPLE) #g " \
-e " s#@TARGET_SHLIBEXT@# $( SHLIBEXT) #g " \
$( PROJ_SRC_DIR) /lit.site.cfg.in > $@
clean ::
@ find . -name Output | xargs rm -fr
.PHONY : all report clean