1 #===- test/Makefile ----------------------------------------*- Makefile -*--===#
3 # The LLVM Compiler Infrastructure
5 # This file was developed by the LLVM research group and is distributed under
6 # the University of Illinois Open Source License. See LICENSE.TXT for details.
8 #===------------------------------------------------------------------------===#
14 # Make Dejagnu the default for testing
18 # Include other test rules
19 include Makefile.tests
21 #===------------------------------------------------------------------------===#
22 # DejaGNU testing support
23 #===------------------------------------------------------------------------===#
26 CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE))
27 CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE))
28 RUNTESTFLAGS := --tool $(CLEANED_TESTSUITE)
32 RUNTESTFLAGS += --ignore llvm2cpp.exp
36 check-local:: site.exp
37 ( ulimit -t 600 ; ulimit -d 512000 ; \
38 PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
39 $(RUNTEST) $(RUNTESTFLAGS) )
41 check-local:: site.exp
42 @echo "*** dejagnu not found. Make sure runtest is in your PATH, then reconfigure llvm."
46 $(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
48 site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config
49 @echo 'Making a new site.exp file...'
50 @echo '## these variables are automatically generated by make ##' >site.tmp
51 @echo '# Do not edit here. If you wish to override these values' >>site.tmp
52 @echo '# edit the last section' >>site.tmp
53 @echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
54 @echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
55 @echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
56 @echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
57 @echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
58 @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
59 @echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
60 @echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
61 @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
62 @echo 'set llvmgcc "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp
63 @echo 'set llvmgxx "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp
64 @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
65 @echo 'set gxxcmd "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts)"' >> site.tmp
66 @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
67 @test ! -f site.exp || \
68 sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
70 @test ! -f site.exp || mv site.exp site.bak