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