Commit 8ba39a60 authored by Kirill Smelkov's avatar Kirill Smelkov

Prepare to test python code with py.test

We'll use py.test for unit-testing of Python part.
parent 9a293c2d
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
all : all :
PYTHON ?= python PYTHON ?= python
PYTEST ?= $(PYTHON) -m pytest
VALGRIND?= valgrind VALGRIND?= valgrind
# use the same C compiler as python # use the same C compiler as python
...@@ -60,7 +61,7 @@ CFLAGS := -g -Wall -D_GNU_SOURCE -std=gnu99 -fplan9-extensions ...@@ -60,7 +61,7 @@ CFLAGS := -g -Wall -D_GNU_SOURCE -std=gnu99 -fplan9-extensions
# XXX hack ugly # XXX hack ugly
LOADLIBES=lib/bug.c lib/utils.c 3rdparty/ccan/ccan/tap/tap.c LOADLIBES=lib/bug.c lib/utils.c 3rdparty/ccan/ccan/tap/tap.c
TESTS := $(patsubst %.c,%,$(wildcard bigfile/tests/test_*.c)) TESTS := $(patsubst %.c,%,$(wildcard bigfile/tests/test_*.c))
test : test.t test.fault test.asan test.tsan test.vgmem test.vghel test.vgdrd test : test.t test.py test.fault test.asan test.tsan test.vgmem test.vghel test.vgdrd
# TODO move XFAIL markers into *.c # TODO move XFAIL markers into *.c
...@@ -159,6 +160,12 @@ test.vgdrd: $(TESTS:%=%.vgdrdrun) ...@@ -159,6 +160,12 @@ test.vgdrd: $(TESTS:%=%.vgdrdrun)
$(call vgxrun,--tool=drd, $<) $(call vgxrun,--tool=drd, $<)
# run python tests
PYTEST_IGNORE := --ignore=3rdparty --ignore=build --ignore=t
test.py : bigfile/_bigfile.so
$(PYTEST) $(PYTEST_IGNORE)
# test pagefault for double/real faults - it should crash # test pagefault for double/real faults - it should crash
tfault := bigfile/tests/tfault tfault := bigfile/tests/tfault
# XXX FAULTS extraction fragile # XXX FAULTS extraction fragile
......
...@@ -185,6 +185,10 @@ setup( ...@@ -185,6 +185,10 @@ setup(
'numpy', # lib/mem 'numpy', # lib/mem
], ],
extras_require = {
'test': ['pytest'],
},
cmdclass = {'build_ext': build_ext, cmdclass = {'build_ext': build_ext,
'll_build_ext': _build_ext, # original build_ext for Makefile 'll_build_ext': _build_ext, # original build_ext for Makefile
'build_py': build_py, 'build_py': build_py,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment