X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=README;h=02c8d2fcae789b70dc6365016f92cc194f488681;hb=db4b6cef06a63b1a43c654c3b98fe4e47fc7d411;hp=856e2a8756cd08a50a526f4cd5c8099ab4e05922;hpb=d14d36762cc2131357345f960f7bdf86af140af8;p=libc-test diff --git a/README b/README index 856e2a8..02c8d2f 100644 --- a/README +++ b/README @@ -1,38 +1,22 @@ -simple libc tests based on the libc-testsuit -and libc-bench of dalias -see http://git.etalabs.net/cgi-bin/gitweb.cgi +simple libc tests +based on the libc-testsuit of dalias +see http://git.musl-libc.org/cgit build tests: - cp Makefile.conf.def Makefile.conf - # edit Makefile.conf + cp dist/config.mak . + # edit config.mak make run tests: - ./t -run benchmarks: - ./b + make run -about the framework: +framework: -the only hook in the test framework is error(...) which -prints a formatted message and sets the test to failed -see common/test.h +the convention is that each test is in a separate file +at a path like src/directory/file.c with its own main -benchmark functions are repeatedly called with increasing -N until runing time is long enough, then time/N is printed +the test should return 0 on success and non-0 on failure -in the root dir make builds an executable with all tests -in a src/* dir make builds only local tests -see Makefile.inc +to simplify things there is a Makefile.inc that can +be included from src/directory/Makefile when the +above convention is used in src/directory -a test function looks like - void test_foo() { - if (foo != 42) - error("foo=%d expected 42\n", foo); - } -extern functions with name ~ /^test/ are recognized to be -test functions -see Makefile.inc - -edit the generated main.h to exclude certain tests -see common/t.c for tests -see common/b.c for benchmarks