I have a C++ program that generates what I believe is minimal TAP output, like this:
TAP version 13
1..3
ok 1
not ok 2
ok 3
This program is called test_runner and returns 0.
The Makefile.am in the directory is the following:
TESTS = test_runner
check_PROGRAMS = test_runner
test_runner_SOURCES = main.cpp
Now, when I execute make check, the summary output is the following:
# TOTAL: 1
# PASS: 1
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
My question is: is make check supposed to inspect the TAP output of my program (as I would expect to get 2 successes and 1 failure) and if so, what am I doing wrong?
automake version is 1.13.3, autoconf version is 2.69.
You should have this in your configure.ac:
AC_REQUIRE_AUX_FILE([tap-driver.sh])
...
AC_PROG_AWK
And this in your Makefile.am:
check_PROGRAMS = test_runner
test_runner_SOURCES = main.cpp
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/tap-driver.sh
TESTS = test_runner
The LOG_DRIVER variable is what makes it invoke the tap-driver.sh script, otherwise the default generic test driver is used. You can optionally define specific drivers for each file extension (say, one for .py, another for .sh, etc), but in this case, a single global LOG_DRIVER is enough.
As user ecerulm pointed out, tap-driver.pl is being deprecated, so I changed the answer to consider only tap-driver.sh.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With