These add NOCHILDREN_TESTS for some tests.
check-local:
for bin in $(test_programs); do \
- if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \
+ if ! $(RUN_TEST) NOCHILDREN_TESTS="$(NOCHILDREN_TESTS)" ./$$bin; then exit 1; fi; \
done
set -eu
+function get_test_name() {
+ basename "$1"
+}
+
top_srcdir="@abs_top_srcdir@"
VALGRIND="@VALGRIND@"
+if [ $# -gt 0 ] && echo "$1" | grep "NOCHILDREN_TESTS=" >/dev/null; then
+ shift
+ test_name=$(get_test_name "$@")
+ if echo "$1" | grep "NOCHILDREN_TESTS=.*\b$test_name\b" >/dev/null; then
+ NOCHILDREN=yes
+ fi
+fi
+
if test $# -eq 0 || test "$1" = ""; then
echo "Missing target binary" >&2
exit 1
+NOCHILDREN_TESTS = test-program-client-local
+include $(top_srcdir)/Makefile.test.include
+
noinst_LTLIBRARIES = libprogram_client.la
AM_CPPFLAGS = \
test-program-client-unix \
test-program-client-net
-noinst_PROGRAMS = $(test_programs)
-
test_libs = \
libprogram_client.la \
../lib-dns-client/libdns-client.la \
test_program_client_net_SOURCE = test-program-client-net.c
test_program_client_net_LDADD = $(test_libs)
-
-check-local:
- for bin in $(test_programs); do \
- if test "$$bin" = "test-program-client-local"; then \
- if ! env NOCHILDREN=yes $(RUN_TEST) ./$$bin; then exit 1; fi; \
- else \
- if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \
- fi \
- done
+NOCHILDREN_TESTS = test-smtp-submit
+include $(top_srcdir)/Makefile.test.include
+
noinst_LTLIBRARIES = libsmtp.la
AM_CPPFLAGS = \
fuzz-smtp-server
endif
-noinst_PROGRAMS = $(fuzz_programs) $(test_programs) $(test_nocheck_programs)
+noinst_PROGRAMS += $(fuzz_programs) $(test_nocheck_programs)
EXTRA_DIST = \
test-bin/sendmail-exit-1.sh \
fuzz_smtp_server_SOURCES = fuzz-smtp-server.c
fuzz_smtp_server_LDADD = $(test_libs)
fuzz_smtp_server_DEPENDENCIES = $(test_deps)
-
-check-local:
- for bin in $(test_programs); do \
- if test "$$bin" = "test-smtp-submit"; then \
- if ! env NOCHILDREN=yes $(RUN_TEST) ./$$bin; then exit 1; fi; \
- else \
- if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \
- fi \
- done