llvm.org GIT mirror llvm / f468fd8
Revert r156393, "[tests] Remove some remaining DejaGNU related cruft.", this patch wasn't ready yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156395 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 8 years ago
4 changed file(s) with 241 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
10251025 AC_PATH_PROG(BZIP2, [bzip2])
10261026 AC_PATH_PROG(CAT, [cat])
10271027 AC_PATH_PROG(DOXYGEN, [doxygen])
1028 AC_PATH_PROG(GROFF, [groff])
10281029 AC_PATH_PROG(GZIPBIN, [gzip])
1030 AC_PATH_PROG(PDFROFF, [pdfroff])
1031 AC_PATH_PROG(RUNTEST, [runtest])
10291032 DJ_AC_PATH_TCLSH
10301033 AC_PATH_PROG(ZIP, [zip])
10311034 AC_PATH_PROGS(OCAMLC, [ocamlc])
10321035 AC_PATH_PROGS(OCAMLOPT, [ocamlopt])
10331036 AC_PATH_PROGS(OCAMLDEP, [ocamldep])
10341037 AC_PATH_PROGS(OCAMLDOC, [ocamldoc])
1038 AC_PATH_PROGS(GAS, [gas as])
10351039
10361040 dnl Get the version of the linker in use.
10371041 AC_LINK_GET_VERSION
740740 BZIP2
741741 CAT
742742 DOXYGEN
743 GROFF
743744 GZIPBIN
745 PDFROFF
746 RUNTEST
744747 TCLSH
745748 ZIP
746749 OCAMLC
747750 OCAMLOPT
748751 OCAMLDEP
749752 OCAMLDOC
753 GAS
750754 HAVE_LINK_VERSION_SCRIPT
751755 INSTALL_LTDL_TRUE
752756 INSTALL_LTDL_FALSE
71127116 fi
71137117
71147118
7119 # Extract the first word of "groff", so it can be a program name with args.
7120 set dummy groff; ac_word=$2
7121 { echo "$as_me:$LINENO: checking for $ac_word" >&5
7122 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
7123 if test "${ac_cv_path_GROFF+set}" = set; then
7124 echo $ECHO_N "(cached) $ECHO_C" >&6
7125 else
7126 case $GROFF in
7127 [\\/]* | ?:[\\/]*)
7128 ac_cv_path_GROFF="$GROFF" # Let the user override the test with a path.
7129 ;;
7130 *)
7131 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7132 for as_dir in $PATH
7133 do
7134 IFS=$as_save_IFS
7135 test -z "$as_dir" && as_dir=.
7136 for ac_exec_ext in '' $ac_executable_extensions; do
7137 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
7138 ac_cv_path_GROFF="$as_dir/$ac_word$ac_exec_ext"
7139 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7140 break 2
7141 fi
7142 done
7143 done
7144 IFS=$as_save_IFS
7145
7146 ;;
7147 esac
7148 fi
7149 GROFF=$ac_cv_path_GROFF
7150 if test -n "$GROFF"; then
7151 { echo "$as_me:$LINENO: result: $GROFF" >&5
7152 echo "${ECHO_T}$GROFF" >&6; }
7153 else
7154 { echo "$as_me:$LINENO: result: no" >&5
7155 echo "${ECHO_T}no" >&6; }
7156 fi
7157
7158
71157159 # Extract the first word of "gzip", so it can be a program name with args.
71167160 set dummy gzip; ac_word=$2
71177161 { echo "$as_me:$LINENO: checking for $ac_word" >&5
71527196 fi
71537197
71547198
7199 # Extract the first word of "pdfroff", so it can be a program name with args.
7200 set dummy pdfroff; ac_word=$2
7201 { echo "$as_me:$LINENO: checking for $ac_word" >&5
7202 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
7203 if test "${ac_cv_path_PDFROFF+set}" = set; then
7204 echo $ECHO_N "(cached) $ECHO_C" >&6
7205 else
7206 case $PDFROFF in
7207 [\\/]* | ?:[\\/]*)
7208 ac_cv_path_PDFROFF="$PDFROFF" # Let the user override the test with a path.
7209 ;;
7210 *)
7211 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7212 for as_dir in $PATH
7213 do
7214 IFS=$as_save_IFS
7215 test -z "$as_dir" && as_dir=.
7216 for ac_exec_ext in '' $ac_executable_extensions; do
7217 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
7218 ac_cv_path_PDFROFF="$as_dir/$ac_word$ac_exec_ext"
7219 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7220 break 2
7221 fi
7222 done
7223 done
7224 IFS=$as_save_IFS
7225
7226 ;;
7227 esac
7228 fi
7229 PDFROFF=$ac_cv_path_PDFROFF
7230 if test -n "$PDFROFF"; then
7231 { echo "$as_me:$LINENO: result: $PDFROFF" >&5
7232 echo "${ECHO_T}$PDFROFF" >&6; }
7233 else
7234 { echo "$as_me:$LINENO: result: no" >&5
7235 echo "${ECHO_T}no" >&6; }
7236 fi
7237
7238
7239 # Extract the first word of "runtest", so it can be a program name with args.
7240 set dummy runtest; ac_word=$2
7241 { echo "$as_me:$LINENO: checking for $ac_word" >&5
7242 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
7243 if test "${ac_cv_path_RUNTEST+set}" = set; then
7244 echo $ECHO_N "(cached) $ECHO_C" >&6
7245 else
7246 case $RUNTEST in
7247 [\\/]* | ?:[\\/]*)
7248 ac_cv_path_RUNTEST="$RUNTEST" # Let the user override the test with a path.
7249 ;;
7250 *)
7251 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7252 for as_dir in $PATH
7253 do
7254 IFS=$as_save_IFS
7255 test -z "$as_dir" && as_dir=.
7256 for ac_exec_ext in '' $ac_executable_extensions; do
7257 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
7258 ac_cv_path_RUNTEST="$as_dir/$ac_word$ac_exec_ext"
7259 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7260 break 2
7261 fi
7262 done
7263 done
7264 IFS=$as_save_IFS
7265
7266 ;;
7267 esac
7268 fi
7269 RUNTEST=$ac_cv_path_RUNTEST
7270 if test -n "$RUNTEST"; then
7271 { echo "$as_me:$LINENO: result: $RUNTEST" >&5
7272 echo "${ECHO_T}$RUNTEST" >&6; }
7273 else
7274 { echo "$as_me:$LINENO: result: no" >&5
7275 echo "${ECHO_T}no" >&6; }
7276 fi
7277
7278
71557279
71567280 no_itcl=true
71577281 { echo "$as_me:$LINENO: checking for the tclsh program in tclinclude directory" >&5
74607584
74617585
74627586 test -n "$OCAMLDOC" && break
7587 done
7588
7589 for ac_prog in gas as
7590 do
7591 # Extract the first word of "$ac_prog", so it can be a program name with args.
7592 set dummy $ac_prog; ac_word=$2
7593 { echo "$as_me:$LINENO: checking for $ac_word" >&5
7594 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
7595 if test "${ac_cv_path_GAS+set}" = set; then
7596 echo $ECHO_N "(cached) $ECHO_C" >&6
7597 else
7598 case $GAS in
7599 [\\/]* | ?:[\\/]*)
7600 ac_cv_path_GAS="$GAS" # Let the user override the test with a path.
7601 ;;
7602 *)
7603 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7604 for as_dir in $PATH
7605 do
7606 IFS=$as_save_IFS
7607 test -z "$as_dir" && as_dir=.
7608 for ac_exec_ext in '' $ac_executable_extensions; do
7609 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
7610 ac_cv_path_GAS="$as_dir/$ac_word$ac_exec_ext"
7611 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7612 break 2
7613 fi
7614 done
7615 done
7616 IFS=$as_save_IFS
7617
7618 ;;
7619 esac
7620 fi
7621 GAS=$ac_cv_path_GAS
7622 if test -n "$GAS"; then
7623 { echo "$as_me:$LINENO: result: $GAS" >&5
7624 echo "${ECHO_T}$GAS" >&6; }
7625 else
7626 { echo "$as_me:$LINENO: result: no" >&5
7627 echo "${ECHO_T}no" >&6; }
7628 fi
7629
7630
7631 test -n "$GAS" && break
74637632 done
74647633
74657634
1015410323 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1015510324 lt_status=$lt_dlunknown
1015610325 cat > conftest.$ac_ext <
10157 #line 10158 "configure"
10326 #line 10327 "configure"
1015810327 #include "confdefs.h"
1015910328
1016010329 #if HAVE_DLFCN_H
2197422143 BZIP2!$BZIP2$ac_delim
2197522144 CAT!$CAT$ac_delim
2197622145 DOXYGEN!$DOXYGEN$ac_delim
22146 GROFF!$GROFF$ac_delim
2197722147 GZIPBIN!$GZIPBIN$ac_delim
22148 PDFROFF!$PDFROFF$ac_delim
22149 RUNTEST!$RUNTEST$ac_delim
2197822150 TCLSH!$TCLSH$ac_delim
2197922151 ZIP!$ZIP$ac_delim
2198022152 OCAMLC!$OCAMLC$ac_delim
2198122153 OCAMLOPT!$OCAMLOPT$ac_delim
2198222154 OCAMLDEP!$OCAMLDEP$ac_delim
2198322155 OCAMLDOC!$OCAMLDOC$ac_delim
22156 GAS!$GAS$ac_delim
2198422157 HAVE_LINK_VERSION_SCRIPT!$HAVE_LINK_VERSION_SCRIPT$ac_delim
2198522158 INSTALL_LTDL_TRUE!$INSTALL_LTDL_TRUE$ac_delim
2198622159 INSTALL_LTDL_FALSE!$INSTALL_LTDL_FALSE$ac_delim
2202022193 LTLIBOBJS!$LTLIBOBJS$ac_delim
2202122194 _ACEOF
2202222195
22023 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 86; then
22196 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
2202422197 break
2202522198 elif $ac_last_try; then
2202622199 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
308308 Lit documentation for more
309309 information.

