setup testing with 'make check'

This commit is contained in:
Erik Edrosa 2015-12-22 19:07:08 -05:00
parent d214418a7b
commit 58820aa4cc
5 changed files with 34 additions and 5 deletions

4
.gitignore vendored
View File

@ -1,11 +1,13 @@
*~
*.go
*.log
*.trs
aclocal.m4
autom4te.cache/
build-aux/
Makefile
Makefile.in
config.log
config.status
configure
pre-inst-env
test-env

View File

@ -4,10 +4,18 @@ moddir=$(prefix)/share/guile/site/2.0
godir=$(prefix)/share/guile/site/2.0
SOURCES = \
commonmark/node.scm \
commonmark/blocks.scm \
commonmark/inlines.scm \
commonmark/sxml.scm \
commonmark/node.scm \
commonmark/blocks.scm \
commonmark/inlines.scm \
commonmark/sxml.scm \
commonmark.scm
TESTS = \
tests/node.scm
TEST_EXTENSIONS = .scm
SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
EXTRA_DIST += pre-inst-env.in

View File

@ -10,5 +10,6 @@ GUILE_PROGS
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
AC_CONFIG_FILES([test-env], [chmod +x test-env])
AC_OUTPUT

5
test-env.in Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
"@abs_top_builddir@/pre-inst-env" "$@"
exit $?

13
tests/node.scm Normal file
View File

@ -0,0 +1,13 @@
(define-module (test-node)
#:use-module (srfi srfi-64)
#:use-module (commonmark node))
(test-begin "node")
(test-assert "no-children, true when no children"
(no-children? (make-document-node)))
(test-end)
(exit (= (test-runner-fail-count (test-runner-current)) 0))