Russ Allbery > Software > C TAP Harness | bmalloc and friends > |
(Report fatal test case errors to a TAP harness)
#include <tap/basic.h>
void bail(const char *format, ...);
void sysbail(const char *format, ...);
bail() reports a fatal error to a TAP test harness. format must be a printf-style format string with possible optional arguments stating the fatal error encountered. This function prints a string like:
Bail out! <reason>
to standard output after flushing it and then exits with an exit status of 255.
sysbail() is identical to bail() except that it appends a colon, a space, and the results of strerror() on the current value of errno to the end of the error message.
None. bail() and sysbail() exit with an exit status of 255 after printing the error message.
Unlike most TAP library functions, format in this case may not be NULL. An error message must be provided.
Russ Allbery <eagle@eyrie.org>
Copyright 2010, 2013 Russ Allbery <eagle@eyrie.org>
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.
SPDX-License-Identifier: FSFAP
diag(3), plan(3), strerror(3)
The current version of the C TAP Harness library is available from its web page at <https://www.eyrie.org/~eagle/software/c-tap-harness/>.
Russ Allbery > Software > C TAP Harness | bmalloc and friends > |