Bugfix: Wrap test program to ensure the exit code is always 0/pass or 1/fail

This commit is contained in:
Luke Dashjr
2016-12-01 00:56:10 +00:00
parent fdb2a280b0
commit 7605755747
2 changed files with 5 additions and 2 deletions

View File

@@ -45,7 +45,7 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = \
libblkmaker_jansson-$(LIBBLKMAKER_API_VERSION).pc
dist_noinst_SCRIPTS = autogen.sh
dist_noinst_SCRIPTS = autogen.sh test.sh
dist_noinst_DATA = \
AUTHORS COPYING README \
example.c \
@@ -56,7 +56,7 @@ check_PROGRAMS = test
test_SOURCES = test.c
test_CFLAGS = $(libbase58_CFLAGS) $(JANSSON_CFLAGS) $(LIBGCRYPT_CFLAGS)
test_LDADD = $(libbase58_LIBS) libblkmaker-@LIBBLKMAKER_API_VERSION@.la libblkmaker_jansson-@LIBBLKMAKER_API_VERSION@.la $(JANSSON_LIBS) $(LIBGCRYPT_LIBS)
TESTS = test
TESTS = test.sh
EXTRA_PROGRAMS = example
example_SOURCES = example.c

3
test.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
# To avoid exit codes other than 0 or 1
./test || exit 1