2004-11-07 05:05:37 +00:00
|
|
|
#===- test/Makefile ----------------------------------------*- Makefile -*--===#
|
|
|
|
#
|
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
|
|
|
# This file was developed by the LLVM research group and is distributed under
|
|
|
|
# the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
#
|
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
|
2001-11-05 00:22:16 +00:00
|
|
|
LEVEL = ..
|
2004-09-05 08:18:23 +00:00
|
|
|
DIRS =
|
2002-01-23 21:36:59 +00:00
|
|
|
|
2003-09-06 15:12:21 +00:00
|
|
|
#
|
2004-12-04 06:25:08 +00:00
|
|
|
# Make Dejagnu the default for testing
|
2003-09-06 15:12:21 +00:00
|
|
|
#
|
2004-12-06 05:35:38 +00:00
|
|
|
all:: check-local
|
2003-09-06 15:12:21 +00:00
|
|
|
|
2003-10-27 17:46:42 +00:00
|
|
|
# Include other test rules
|
|
|
|
include Makefile.tests
|
|
|
|
|
2004-11-07 05:05:37 +00:00
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
# DejaGNU testing support
|
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
|
2004-11-07 21:39:41 +00:00
|
|
|
ifdef TESTSUITE
|
2004-12-12 21:39:49 +00:00
|
|
|
CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE))
|
2006-11-11 01:02:45 +00:00
|
|
|
CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE))
|
2004-12-12 21:39:49 +00:00
|
|
|
RUNTESTFLAGS := --tool $(CLEANED_TESTSUITE)
|
2004-11-07 21:39:41 +00:00
|
|
|
endif
|
|
|
|
|
2006-05-28 04:21:40 +00:00
|
|
|
ifndef RUNLLVM2CPP
|
|
|
|
RUNTESTFLAGS += --ignore llvm2cpp.exp
|
|
|
|
endif
|
|
|
|
|
2006-08-01 00:07:58 +00:00
|
|
|
ifneq ($(RUNTEST),)
|
2004-12-06 05:35:38 +00:00
|
|
|
check-local:: site.exp
|
2007-02-11 20:18:32 +00:00
|
|
|
( ulimit -t 600 ; ulimit -d 512000 ; \
|
|
|
|
PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
|
|
|
|
$(RUNTEST) $(RUNTESTFLAGS) )
|
2006-08-01 00:07:58 +00:00
|
|
|
else
|
|
|
|
check-local:: site.exp
|
|
|
|
@echo "*** dejagnu not found. Make sure runtest is in your PATH, then reconfigure llvm."
|
|
|
|
endif
|
2004-11-07 21:39:41 +00:00
|
|
|
|
2007-04-15 06:18:50 +00:00
|
|
|
ifdef TESTONE
|
|
|
|
CLEANED_TESTONE := $(patsubst %/,%,$(TESTONE))
|
|
|
|
CLEANED_TESTONE := $(patsubst test/%,%,$(CLEANED_TESTONE))
|
|
|
|
SUBDIR := $(shell dirname $(CLEANED_TESTONE))
|
|
|
|
TESTPATH := $(LLVM_SRC_ROOT)/test/$(CLEANED_TESTONE)
|
|
|
|
check-one: site.exp $(TCLSH)
|
2007-04-16 16:45:12 +00:00
|
|
|
$(Verb)( echo "source $(LLVM_OBJ_ROOT)/test/site.exp" ; \
|
2007-04-15 06:18:50 +00:00
|
|
|
echo "set subdir $(SUBDIR)" ; \
|
|
|
|
echo "proc pass { msg } { puts \"PASS: \$$msg\" } "; \
|
|
|
|
echo "proc fail { msg } { puts \"FAIL: \$$msg\" }" ; \
|
|
|
|
echo "proc xfail { msg } { puts \"XFAIL: \$$msg\" }" ; \
|
|
|
|
echo "proc xpass { msg } { puts \"XPASS: \$$msg\" }" ; \
|
|
|
|
echo "source $(LLVM_SRC_ROOT)/test/lib/llvm.exp" ; \
|
|
|
|
echo "RunLLVMTests $(TESTPATH)" ) | \
|
|
|
|
( ulimit -t 600 ; ulimit -d 512000 ; \
|
|
|
|
PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
|
|
|
|
$(TCLSH) )
|
|
|
|
endif
|
|
|
|
|
2004-12-04 06:25:08 +00:00
|
|
|
clean::
|
2007-01-17 07:59:14 +00:00
|
|
|
$(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
|
2004-11-07 04:59:52 +00:00
|
|
|
|
|
|
|
site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config
|
|
|
|
@echo 'Making a new site.exp file...'
|
|
|
|
@echo '## these variables are automatically generated by make ##' >site.tmp
|
|
|
|
@echo '# Do not edit here. If you wish to override these values' >>site.tmp
|
|
|
|
@echo '# edit the last section' >>site.tmp
|
2006-04-13 20:33:59 +00:00
|
|
|
@echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
|
2007-04-21 20:39:26 +00:00
|
|
|
@echo 'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp
|
2006-04-13 20:33:59 +00:00
|
|
|
@echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
|
2004-11-30 19:13:06 +00:00
|
|
|
@echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
|
2006-05-28 07:22:42 +00:00
|
|
|
@echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
|
|
|
|
@echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
|
2006-05-28 04:21:40 +00:00
|
|
|
@echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
|
|
|
|
@echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
|
2006-04-13 20:33:59 +00:00
|
|
|
@echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
|
|
|
|
@echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
|
2007-04-11 20:57:39 +00:00
|
|
|
@echo 'set gccpath "$(CC)"' >>site.tmp
|
|
|
|
@echo 'set gxxpath "$(CXX)"' >>site.tmp
|
|
|
|
@echo 'set compile_c {$(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -c } ' >>site.tmp
|
|
|
|
@echo 'set compile_cxx {$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) - c}' >> site.tmp
|
|
|
|
@echo 'set link {$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) $(LD.Flags)}' >>site.tmp
|
2007-04-15 19:27:27 +00:00
|
|
|
@echo 'set llvmgcc "$(LLVMGCC)"' >> site.tmp
|
|
|
|
@echo 'set llvmgxx "$(LLVMGCC)"' >> site.tmp
|
2006-04-06 22:22:08 +00:00
|
|
|
@echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
|
2007-04-12 02:49:30 +00:00
|
|
|
@echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
|
2004-11-07 04:59:52 +00:00
|
|
|
@echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
|
|
|
|
@test ! -f site.exp || \
|
|
|
|
sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
|
|
|
|
@-rm -f site.bak
|
|
|
|
@test ! -f site.exp || mv site.exp site.bak
|
|
|
|
@mv site.tmp site.exp
|