see http://git.etalabs.net/cgi-bin/gitweb.cgi
build tests:
- cp Makefile.conf.def Makefile.conf
- # edit Makefile.conf
+ cp dist/config.mak .
+ # edit config.mak
make
run tests:
- ./t
+ make
run benchmarks:
- ./b
+ make b
framework:
prints a formatted message and sets the test to failed
see common/test.h
-in the root directory make builds an executable with all tests
-in a src/* directory make builds only local tests
-see Makefile.inc
-
a test function looks like
void test_foo() {
if (foo != 42)
}
extern functions with name ~ /^test/ are recognized to be
test functions
-see Makefile.inc
a benchmark function looks like
void bench_foo(int N) {
foo();
}
benchmark functions are repeatedly called with an increasing
-N until the runing time is long enough, then time/N is printed
+N until the running time is long enough, then time/N is printed
-edit the generated tests.h to exclude certain tests
-see common/t.c for tests
-see common/b.c for benchmarks
+see Makefile.inc for build system details
+see common/t.c for test details
+see common/b.c for benchmark details
--- /dev/null
+# copy to ../config.mak and edit
+
+# to test the native libc with native cc no config is required
+
+# to test non-native musl with gcc use
+#CC = musl-gcc
+
+# to test non-native musl with installed pcc use
+#prefix = /path/to/musl
+#includedir = $(prefix)/include
+#libdir = $(prefix)/lib
+#CC = pcc
+#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