310310
311

The lit test runner looks at each file that is passed to it and

312 gathers any lines together that match "RUN:". These are the "RUN" lines that
313 specify how the test is to be run. So, each test script must contain RUN lines
314 if it is to do anything. If there are no RUN lines, lit function will
315 issue an error and the test will fail.

311

The llvm-runtests function looks at each file that is passed to

312 it and gathers any lines together that match "RUN:". These are the "RUN" lines
313 that specify how the test is to be run. So, each test script must contain
314 RUN lines if it is to do anything. If there are no RUN lines, the
315 llvm-runtests function will issue an error and the test will
316 fail.

316317
317318

RUN lines are specified in the comments of the test program using the

318319 keyword RUN followed by a colon, and lastly the command (pipeline)
319320 to execute. Together, these lines form the "script" that
320 lit executes to run the test case. The syntax of the RUN lines is
321 similar to a shell's syntax for pipelines including I/O redirection and
322 variable substitution. However, even though these lines may look like
323 a shell script, they are not. RUN lines are interpreted directly by the
324 Tcl exec command. They are never executed by a shell. Consequently
325 the syntax differs from normal shell script syntax in a few ways. You can
326 specify as many RUN lines as needed.

321 llvm-runtests executes to run the test case. The syntax of the
322 RUN lines is similar to a shell's syntax for pipelines including I/O
323 redirection and variable substitution. However, even though these lines
324 may look like a shell script, they are not. RUN lines are interpreted
325 directly by the Tcl exec command. They are never executed by a
326 shell. Consequently the syntax differs from normal shell script syntax in a
327 few ways. You can specify as many RUN lines as needed.

