1 #===- test/Makefile ----------------------------------------*- Makefile -*--===#
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # 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)
34 IGNORE_TESTS += llvm2cpp.exp
37 IGNORE_TESTS += $(filter-out $(BINDINGS_TO_BUILD:=.exp),$(ALL_BINDINGS:=.exp))
40 RUNTESTFLAGS += --ignore "$(strip $(IGNORE_TESTS))"
44 check-local:: site.exp
45 ( ulimit -t 600 ; ulimit -d 512000 ; \
46 PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
47 $(RUNTEST) $(RUNTESTFLAGS) )
49 check-local:: site.exp
50 @echo "*** dejagnu not found. Make sure runtest is in your PATH, then reconfigure llvm."
54 CLEANED_TESTONE := $(patsubst %/,%,$(TESTONE))
55 CLEANED_TESTONE := $(patsubst test/%,%,$(CLEANED_TESTONE))
56 SUBDIR := $(shell dirname $(CLEANED_TESTONE))
57 TESTPATH := $(LLVM_SRC_ROOT)/test/$(CLEANED_TESTONE)
58 check-one: site.exp $(TCLSH)
59 $(Verb)( echo "source $(LLVM_OBJ_ROOT)/test/site.exp" ; \
60 echo "set subdir $(SUBDIR)" ; \
61 echo "proc pass { msg } { puts \"PASS: \$$msg\" } "; \
62 echo "proc fail { msg } { puts \"FAIL: \$$msg\" }" ; \
63 echo "proc xfail { msg } { puts \"XFAIL: \$$msg\" }" ; \
64 echo "proc xpass { msg } { puts \"XPASS: \$$msg\" }" ; \
65 echo "source $(LLVM_SRC_ROOT)/test/lib/llvm.exp" ; \
66 echo "RunLLVMTests $(TESTPATH)" ) | \
67 ( ulimit -t 600 ; ulimit -d 512000 ; \
68 PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
73 $(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
75 site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config
76 @echo 'Making a new site.exp file...'
77 @echo '## these variables are automatically generated by make ##' >site.tmp
78 @echo '# Do not edit here. If you wish to override these values' >>site.tmp
79 @echo '# edit the last section' >>site.tmp
80 @echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
81 @echo 'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp
82 @echo 'set llvmgcc_langs "$(LLVMGCC_LANGS)"' >> site.tmp
83 @echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
84 @echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
85 @echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
86 @echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
87 @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
88 @echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
89 @echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
90 @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
91 @echo 'set gccpath "$(CC)"' >>site.tmp
92 @echo 'set gxxpath "$(CXX)"' >>site.tmp
93 @echo 'set compile_c "$(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -c "' >>site.tmp
94 @echo 'set compile_cxx "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) - c"' >> site.tmp
95 @echo 'set link "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) $(LD.Flags)"' >>site.tmp
96 @echo 'set llvmgcc "$(LLVMGCC)"' >> site.tmp
97 @echo 'set llvmgxx "$(LLVMGCC)"' >> site.tmp
98 @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
99 @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
100 @echo 'set ocamlc "$(OCAMLC) -cc $(CXX) -I $(LibDir)/ocaml"' >> site.tmp
101 @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
102 @test ! -f site.exp || \
103 sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
105 @test ! -f site.exp || mv site.exp site.bak
106 @mv site.tmp site.exp