-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (50 loc) · 1.95 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Nmag micromagnetic simulator
# Copyright (C) 2011 University of Southampton
# Hans Fangohr, Thomas Fischbacher, Matteo Franchin and others
#
# WEB: http://nmag.soton.ac.uk
# CONTACT: [email protected]
#
# AUTHOR(S) OF THIS FILE: Matteo Franchin
# LICENSE: GNU General Public License 2.0
# (see <http://www.gnu.org/licenses/>)
sinclude ./config/tools.inc
.PHONY: all check checkall checkslow checkmpi checkhlib
TEST_DIRS=$(NSIM_INTERFACE_PATH) .
NSIM_PYTEST=$(NSIM) --nolog $(PYTEST_EXEC) -- $(TEST_DIRS) $(MORE_TEST_DIRS)
all: check
check_is_configured:
@if [ ! -f ./config/tools.inc ]; then \
SEPL="-----------------------------------------------------"; \
echo $$SEPL; \
echo "You need to configure the test suite before using it."; \
echo "Please, read the file README for further information."; \
echo $$SEPL; \
exit 1; \
fi
# NOTE: below we invoke pytest using "MAKE=$(MAKE) $(NSIM_PYTEST)"
# We do this because the tests may invoke 'make' themselves and they will
# do that by inspecting the environment variable MAKE. In particular,
# nsim.testtools uses the environment variable MAKE to decide how to invoke
# make.
check: check_is_configured
@echo "Testing all reasonably fast tests..."
@echo "Skipping tests with name test_slow* test_mpi* test_hlib*".
MAKE=$(MAKE) NSIM_TEST_PATH=$(NSIM_TEST_PATH) \
$(NSIM_PYTEST) -k "-test_slow -test_mpi -test_hlib"
checkslow: check_is_configured
@echo "Running only slow tests..."
MAKE=$(MAKE) NSIM_TEST_PATH=$(NSIM_TEST_PATH) \
$(NSIM_PYTEST) -k test_slow
checkmpi: check_is_configured
@echo "Running only MPI tests..."
MAKE=$(MAKE) NSIM_TEST_PATH=$(NSIM_TEST_PATH) \
$(NSIM_PYTEST) -k test_mpi
checkhlib: check_is_configured
@echo "Running only HLib tests..."
MAKE=$(MAKE) NSIM_TEST_PATH=$(NSIM_TEST_PATH) \
$(NSIM_PYTEST) -k test_hlib
checkall: check_is_configured
@echo "Running all available tests..."
MAKE=$(MAKE) NSIM_TEST_PATH=$(NSIM_TEST_PATH) \
$(NSIM_PYTEST)