diff --git a/README b/README index ce2ba8e..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 +based on the libc-testsuit of dalias +see http://git.musl-libc.org/cgit build tests: cp dist/config.mak . # edit config.mak make run tests: - make t -run benchmarks: - make b + make run 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 -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 +the test should return 0 on success and non-0 on failure -a benchmark function looks like - void bench_foo(int N) { - for (i = 0; i < N; i++) - foo(); - } -benchmark functions are repeatedly called with an increasing -N until the running time is long enough, then time/N is printed +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 -see Makefile.inc for build system details -see common/t.c for test details -see common/b.c for benchmark details diff --git a/dist/config.mak b/dist/config.mak index 8d10693..6face8d 100644 --- a/dist/config.mak +++ b/dist/config.mak @@ -1,4 +1,4 @@ -# copy to ../config.mak and edit +# copy to ../config.mak # to test the native libc with native cc no config is required @@ -13,6 +13,3 @@ #LIBCC = $(shell pcc -v /dev/null 2>&1 |sed -n 's,/crtbegin.o.*,,;s,.* /,/,p') #CFLAGS += -nostdinc -ffreestanding -fno-stack-protector -isystem $(includedir) #LDFLAGS += -nostdlib -Wl,-e,_start,-Bstatic $(libdir)/crti.o $(libdir)/crt1.o $(libdir)/crtn.o -L$(libdir) -lc -L$(LIBCC) -l$(CC) - -# required for math tests -CFLAGS += -fno-builtin -ffloat-store