tests for conformance with ISO/IEC 9899 http://src.kaivo.net/dev/libc-tests/

Jakob Kaivo 17679f3314 move type test objects to file scope, remove need for (void)foo to avoid warnings on unused variables 3 years ago
.gitignore 6bf3a50d44 ignore build artifacts 5 years ago
LICENSE 2fef91dfdf update year and add email address 5 years ago
Makefile aa0508dbbf move all configuration to config.mk 3 years ago
README.md ebf84c5d3a add README 3 years ago
_float.d b2efbbcdbb use better #ifdef tests 4 years ago
_float.h cd9cd3483d simpler and more correct tests for sybmolic macro existance 4 years ago
_math.d b2efbbcdbb use better #ifdef tests 4 years ago
_math.h b2efbbcdbb use better #ifdef tests 4 years ago
_stdalign.d b2efbbcdbb use better #ifdef tests 4 years ago
_stdalign.h b2efbbcdbb use better #ifdef tests 4 years ago
_stdio.d c9d408f4a8 add missing files 4 years ago
_stdio.h c9d408f4a8 add missing files 4 years ago
_stdnoreturn.d b2efbbcdbb use better #ifdef tests 4 years ago
_stdnoreturn.h b2efbbcdbb use better #ifdef tests 4 years ago
_wchar.d c9d408f4a8 add missing files 4 years ago
_wchar.h c9d408f4a8 add missing files 4 years ago
_wctype.d c9d408f4a8 add missing files 4 years ago
_wctype.h c9d408f4a8 add missing files 4 years ago
assert.c 5e37315f0e add an end in case we get that far 5 years ago
complex.c efec5e7304 correct version check directive 3 years ago
config.mk 6a2d72af1a make testing different versions easier 3 years ago
ctype.c e22b9d2683 refactor test names with _h to avoid collisions 5 years ago
errno.c 3819846f8a add testing errno as an lvalue and rvalue 5 years ago
fenv.c 306613c5a1 skeleton tests for all C99 headers 5 years ago
float.c cd9cd3483d simpler and more correct tests for sybmolic macro existance 4 years ago
inttypes.c 306613c5a1 skeleton tests for all C99 headers 5 years ago
iso646.c 8396c02590 basic tests for <limits.h>, <float.h>, and <iso646.h> 5 years ago
limits.c 8396c02590 basic tests for <limits.h>, <float.h>, and <iso646.h> 5 years ago
locale.c 47fbd9c2bd move test variables into function body 5 years ago
main.c 7734d94d17 remove warnings 3 years ago
math.c 21de485738 only declare variables for testing C99 features when testing C99 features 3 years ago
setjmp.c 9cc79623cc <setjmp.h> tests (still disabled until I begin writing the actual code since longjmp() is a _Noreturn function) 5 years ago
signal.c 17679f3314 move type test objects to file scope, remove need for (void)foo to avoid warnings on unused variables 3 years ago
stdalign.c 1a834f6bd8 replace all instances of test_defined() with #ifdef tests 4 years ago
stdarg.c b3a808e501 remove unused variable 3 years ago
stdatomic.c 6d9ef3245d skeletons for C11/C18 functions 5 years ago
stdbool.c 47fbd9c2bd move test variables into function body 5 years ago
stddef.c 17679f3314 move type test objects to file scope, remove need for (void)foo to avoid warnings on unused variables 3 years ago
stdint.c c5d8e6b226 fill in missing values 4 years ago
stdio.c 17679f3314 move type test objects to file scope, remove need for (void)foo to avoid warnings on unused variables 3 years ago
stdlib.c 17679f3314 move type test objects to file scope, remove need for (void)foo to avoid warnings on unused variables 3 years ago
stdnoreturn.c b2efbbcdbb use better #ifdef tests 4 years ago
string.c 17679f3314 move type test objects to file scope, remove need for (void)foo to avoid warnings on unused variables 3 years ago
test.c c997061111 use correct format specifier 5 years ago
test.h 1a834f6bd8 replace all instances of test_defined() with #ifdef tests 4 years ago
tgmath.c 306613c5a1 skeleton tests for all C99 headers 5 years ago
threads.c 6d9ef3245d skeletons for C11/C18 functions 5 years ago
time.c 7551fd06be correct some of the expected outputs 5 years ago
uchar.c 6d9ef3245d skeletons for C11/C18 functions 5 years ago
wchar.c 17679f3314 move type test objects to file scope, remove need for (void)foo to avoid warnings on unused variables 3 years ago
wctype.c 17679f3314 move type test objects to file scope, remove need for (void)foo to avoid warnings on unused variables 3 years ago

README.md

This is a small set of unit tests for an ISO/IEC 9899 conformant C library.

To build, edit config.mk with the appropriate compiler and flags to link the library you are testing. The run make to get the executable testlibc. Note that the source files depend on your compiler predefinining STDC_VERSION appropriately to determine which tests to include. The default config.mk is configured for testing the UNGOL C library, which is probably not what you want.

By default, running testlibc will run tests for all headers found during compilation, with the exception of (as that test includes an abnormal termination).

To run tests for a specified set of headers, append their base names (without the .h) to the command line. For example, to run only the tests for and , run:

testlibc stdio stdlib

Each test will print either a + (for success) or - (for failure) after it completes. To get verbose output, where each test is displayed as well as the results, use the -v option (it must come before any header names):

testlibc -v
testlibc -v assert