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 #===------------------------------------------------------------------------===#
25 ifneq ($(GREP_OPTIONS
),)
26 $(warning GREP_OPTIONS environment variable may interfere with
test results
)
30 RUNTESTFLAGS
:= $(VERBOSE
)
34 CLEANED_TESTSUITE
:= $(patsubst %/,%,$(TESTSUITE
))
35 CLEANED_TESTSUITE
:= $(patsubst test/%,%,$(CLEANED_TESTSUITE
))
36 RUNTESTFLAGS
+= --tool
$(CLEANED_TESTSUITE
)
40 VALGRIND
:= valgrind
--tool
=memcheck
--quiet
--trace-children
=yes
--error-exitcode
=3 --leak-check
=full
46 IGNORE_TESTS
+= llvm2cpp.exp
49 IGNORE_TESTS
+= $(filter-out $(BINDINGS_TO_BUILD
:=.exp
),$(ALL_BINDINGS
:=.exp
))
52 RUNTESTFLAGS
+= --ignore
"$(strip $(IGNORE_TESTS))"
55 # Both AuroraUX & Solaris do not have the -m flag for ulimit
57 ULIMIT
=ulimit
-t
600 ; ulimit
-d
512000 ; ulimit
-v
512000 ;
59 ULIMIT
=ulimit
-t
600 ; ulimit
-d
512000 ; ulimit
-m
512000 ; ulimit
-v
512000 ;
63 check-local
:: site.exp
65 PATH
="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
66 $(RUNTEST
) $(RUNTESTFLAGS
) )
68 check-local
:: site.exp
69 @echo
"*** dejagnu not found. Make sure 'runtest' is in your PATH, then reconfigure LLVM."
73 CLEANED_TESTONE
:= $(patsubst %/,%,$(TESTONE
))
74 CLEANED_TESTONE
:= $(patsubst test/%,%,$(CLEANED_TESTONE
))
75 SUBDIR
:= $(shell dirname
$(CLEANED_TESTONE
))
76 TESTPATH
:= $(LLVM_SRC_ROOT
)/test/$(CLEANED_TESTONE
)
77 check-one
: site.exp
$(TCLSH
)
78 $(Verb
)( echo
"source $(LLVM_OBJ_ROOT)/test/site.exp" ; \
79 echo
"set subdir $(SUBDIR)" ; \
80 echo
"proc pass { msg } { puts \"PASS: \$$msg\" } "; \
81 echo
"proc fail { msg } { puts \"FAIL: \$$msg\" }" ; \
82 echo
"proc xfail { msg } { puts \"XFAIL: \$$msg\" }" ; \
83 echo
"proc xpass { msg } { puts \"XPASS: \$$msg\" }" ; \
84 echo
"proc verbose args { }" ; \
85 echo
"source $(LLVM_SRC_ROOT)/test/lib/llvm.exp" ; \
86 echo
"RunLLVMTests $(TESTPATH)" ) | \
88 PATH
="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
93 $(RM
) -rf
`find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
95 # dsymutil is used on the Darwin to manipulate DWARF debugging information.
101 ifdef TargetCommonOpts
102 BUGPOINT_TOPTS
="-gcc-tool-args $(TargetCommonOpts)"
108 CC_FOR_OCAMLC
:= $(shell $(OCAMLC
) -config | grep native_c_compiler | sed
-e
's/native_c_compiler: //')
109 CXX_FOR_OCAMLC
:= $(subst gcc
,g
++,$(CC_FOR_OCAMLC
))
115 @echo
'Making a new site.exp file...'
116 @echo
'## these variables are automatically generated by make ##' >site.tmp
117 @echo
'# Do not edit here. If you wish to override these values' >>site.tmp
118 @echo
'# edit the last section' >>site.tmp
119 @echo
'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
120 @echo
'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp
121 @echo
'set llvmgcc_langs "$(LLVMGCC_LANGS)"' >> site.tmp
122 @echo
'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
123 @echo
'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
124 @echo
'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
125 @echo
'set llvmlibsdir "$(LibDir)"' >>site.tmp
126 @echo
'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
127 @echo
'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
128 @echo
'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
129 @echo
'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
130 @echo
'set gccpath "$(CC)"' >>site.tmp
131 @echo
'set gxxpath "$(CXX)"' >>site.tmp
132 @echo
'set compile_c "' $(CC
) $(CPP.Flags
) $(TargetCommonOpts
) $(CompileCommonOpts
) -c
'"' >>site.tmp
133 @echo
'set compile_cxx "' $(CXX
) $(CPP.Flags
) $(CXX.Flags
) $(TargetCommonOpts
) $(CompileCommonOpts
) -c
'"' >> site.tmp
134 @echo
'set link "' $(CXX
) $(CPP.Flags
) $(CXX.Flags
) $(TargetCommonOpts
) $(CompileCommonOpts
) $(LD.Flags
) '"' >>site.tmp
135 @echo
'set llvmgcc "$(LLVMGCC) $(TargetCommonOpts) $(EXTRA_OPTIONS)"' >> site.tmp
136 @echo
'set llvmgxx "$(LLVMGCC) $(TargetCommonOpts) $(EXTRA_OPTIONS)"' >> site.tmp
137 @echo
'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
138 @echo
'set bugpoint_topts $(BUGPOINT_TOPTS)' >> site.tmp
139 @echo
'set shlibext "$(SHLIBEXT)"' >> site.tmp
140 @echo
'set ocamlc "$(OCAMLC) -cc \"$(CXX_FOR_OCAMLC)\" -I $(LibDir)/ocaml"' >> site.tmp
141 @echo
'set valgrind "$(VALGRIND)"' >> site.tmp
142 @echo
'set grep "$(GREP)"' >>site.tmp
143 @echo
'set gas "$(GAS)"' >>site.tmp
144 @echo
'set llvmdsymutil "$(DSYMUTIL)"' >>site.tmp
145 @echo
'## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
146 @
test ! -f site.exp || \
147 sed
'1,/^## All variables above are.*##/ d' site.exp
>> site.tmp
149 @
test ! -f site.exp || mv site.exp site.bak
150 @mv site.tmp site.exp