README for the test cases
~~~~~~~~~~~~~~~~~~~~~~~~~

*** Running the tests

The tests can be compiled with a plain 'make'.

'make test' runs all the test programs through the driver 'RunTests'. Tests
whose names end in '-TEST' (in uppercase) are expected to fail (nonzero exit
code), all others are expected to succeed (zero exit code). They can of
course also be added to LTP or another test suite.

'make clean' can be used to remove the binaries.

*** Test descriptions

(this is described in the comment at the start of each C program)

*** Adding new tests

The "testmacros.h" include file offers some macros that can be used to keep
the C programs short and simple, by automatically checking return codes of
functions called, and aborting the program with an appropriate error message
(including C source file and line number) if they fail.

SYSCALL() can be used to wrap a system call that returns -1 (or any other
negative number) on failure. Example:

	SYSCALL( mkdir("/", 0777) );
will cause the program to quit with the message:
	Error:selftest-syscall-FAIL.c:9: mkdir("/", 0777): File exists

DIE_IF() is used to abort the program if the condition is true, DIE_UNLESS()
can be used to catch unexpected false results. Examples:

	DIE_UNLESS( tmpf = tmpfile() );
should succeed

	DIE_UNLESS( isdigit('A') );
will cause the program to quit with the message:
	Error:selftest-die-unless-FAIL.c:8: isdigit('A')


