2004-11-07 06:05:37 +01:00
|
|
|
#===- test/Makefile ----------------------------------------*- Makefile -*--===#
|
|
|
|
#
|
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
2007-12-29 21:11:13 +01:00
|
|
|
# This file is distributed under the University of Illinois Open Source
|
|
|
|
# License. See LICENSE.TXT for details.
|
2004-11-07 06:05:37 +01:00
|
|
|
#
|
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
|
2008-12-31 18:38:27 +01:00
|
|
|
LEVEL = ..
|
|
|
|
DIRS =
|
2002-01-23 22:36:59 +01:00
|
|
|
|
2003-09-06 17:12:21 +02:00
|
|
|
#
|
2004-12-04 07:25:08 +01:00
|
|
|
# Make Dejagnu the default for testing
|
2003-09-06 17:12:21 +02:00
|
|
|
#
|
2004-12-06 06:35:38 +01:00
|
|
|
all:: check-local
|
2003-09-06 17:12:21 +02:00
|
|
|
|
2003-10-27 18:46:42 +01:00
|
|
|
# Include other test rules
|
|
|
|
include Makefile.tests
|
|
|
|
|
2004-11-07 06:05:37 +01:00
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
# DejaGNU testing support
|
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
|
2008-02-26 13:08:55 +01:00
|
|
|
ifdef VERBOSE
|
|
|
|
RUNTESTFLAGS := $(VERBOSE)
|
|
|
|
endif
|
|
|
|
|
2004-11-07 22:39:41 +01:00
|
|
|
ifdef TESTSUITE
|
2004-12-12 22:39:49 +01:00
|
|
|
CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE))
|
2006-11-11 02:02:45 +01:00
|
|
|
CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE))
|
2008-02-26 13:08:55 +01:00
|
|
|
RUNTESTFLAGS += --tool $(CLEANED_TESTSUITE)
|
2004-11-07 22:39:41 +01:00
|
|
|
endif
|
|
|
|
|
2008-10-07 16:48:14 +02:00
|
|
|
ifdef VG
|
|
|
|
VALGRIND := valgrind --tool=memcheck --quiet --trace-children=yes --error-exitcode=3 --leak-check=full
|
|
|
|
endif
|
|
|
|
|
2007-09-18 14:26:17 +02:00
|
|
|
IGNORE_TESTS :=
|
|
|
|
|
2006-05-28 06:21:40 +02:00
|
|
|
ifndef RUNLLVM2CPP
|
2007-09-18 14:26:17 +02:00
|
|
|
IGNORE_TESTS += llvm2cpp.exp
|
|
|
|
endif
|
|
|
|
|
2007-10-02 11:50:18 +02:00
|
|
|
IGNORE_TESTS += $(filter-out $(BINDINGS_TO_BUILD:=.exp),$(ALL_BINDINGS:=.exp))
|
2007-09-18 14:26:17 +02:00
|
|
|
|
|
|
|
ifdef IGNORE_TESTS
|
|
|
|
RUNTESTFLAGS += --ignore "$(strip $(IGNORE_TESTS))"
|
2006-05-28 06:21:40 +02:00
|
|
|
endif
|
|
|
|
|
2006-08-01 02:07:58 +02:00
|
|
|
ifneq ($(RUNTEST),)
|
2004-12-06 06:35:38 +01:00
|
|
|
check-local:: site.exp
|
2007-02-11 21:18:32 +01:00
|
|
|
( ulimit -t 600 ; ulimit -d 512000 ; \
|
|
|
|
PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
|
|
|
|
$(RUNTEST) $(RUNTESTFLAGS) )
|
2006-08-01 02:07:58 +02:00
|
|
|
else
|
|
|
|
check-local:: site.exp
|
2009-01-01 21:26:05 +01:00
|
|
|
@echo "*** dejagnu not found. Make sure 'runtest' is in your PATH, then reconfigure LLVM."
|
2006-08-01 02:07:58 +02:00
|
|
|
endif
|
2004-11-07 22:39:41 +01:00
|
|
|
|
2007-04-15 08:18:50 +02: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 18:45:12 +02:00
|
|
|
$(Verb)( echo "source $(LLVM_OBJ_ROOT)/test/site.exp" ; \
|
2007-04-15 08:18:50 +02: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\" }" ; \
|
2008-02-26 14:27:49 +01:00
|
|
|
echo "proc verbose args { }" ; \
|
2007-04-15 08:18:50 +02:00
|
|
|
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 07:25:08 +01:00
|
|
|
clean::
|
2007-01-17 08:59:14 +01:00
|
|
|
$(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
|
2004-11-07 05:59:52 +01:00
|
|
|
|
2009-02-02 22:09:36 +01:00
|
|
|
# dsymutil is used on the Darwin to manipulate DWARF debugging information.
|
|
|
|
ifeq ($(OS),Darwin)
|
|
|
|
DSYMUTIL=dsymutil
|
|
|
|
else
|
|
|
|
DSYMUTIL=true
|
|
|
|
endif
|
|
|
|
|
2008-10-07 16:48:14 +02:00
|
|
|
FORCE:
|
|
|
|
|
|
|
|
site.exp: FORCE
|
2004-11-07 05:59:52 +01:00
|
|
|
@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 22:33:59 +02:00
|
|
|
@echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
|
2007-04-21 22:39:26 +02:00
|
|
|
@echo 'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp
|
2007-04-21 23:43:18 +02:00
|
|
|
@echo 'set llvmgcc_langs "$(LLVMGCC_LANGS)"' >> site.tmp
|
2006-04-13 22:33:59 +02:00
|
|
|
@echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
|
2004-11-30 20:13:06 +01:00
|
|
|
@echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
|
2006-05-28 09:22:42 +02:00
|
|
|
@echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
|
|
|
|
@echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
|
2006-05-28 06:21:40 +02:00
|
|
|
@echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
|
|
|
|
@echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
|
2006-04-13 22:33:59 +02:00
|
|
|
@echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
|
|
|
|
@echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
|
2007-04-11 22:57:39 +02:00
|
|
|
@echo 'set gccpath "$(CC)"' >>site.tmp
|
|
|
|
@echo 'set gxxpath "$(CXX)"' >>site.tmp
|
2008-03-18 20:59:04 +01:00
|
|
|
@echo 'set compile_c "$(CC) $(CPP.Flags) $(CompileCommonOpts) -c "' >>site.tmp
|
2008-03-10 07:49:40 +01:00
|
|
|
@echo 'set compile_cxx "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) -c"' >> site.tmp
|
2007-05-11 08:47:16 +02:00
|
|
|
@echo 'set link "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) $(LD.Flags)"' >>site.tmp
|
2008-04-24 19:54:25 +02:00
|
|
|
@echo 'set llvmgcc "$(LLVMGCC) $(EXTRA_OPTIONS)"' >> site.tmp
|
2008-04-24 19:59:03 +02:00
|
|
|
@echo 'set llvmgxx "$(LLVMGCC) $(EXTRA_OPTIONS)"' >> site.tmp
|
2006-04-07 00:22:08 +02:00
|
|
|
@echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
|
2007-04-12 04:49:30 +02:00
|
|
|
@echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
|
2007-09-18 14:26:17 +02:00
|
|
|
@echo 'set ocamlc "$(OCAMLC) -cc $(CXX) -I $(LibDir)/ocaml"' >> site.tmp
|
2008-10-07 16:48:14 +02:00
|
|
|
@echo 'set valgrind "$(VALGRIND)"' >> site.tmp
|
2008-10-21 19:21:32 +02:00
|
|
|
@echo 'set grep "$(GREP)"' >>site.tmp
|
|
|
|
@echo 'set gas "$(GAS)"' >>site.tmp
|
2009-02-02 22:09:36 +01:00
|
|
|
@echo 'set llvmdsymutil "$(DSYMUTIL)"' >>site.tmp
|
2004-11-07 05:59:52 +01: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
|