diff --git a/Makefile b/Makefile index f7b2a3ca0..609bbfa56 100644 --- a/Makefile +++ b/Makefile @@ -153,11 +153,11 @@ update-spec: curl 'https://raw.githubusercontent.com/jgm/CommonMark/master/spec.txt'\ > $(SPEC) -test: $(SPEC) cmake_build +test: cmake_build ctest --test-dir $(BUILDDIR) --output-on-failure || (cat $(BUILDDIR)/Testing/Temporary/LastTest.log && exit 1) -$(ALLTESTS): $(SPEC) - python3 test/spec_tests.py --spec $< --dump-tests | python3 -c 'import json; import sys; tests = json.loads(sys.stdin.read()); print("\n".join([test["markdown"] for test in tests]))' > $@ +$(ALLTESTS): + python3 test/spec_tests.py --spec $(SPEC) --dump-tests | python3 -c 'import json; import sys; tests = json.loads(sys.stdin.read()); print("\n".join([test["markdown"] for test in tests]))' > $@ leakcheck: $(ALLTESTS) for format in html man xml latex commonmark; do \ diff --git a/Makefile.nmake b/Makefile.nmake index fdf400e30..47d166563 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -2,7 +2,6 @@ SRCDIR=src DATADIR=data BUILDDIR=build INSTALLDIR=windows -SPEC=test/spec.txt PROG=$(BUILDDIR)\src\cmark.exe GENERATOR=NMake Makefiles @@ -21,7 +20,7 @@ install: all clean: -rmdir /s /q $(BUILDDIR) $(MINGW_INSTALLDIR) 2> nul -test: $(SPEC) all +test: all ctest --test-dir $(BUILDDIR) --output-on-failure distclean: clean