11PROJECT_DIR = $(abspath .)
22EXTENSIONS_DIR = ${PROJECT_DIR}/fidimag/extensions
3- PYTHON = python
3+ PYTHON = python3
4+ PYTEST = py.test-3
45
56# ####################
67# Cython Extensions #
78# ####################
89
9-
1010build :
1111 ${PYTHON} setup.py build_ext --inplace
1212
1313clean :
1414 rm -rf ${EXTENSIONS_DIR} /*
1515 touch ${EXTENSIONS_DIR} /__init__.py
1616
17+ docker :
18+ docker build -t fidimag -f ./docker/travis/Dockerfile .
19+ docker run -ti -d --name fidimag fidimag
20+
1721# ########
1822# Tests #
1923# ########
2024
25+ test-docker : docker
26+ docker exec fidimag make test-basic
27+ # docker exec fidimag make test-without-run-oommf
28+ # docker exec fidimag make test-ipynb
29+
30+ travis : test-docker
31+ docker exec fidimag make codecov
32+
33+ codecov :
34+ bash <( curl -s https://codecov.io/bash)
35+ codecov : SHELL:= /bin/bash
36+ # or the recipe fails with /bin/sh complaining
37+ # `/bin/sh: 1: Syntax error: "(" unexpected`.
38+
2139# Quick tests, also not using OOMMF tests
2240test :
23- cd tests && py.test -v -m " not slow and not run_oommf"
41+ cd tests && ${PYTEST} -v -m " not slow and not run_oommf"
2442
2543test-clean :
2644 rm -rf neb* .ndt
@@ -51,16 +69,16 @@ test-clean:
5169test2 :
5270 # like test, but run also outside the 'tests' directory.
5371 # Doesn't work on Hans laptop.
54- py.test -v -m " not slow and not run_oommf"
72+ ${PYTEST} -v -m " not slow and not run_oommf"
5573
5674test-all : create-dirs
57- py.test -v --junitxml=$(PROJECT_DIR ) /test-reports/junit/test-pytest.xml
75+ ${PYTEST} -v --junitxml=$(PROJECT_DIR ) /test-reports/junit/test-pytest.xml
5876
5977test-without-run-oommf : create-dirs
60- py.test -v -m " not run_oommf" --cov=fidimag --cov-report=html --junitxml=$(PROJECT_DIR ) /test-reports/junit/test-pytest.xml
78+ ${PYTEST} -v -m " not run_oommf" --cov=fidimag --cov-report=html --junitxml=$(PROJECT_DIR ) /test-reports/junit/test-pytest.xml
6179
6280test-basic :
63- cd tests && py.test -v
81+ cd tests && ${PYTEST} -v
6482
6583# Convenience name for commonly used quick running of tests
6684tq :
@@ -71,10 +89,10 @@ test-quick:
7189
7290
7391test-ipynb : create-dirs
74- cd doc/ipynb && py.test . -v --current-env --nbval --sanitize-with sanitize_file --junitxml=$(PROJECT_DIR ) /test-reports/junit/test-ipynb-pytest.xml
92+ cd doc/ipynb && ${PYTEST} . -v --current-env --nbval --sanitize-with sanitize_file --junitxml=$(PROJECT_DIR ) /test-reports/junit/test-ipynb-pytest.xml
7593
7694test-oommf :
77- py.test -v -m " oommf"
95+ ${PYTEST} -v -m " oommf"
7896
7997create-dirs :
8098 mkdir -p test-reports/junit
@@ -93,4 +111,4 @@ doc-%:
93111 @echo $*
94112 make -C doc $*
95113
96- .PHONY : extensions-directory build clean create-dirs test test-basic test-ipynb doc doc-clean doc-html doc-latexpdf doc-singlehtml
114+ .PHONY : extensions-directory build clean create-dirs test test-basic test-ipynb doc doc-clean doc-html doc-latexpdf doc-singlehtml docker test-docker travis codecov
0 commit comments