327328
328329

lit performs substitution on each RUN line to replace LLVM tool

329330 names with the full paths to the executable built for each tool (in
811812
812813
813814
815

To make the output more useful, the llvm_runtest function wil

816 scan the lines of the test case for ones that contain a pattern that matches
817 PR[0-9]+. This is the syntax for specifying a PR (Problem Report) number that
818 is related to the test case. The number after "PR" specifies the LLVM bugzilla
819 number. When a PR number is specified, it will be used in the pass/fail
820 reporting. This is useful to quickly get some context when a test fails.

821
814822

Finally, any line that contains "END." will cause the special

815823 interpretation of lines to terminate. This is generally done right after the
816824 last RUN: line. This has two side effects: (a) it prevents special
2626 endif
2727
2828 ifdef VERBOSE
29 RUNTESTFLAGS := $(VERBOSE)
2930 LIT_ARGS := -v
3031 else
3132 LIT_ARGS := -s -v
4041 LIT_TESTSUITE := $(TESTSUITE)
4142 CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE))
4243 CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE))
44 RUNTESTFLAGS += --tool $(CLEANED_TESTSUITE)
4345 else
4446 LIT_TESTSUITE := .
4547 endif
7375 IGNORE_TESTS += llvm2cpp.exp
7476 endif
7577
78 ifdef IGNORE_TESTS
79 RUNTESTFLAGS += --ignore "$(strip $(IGNORE_TESTS))"
80 endif
81
7682 # ulimits like these are redundantly enforced by the buildbots, so
7783 # just removing them here won't work.
7884 # Both AuroraUX & Solaris do not have the -m flag for ulimit
8692 ULIMIT=ulimit -t 600 ; ulimit -d 512000 ; ulimit -m 512000 ; ulimit -v 1024000 ;
8793 endif # AuroraUX
8894 endif # SunOS
95
96 ifneq ($(RUNTEST),)
97 check-local-dg:: site.exp
98 ( $(ULIMIT) \
99 PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(LLVMGCCDIR)/bin:$(PATH)" \
100 $(RUNTEST) $(RUNTESTFLAGS) )
101 else
102 check-local-dg:: site.exp
103 @echo "*** dejagnu not found. Make sure 'runtest' is in your PATH, then reconfigure LLVM."
104 endif
89105
90106 check-local-lit:: lit.site.cfg Unit/lit.site.cfg
91107 ( $(ULIMIT) \
112128
113129 FORCE:
114130
131 site.exp: FORCE
132 @echo 'Making a new site.exp file...'
133 @echo '## Autogenerated by LLVM configuration.' > site.tmp
134 @echo '# Do not edit!' >> site.tmp
135 @echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
136 @echo 'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp
137 @echo 'set llvmshlibdir "$(SharedLibDir)"' >>site.tmp
138 @echo 'set llvm_bindings "$(BINDINGS_TO_BUILD)"' >> site.tmp
139 @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
140 @echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
141 @echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
142 @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
143 @echo 'set link "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) '"' >>site.tmp
144 @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
145 @echo 'set ocamlopt "$(OCAMLOPT) -cc \"$(CXX_FOR_OCAMLOPT)\" -I $(LibDir)/ocaml"' >> site.tmp
146 @echo 'set valgrind "$(VALGRIND)"' >> site.tmp
147 @echo 'set grep "$(GREP)"' >>site.tmp
148 @echo 'set gas "$(GAS)"' >>site.tmp
149 @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
150 @test ! -f site.exp || \
151 sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
152 @-rm -f site.bak
153 @test ! -f site.exp || mv site.exp site.bak
154 @mv site.tmp site.exp
155
115156 ifeq ($(DISABLE_ASSERTIONS),1)
116157 ENABLE_ASSERTIONS=0
117158 else
118159 ENABLE_ASSERTIONS=1
119160 endif
120161
121 lit.site.cfg: FORCE
162 lit.site.cfg: site.exp
122163 @echo "Making LLVM 'lit.site.cfg' file..."
123164 @$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > lit.tmp
124165 @$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp