xref: /petsc/gmakefile.test (revision cb497662fae1ebe98e095979598fa3ebb2f149fa)
1# -*- mode: makefile-gmake -*-
2-include petscdir.mk
3
4.SUFFIXES: .F  .F90 .f90 ${SUFFIXES} .PETSc .C .cc .cpp .cxx .r .rm .so .html .ad .m .tex .mtex .make  .fig .svg .eps .pdf .jpg .png .dvi .ps .F95 .f95 .fiat .cu .kokkos.cxx
5
6CONFIGDIR := $(PETSC_DIR)/config
7
8# TESTSRCDIR is always relative to gmakefile.test
9#  This must be before includes
10mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
11TESTSRCDIR := $(dir $(mkfile_path))src
12
13-include $(PETSC_DIR)/$(PETSC_ARCH)/lib/petsc/conf/petscvariables
14-include $(PETSC_DIR)/lib/petsc/conf/variables
15
16TESTDIR ?= ./$(PETSC_ARCH)/tests
17MODDIR := $(PETSC_DIR)/$(PETSC_ARCH)/include
18TESTLOGTAPFILE ?= $(TESTDIR)/test_$(PETSC_ARCH)_tap.log
19TESTLOGERRFILE ?= $(TESTDIR)/test_$(PETSC_ARCH)_err.log
20EXAMPLESDIR := $(TESTSRCDIR)
21
22pkgs := sys vec mat dm ksp snes ts tao
23
24petscconf      := $(PETSC_DIR)/$(PETSC_ARCH)/include/petscconf.h
25petscvariables := $(PETSC_DIR)/$(PETSC_ARCH)/lib/petsc/conf/petscvariables
26generatedtest  := $(TESTDIR)/testfiles
27
28.SECONDEXPANSION:		# to expand $$(@D)/.DIR
29
30TESTFLAGS :=             # Initialize as simple variable
31
32#workarround old cygwin versions
33ifeq ($(PETSC_CYGWIN_BROKEN_PIPE),1)
34ifeq ($(shell basename $(AR)),ar)
35  V ?=1
36endif
37endif
38V ?= $(if $(findstring s,$(MAKEFLAGS)),0)
39ifeq ($(V),)  # Default
40  quiet_HELP := "Use \"$(MAKE) V=1\" to see verbose compile lines, \"$(MAKE) V=0\" to suppress.\n"
41  quiet = @printf $(quiet_HELP)$(eval quiet_HELP:=)"  %10s %s\n" "$1$2" "$@"; $($1)
42  quiettest = @printf "  %10s %s\n" "TEST" "$(@:$(TESTDIR)/counts/%.counts=%)";
43else ifeq ($(V),0)		# Suppress entire command
44  quiet = @$($1)
45  quiettest = @
46  TESTFLAGS += -o err_only
47else				# Show the full command line
48  quiet = $($1)
49  quiettest =
50  TESTFLAGS += -v
51endif
52
53ifeq ($(FORCE),1)
54  TESTFLAGS += -f    # force test execution
55endif
56ifeq ($(CUDAMEMCHECK),1)
57  TESTFLAGS += -U    # Add cuda-memcheck option to the flags
58endif
59ifeq ($(VALGRIND),1)
60  TESTFLAGS += -V    # Add valgrind option to the flags
61endif
62ifeq ($(DEBUG),1)
63  TESTFLAGS += -d    # Launch test in debugger
64endif
65ifeq ($(REPLACE),1)
66  TESTFLAGS += -m    # Replace results by passing -m to petscdiff
67endif
68ifeq ($(OUTPUT),1)
69  TESTFLAGS += -o 'err_only'    # Show only the errors on stdout
70endif
71ifeq ($(ALT),1)
72  TESTFLAGS += -M    # Replace alt files by passing -M to petscdiff
73endif
74PRINTONLY ?= 0
75ifeq ($(PRINTONLY),1)
76  TESTFLAGS += -p    # Pass -p to petscdiff to print only command
77endif
78ifeq ($(DIFF_NUMBERS),1)
79  TESTFLAGS += -j    # Pass -j to petscdiff to diff the actual numbers
80endif
81ifdef OPTIONS
82  TESTFLAGS += -a '$(OPTIONS)'   # override arguments
83endif
84ifdef EXTRA_OPTIONS
85  TESTFLAGS += -e '$(EXTRA_OPTIONS)'  # add extra arguments
86endif
87ifdef NP
88  TESTFLAGS += -n $(NP)  # set number of processes
89endif
90# Override the default timeout that may be found at the top of config/petsc_harness.sh
91# This must be an integer.  It is given in seconds.
92ifdef TIMEOUT
93  TESTFLAGS += -t $(TIMEOUT)  # Override the default timeout
94endif
95
96$(generatedtest) : $(petscconf) $(petscvariables) $(CONFIGDIR)/gmakegentest.py $(TESTDIR)/.DIR | $$(@D)/.DIR
97	$(PYTHON) $(CONFIGDIR)/gmakegentest.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH) --testdir=$(TESTDIR)
98
99ifneq ($(filter-out clean check,$(MAKECMDGOALS:clean%=clean)),)
100include $(generatedtest)
101endif
102
103ifeq ($(PETSC_LANGUAGE),CXXONLY)
104  cc_name := CXX
105else
106  cc_name := CC
107endif
108
109PETSC_COMPILE.c = $(call quiet,$(cc_name)) -c $(PCC_FLAGS) $(PFLAGS) $(CCPPFLAGS) $(C_DEPFLAGS)
110PETSC_COMPILE.cxx = $(call quiet,CXX) -c $(CXX_FLAGS) $(CXXFLAGS) $(CXXCPPFLAGS) $(CXX_DEPFLAGS)
111ifneq ($(KOKKOS_BIN),)
112# Kokkos requires nvcc to be in PATH and the C++ compiler to be given in an environmental variable
113PETSC_COMPILE.kokkos.cxx = PATH=$(PATH):`dirname $(CUDAC)` NVCC_WRAPPER_DEFAULT_COMPILER=$(CXX_LINKER) $(KOKKOS_BIN)/nvcc_wrapper --expt-extended-lambda -c $(CXX_FLAGS) $(CXXFLAGS) $(CXXCPPFLAGS)
114PETSC_LINK.kokkos.cxx = PATH=$(PATH):`dirname $(CUDAC)` NVCC_WRAPPER_DEFAULT_COMPILER=$(CXX_LINKER) $(KOKKOS_BIN)/nvcc_wrapper --expt-extended-lambda  $(CXX_LINKER_FLAGS) $(PETSC_CCPPFLAGS) $(CPPFLAGS) $(LDFLAGS)
115else
116PETSC_COMPILE.kokkos.cxx = $(call quiet,CXX) -c $(CXX_FLAGS) $(CXXFLAGS) $(CXXCPPFLAGS) $(CXX_DEPFLAGS)
117PETSC_LINK.kokkos.cxx = $(CXXLINKER) $(CXX_LINKER_FLAGS) $(CXXFLAGS) $(PETSC_CCPPFLAGS) $(CPPFLAGS) $(LDFLAGS)
118endif
119PETSC_COMPILE.cu = $(call quiet,CUDAC) -c $(CUDAC_FLAGS) $(CUFLAGS) --compiler-options="$(PCC_FLAGS) $(CXXFLAGS) $(CCPPFLAGS)"
120PETSC_COMPILE.hip.cpp = $(call quiet,HIPCC) -c $(HIPCC_FLAGS) $(HIPCCFLAGS) $(HIPCCPPFLAGS) $(HIPCC_DEPFLAGS)
121PETSC_COMPILE.sycl.cpp = $(call quiet,SYCLCPP) -c $(SYCLCPP_FLAGS) $(SYCLCPPFLAGS) $(SYCLCPPCPPFLAGS) $(SYCLCPP_DEPFLAGS)
122PETSC_GENDEPS.cu = $(call quiet,CUDAC,.dep) --generate-dependencies --output-directory=$(@D) $(CUDAC_FLAGS) $(CUFLAGS) --compiler-options="$(PCC_FLAGS) $(CXXFLAGS) $(CCPPFLAGS)"
123PETSC_COMPILE.F = $(call quiet,FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS)
124
125testlangs := c cu cxx F F90 kokkos.cxx hip.cpp sycl.cpp
126$(foreach lang, $(testlangs), $(eval \
127  testexe.$(lang) = $(foreach pkg, $(pkgs), $(testsrcs-$(pkg).$(lang):%.$(lang)=$(TESTDIR)/%))))
128concattestlang = $(foreach lang, $(2), $(testsrcs-$(1).$(lang):%.$(lang)=$(TESTDIR)/%.o))
129testsrcs.o := $(foreach pkg, $(pkgs), $(call concattestlang,$(pkg),$(testlangs)))
130testsrcs-rel := $(foreach pkg, $(pkgs), $(foreach lang, $(testlangs), $(testsrcs-$(pkg).$(lang))))
131testsrcs := $(foreach sfile, $(testsrcs-rel), $(TESTSRCDIR)/$(sfile))
132
133# workaround win32fe failure
134ifneq (,$(findstring win32fe,$(call quiet,$(cc_name))))
135$(TESTDIR)/ts/tutorials/multirate/ex6: | $(TESTDIR)/ts/tutorials/multirate/ex5
136$(TESTDIR)/ts/tutorials/multirate/ex8: | $(TESTDIR)/ts/tutorials/multirate/ex6
137endif
138
139# Refresh testfiles when sources change, but don't balk if the source file is nonexistent (deleted)
140$(generatedtest) : $(testsrcs)
141$(testsrcs) :
142
143$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.c | $$(@D)/.DIR
144	$(PETSC_COMPILE.c) $(abspath $<) -o $@
145
146$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.kokkos.cxx | $$(@D)/.DIR
147	$(PETSC_COMPILE.kokkos.cxx) $(abspath $<) -o $@
148
149$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.cxx | $$(@D)/.DIR
150	$(PETSC_COMPILE.cxx) $(abspath $<) -o $@
151
152$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.cu | $$(@D)/.DIR
153	$(PETSC_COMPILE.cu) $(abspath $<) -o $@ # Compile first so that if there is an error, it comes from a normal compile
154	@$(PETSC_GENDEPS.cu) $(abspath $<) -o $(@:%.o=%.d) # Generate the dependencies for later
155
156# Test modules go in the same directory as the target *.o
157TESTMODDIR = $(@D)
158FCMOD = cd
159$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.F | $$(@D)/.DIR
160ifeq ($(FC_MODULE_OUTPUT_FLAG),)
161	$(call quiet,FCMOD) $(TESTMODDIR) && $(FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS) -I$(dir $<) $(abspath $<) -o $(abspath $@)
162else
163	$(PETSC_COMPILE.F) -I$(dir $<) $(abspath $<) -o $@ $(FC_MODULE_OUTPUT_FLAG)$(TESTMODDIR) $(FC_MODULE_FLAG)$(TESTMODDIR)
164endif
165	-@$(GFORTRAN_DEP_CLEANUP)
166
167$(TESTDIR)/%.o : $(EXAMPLESDIR)/%.F90 | $$(@D)/.DIR
168ifeq ($(FC_MODULE_OUTPUT_FLAG),)
169	$(call quiet,FCMOD) $(TESTMODDIR) && $(FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS) -I$(dir $<) $(abspath $<) -o $(abspath $@)
170else
171	$(PETSC_COMPILE.F) -I$(dir $<) $(abspath $<) -o $@ $(FC_MODULE_OUTPUT_FLAG)$(TESTMODDIR) $(FC_MODULE_FLAG)$(TESTMODDIR)
172endif
173	-@$(GFORTRAN_DEP_CLEANUP)
174
175#   This is a hack to fix a broken gfortran.
176define GFORTRAN_DEP_CLEANUP
177  if test -e "$(@:%.o=%.d)" && head -1 "$(@:%.o=%.d)" | fgrep -q -v : ; then\
178    echo "$(@): \\" > $(@:%.o=%.dtemp) ; \
179    tr '\n' '@' < $(@:%.o=%.d) | cut -d: -f2- | tr '@' '\n' >> $(@:%.o=%.dtemp) ; \
180    mv $(@:%.o=%.dtemp) $(@:%.o=%.d); \
181  fi
182endef
183
184# link line constructed differently for gmakefile vs gmakefile.test invocation
185ifeq ($(libpetscall),)
186PETSC_TEST_LIB = $(PETSC_LIB)
187else
188PETSC_TEST_LIB = $(C_SH_LIB_PATH) $(PETSC_EXTERNAL_LIB_BASIC)
189endif
190
191# manually list some some library dependencies to check for circular dependencies
192$(TESTDIR)/sys/tests/ex9: PETSC_TEST_LIB = $(PETSC_SYS_LIB)
193$(TESTDIR)/vec/vec/tests/ex1: PETSC_TEST_LIB = $(PETSC_VEC_LIB)
194$(TESTDIR)/mat/tests/ex1: PETSC_TEST_LIB = $(PETSC_MAT_LIB)
195$(TESTDIR)/dm/tests/ex1: PETSC_TEST_LIB = $(PETSC_DM_LIB)
196$(TESTDIR)/ksp/ksp/tests/ex1: PETSC_TEST_LIB = $(PETSC_KSP_LIB)
197$(TESTDIR)/snes/tests/ex1: PETSC_TEST_LIB = $(PETSC_SNES_LIB)
198$(TESTDIR)/ts/tests/ex2: PETSC_TEST_LIB = $(PETSC_TS_LIB)
199$(TESTDIR)/tao/tutorials/ex1: PETSC_TEST_LIB = $(PETSC_TAO_LIB)
200
201# if configured --with-macos-firewall-rules, ensure mpiexec.hydra and test executable is on firewall list
202ifdef MACOS_FIREWALL_MPIEXEC
203define macos-firewall-register
204  @APP=$(call abspath, $(1)); \
205    FW=/usr/libexec/ApplicationFirewall/socketfilterfw; \
206    ANS=`$$FW --getappblocked $$APP`; \
207    if ! echo $$ANS | grep "$$APP" &> /dev/null; then \
208      if ! sudo -n true 2>/dev/null; then echo "Asking for sudo password to add new firewall rule for\n  $$APP:"; fi; \
209      sudo $$FW --add $$APP && \
210      sudo $$FW --blockapp $$APP; \
211    else \
212      echo $$ANS; \
213    fi
214endef
215define macos-firewall-fix
216  $(call macos-firewall-register, $(MACOS_FIREWALL_MPIEXEC))
217  $(call macos-firewall-register, $(1))
218endef
219endif
220
221# Test executables
222$(testexe.F) $(testexe.F90) : $(TESTDIR)/% : $(TESTDIR)/%.o $$^ $(libpetscall)
223	$(call quiet,FLINKER) -o $@ $^ $(PETSC_TEST_LIB)
224	-$(call macos-firewall-fix,$@)
225
226$(testexe.c) $(testexe.cu) : $(TESTDIR)/% : $(TESTDIR)/%.o $$^ $(libpetscall)
227	$(call quiet,CLINKER) -o $@ $^ $(PETSC_TEST_LIB)
228	-$(call macos-firewall-fix,$@)
229
230$(testexe.kokkos.cxx) : $(TESTDIR)/% : $(TESTDIR)/%.o $$^ $(libpetscall)
231	$(call quiet,PETSC_LINK.kokkos.cxx) -o $@ $^ $(PETSC_TEST_LIB)
232	-$(call macos-firewall-fix,$@)
233
234$(testexe.cxx) : $(TESTDIR)/% : $(TESTDIR)/%.o $$^ $(libpetscall)
235	$(call quiet,CXXLINKER) -o $@ $^ $(PETSC_TEST_LIB)
236	-$(call macos-firewall-fix,$@)
237
238# Fortran source files need petsc*.mod, which isn't explicitly managed in the makefile.
239$(foreach pkg, $(pkgs), $(call concattestlang,$(pkg),F F90)) : $(libpetscall)
240
241# Testing convenience targets
242.PHONY: test pre-clean
243
244test: report_tests
245
246pre-clean:
247	@$(RM) -rf $(TESTDIR)/counts $(TESTLOGTAPFILE) $(TESTLOGERRFILE)
248	@touch $(TESTLOGTAPFILE) $(TESTLOGERRFILE)
249	@echo "Using MAKEFLAGS:" ${MAKEFLAGS}
250
251check-test-errors:
252	@grep '^not ok' $(TESTLOGTAPFILE) | grep -v 'Exceeded timeout' | tee $(TESTDIR)/allgtests-tap-err.log
253	@test ! -s $(TESTDIR)/allgtests-tap-err.log
254
255.PHONY: $(foreach pkg, $(pkgs), test-$(pkg) $(foreach lang, $(testlangs), test-$(pkg).$(lang) test-rm-$(pkg).$(lang)))
256testpkgs := $(foreach pkg, $(pkgs), test-$(pkg))
257# Targets to run tests in test-$pkg.$lang and delete the executables, language by language
258$(testpkgs) : test-% : $(foreach lang, $(testlangs), test-rm-%.$(lang))
259# List of raw test run targets
260alltesttargets := $(foreach tp, $(testpkgs), $(foreach lang, $(testlangs), $($(tp).$(lang))))
261
262# Run targets
263$(alltesttargets) : % : $(TESTDIR)/counts/%.counts
264.PHONY: $(alltesttargets)
265
266$(TESTDIR)/counts/%.counts :
267	$(quiettest) $< $(TESTFLAGS)
268
269# Targets to run tests and remove executables, by package-lang pairs.
270# Run the tests in each batch using recursive invocation of make because
271# we need all of them to complete before removing the executables.  Make
272# doesn't guarantee an exploration order for the graph.  Only recursive
273# if there is something to be done.
274alltest-rm := $(foreach pkg, $(pkgs), $(foreach lang, $(testlangs), test-rm-$(pkg).$(lang)))
275$(alltest-rm) : test-rm-% : test-%
276ifneq ($(NO_RM),1)
277	$(call quiet,RM) $(addprefix $(TESTDIR)/,$(basename $($(@:test-rm-%=testsrcs-%))))
278endif
279
280# Remove intermediate .o files
281# This only removes the files at the end which is insufficient
282#.INTERMEDIATE: $(testsrcs.o:%.o=%)
283
284# all sources should get recompiled when petscvariables changes (i.e when configure is rerun or when petscvariables is manually edited.)
285$(testsrcs.o) : $(petscvariables)
286
287%/.DIR :
288	@mkdir -p $(@D)
289	@touch $@
290
291.PRECIOUS: %/.DIR
292
293.SUFFIXES: # Clear .SUFFIXES because we don't use implicit rules
294.DELETE_ON_ERROR:               # Delete likely-corrupt target file if rule fails
295
296.PHONY: clean cleantest all
297
298cleantest:
299	${RM} -r $(TESTDIR) $(generatedtest)
300
301clean: cleantest
302
303alltest.d := $(testsrcs.o:%.o=%.d)
304# Tell make that alltest.d are all up to date.  Without this, the include
305# below has quadratic complexity, taking more than one second for a
306# do-nothing build of PETSc (much worse for larger projects)
307$(alltest.d) : ;
308
309-include $(alltest.d)
310
311# Tests can be generated by searching -- see documentation below
312ifndef searchin
313   searchin = " "
314endif
315ifdef i
316   searchin = $(i)
317endif
318ifdef gmakesearch
319  TESTTARGETS := $(filter $(gmakesearch),$(alltesttargets))
320  ifdef gmakesearchin
321    TESTTARGETS2 := $(foreach v,$(TESTTARGETS),$(if $(findstring $(gmakesearchin),$(v)),$(v)))
322    TESTTARGETS := $(TESTTARGETS2)
323  endif
324else ifdef gmakesearchin
325  TESTTARGETS := $(foreach v,$(alltesttargets),$(if $(findstring $(gmakesearchin),$(v)),$(v)))
326else ifdef argsearch
327  TESTTARGETS := $(foreach v,$(alltesttargets),$(if $(findstring $(argsearch),$($(v)_ARGS)),$(v)))
328else ifdef search
329  TESTTARGETS := $(shell $(PYTHON) config/query_tests.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH) --searchin=$(searchin) 'name' '$(search)')
330else ifdef s
331  TESTTARGETS := $(shell $(PYTHON) config/query_tests.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH) --searchin=$(searchin) 'name' '$(s)')
332else ifdef test-fail
333  TESTTARGETS := $(shell $(PETSC_ARCH)/tests/echofailures.sh)
334else ifdef query
335  TESTTARGETS := $(shell $(PYTHON) config/query_tests.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH) --searchin=$(searchin) '$(query)' '$(queryval)')
336else ifdef q
337  TESTTARGETS := $(shell $(PYTHON) config/query_tests.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH) --searchin=$(searchin) '$(q)' '$(qv)')
338else                            # No filter - run them all, but delete the executables as we go
339  TESTTARGETS := $(testpkgs)
340endif
341
342.PHONY: report_tests print-test
343
344print-test:
345	$(info $(TESTTARGETS))
346	@true
347
348show-fail:
349	-@$(PYTHON) $(CONFIGDIR)/report_tests.py -d $(TESTDIR)/counts -f
350
351
352
353# Don't start running tests until starttime has completed
354$(alltesttargets:%=$(TESTDIR)/counts/%.counts) : starttime
355
356# Ensure that libpetsc (if it is a prerequisite) has been built and clean the counts/logs before starting timer
357starttime: pre-clean $(libpetscall)
358	@$(eval STARTTIME := $(shell date +%s))
359
360report_tests: starttime $(TESTTARGETS)
361	@$(eval ENDTIME := $(shell date +%s))
362	-@if test ${PRINTONLY} -ne 1; then  elapsed_time=$$(($(ENDTIME)- $(STARTTIME))) && \
363	$(PYTHON) $(CONFIGDIR)/report_tests.py -m $(MAKE) -d $(TESTDIR)/counts -t 5 -e $${elapsed_time};\
364    fi
365
366check_output:
367	$(PYTHON) $(CONFIGDIR)/gmakegentest.py --petsc-dir=$(PETSC_DIR) --petsc-arch=$(PETSC_ARCH) --testdir=$(TESTDIR) --check-output
368
369# Do not how how to invoke test from makefile
370HASGMAKEFILE := $(filter gmakefile,$(MAKEFILE_LIST))
371ifeq ($(HASGMAKEFILE),gmakefile)
372helpdeps:=help-make help-targets
373makefile="gmakefile"
374other_help="To see full test help: make -f gmakefile.test help"
375else
376helpdeps:=help-make help-targets help-test
377makefile="gmakefile.test"
378other_help=""
379endif
380
381help: ${helpdeps}
382	-@echo "Above is from: ${helpdeps}"
383	-@echo "${other_help}"
384
385help-make:
386	-@echo
387	-@echo "Basic build usage:"
388	-@echo "   make -f ${makefile} <options>"
389	-@echo
390	-@echo "Options:"
391	-@echo "  V=0           Very quiet builds"
392	-@echo "  V=1           Verbose builds"
393	-@echo
394
395help-targets:
396	-@echo "All makefile targets and their dependencies:"
397	-@grep ^[a-z] ${makefile} | grep : | grep -v =
398	-@echo
399	-@echo
400
401help-test:
402	-@echo "Basic test usage:"
403	-@echo "   make -f ${makefile} test <options>"
404	-@echo
405	-@echo "Options:"
406	-@echo "  V=1               Verbose output (-v to scripts)"
407	-@echo "  NO_RM=1           Do not remove the executables after running"
408	-@echo "  REPLACE=1         Replace the output in PETSC_DIR source tree (-m to test scripts)"
409	-@echo "  OUTPUT=1          Show only the errors on stdout"
410	-@echo "  ALT=1             Replace 'alt' output in PETSC_DIR source tree (-M to test scripts)"
411	-@echo "  DIFF_NUMBERS=1    Diff the numbers in the output (-j to test scripts and petscdiff)"
412	-@echo "  CUDAMEMCHECK=1    Execute the tests using cuda-memcheck (-U to test scripts)"
413	-@echo "  VALGRIND=1        Execute the tests using valgrind (-V to test scripts)"
414	-@echo "  DEBUG=1           Launch tests in the debugger (-d to the scripts)"
415	-@echo "  NP=<num proc>     Set a number of processors to pass to scripts."
416	-@echo "  FORCE=1           Force SKIP or TODO tests to run"
417	-@echo "  PRINTONLY=1       Print the command, but do not run.  For loops print first command"
418	-@echo "  TIMEOUT=<time>    Test timeout limit in seconds (default in config/petsc_harness.sh)"
419	-@echo "  TESTDIR='tests'   Subdirectory where tests are run ($${PETSC_DIR}/$${PETSC_ARCH}/$${TESTDIR}"
420	-@echo "                    or $${PREFIX_DIR}/$${TESTDIR}"
421	-@echo "                    or $${PREFIX_DIR}/share/petsc/examples/$${TESTDIR})"
422	-@echo "  TESTBASE='tests'   Subdirectory where tests are run ($${PETSC_DIR}/$${PETSC_ARCH}/$${TESTDIR}"
423	-@echo "  OPTIONS='<args>'  Override options to scripts (-a to test scripts)"
424	-@echo "  EXTRA_OPTIONS='<args>'  Add options to scripts (-e to test scripts)"
425	-@echo
426	-@echo "Tests can be generated by searching with multiple methods"
427	-@echo "  For general searching (using config/query_test.py):"
428	-@echo "    make -f ${makefile} test search='sys*ex2*'"
429	-@echo "   or the shortcut using s"
430	-@echo "    make -f ${makefile} test s='sys*ex2*'"
431	-@echo "  You can also use the full path to a file directory"
432	-@echo "    make -f ${makefile} test s='src/sys/tests/'"
433	-@echo
434	-@echo "  To search for fields from the original test definitions:"
435	-@echo "    make -f ${makefile} test query='requires' queryval='*MPI_PROCESS_SHARED_MEMORY*'"
436	-@echo "   or the shortcut using q and qv"
437	-@echo "    make -f ${makefile} test q='requires' qv='*MPI_PROCESS_SHARED_MEMORY*'"
438	-@echo "  To filter results from other searches, use searchin"
439	-@echo "    make -f ${makefile} test s='src/sys/tests/' searchin='*options*'"
440	-@echo
441	-@echo "  To re-run the last tests which failed:"
442	-@echo "    make -f ${makefile} test test-fail='1'"
443	-@echo
444	-@echo "  To see which targets match a given pattern (useful for doing a specific target):"
445	-@echo "    make -f ${makefile} print-test search=sys*"
446	-@echo
447	-@echo "  To build an executable, give full path to location:"
448	-@echo '    make -f ${makefile} $${PETSC_ARCH}/tests/sys/tests/ex1'
449	-@echo "  or make the test with NO_RM=1"
450	-@echo
451