From 1592511fdbf2ff0608492ba486ccbdf20fbf9d43 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 14 Jan 2022 22:53:40 +0100 Subject: [PATCH] Local tests: Add option to avoid treating skipped tests as success. `make -f Makefile.localtest tests CRYPTSETUP_PATH=/sbin TESTSUITE_NOSKIP=y` exits with status 77 upon the first skipped test. This can be useful when a full test coverage is desired. As before the test suite exits (with status 1) as soon as a failed (or skipped when the TESTSUITE_NOSKIP environment variable is defined to non-empty string) test is encountered. --- tests/Makefile.localtest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.localtest b/tests/Makefile.localtest index ec132ed3..fae3e28d 100644 --- a/tests/Makefile.localtest +++ b/tests/Makefile.localtest @@ -1,6 +1,7 @@ # # Makefile to run tests with system binaries # USE: make -f Makefile.localtest tests CRYPTSETUP_PATH=/sbin +# (append TESTSUITE_NOSKIP=y to avoid treating skipped tests as success) # CPPFLAGS=-I../lib/ -I../lib/luks1 -DHAVE_DECL_DM_TASK_RETRY_REMOVE -DKERNEL_KEYRING -DHAVE_SYS_SYSMACROS_H -DNO_CRYPTSETUP_PATH CFLAGS=-O2 -g -Wall @@ -29,7 +30,7 @@ tests: differ $(TESTS) @for test in $(sort $(TESTS)); do \ echo [$$test]; \ ./$$test; \ - [ $$? -ne 77 -a $$? -ne 0 ] && exit 1; \ + [ $(if $(TESTSUITE_NOSKIP),,$$? -ne 77 -a) $$? -ne 0 ] && exit 1; \ true; \ done;