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