### More serious testing
-_TODO: This section is obsolete._
+You can run the test suite under clang sanitizers or valgrind:
-The makefile may be modified to activate sanitising. Just run the
-previous tests under the various sanitisers. If you compile for
-coverage mapping, the `coverage.sh` mapping can generate a report.
-Just run one of those (make sure the makefile is set up accordingly):
+ $ make clean
+ $ make test CC="clang -std=c99" CFLAGS="-fsanitize=address"
- $ ./coverage.sh test.out
+ $ make clean
+ $ make test CC="clang -std=c99" CFLAGS="-fsanitize=memory"
-You can also run the tests under Valgrind:
+ $ make clean
+ $ make test CC="clang -std=c99" CFLAGS="-fsanitize=undefined"
+ $ make clean
+ $ make test.out
$ valgrind ./test.out
+You can also check code coverage:
+
+ $ make clean
+ $ make test CC="clang -std=c99" CFLAGS="-fprofile-instr-generate"
+ $ tests/coverage.sh
+
+
### Serious auditing
The code may be analysed more formally with [Frama-c][] and the
-# compile with any of the following
CC=gcc -std=gnu99 # speed tests don't work with -std=cxx, they need the POSIX extensions
-#CC=gcc -std=c99
-#CC=gcc -std=c11
-#CC=g++ -std=c++98
-#CC=g++ -std=c++11
-#CC=g++ -std=c++14
-#CC=g++ -std=c++17
-#CC=clang -std=c99
-#CC=clang -std=c11
-#CC=clang++ -std=c++98
-#CC=clang++ -std=c++11
-#CC=clang++ -std=c++14
-
-# These may be used for tests (except speed)
-#CC = clang -std=c99 -fsanitize=address
-#CC = clang -std=c99 -fsanitize=memory
-#CC = clang -std=c99 -fsanitize=undefined
-#CC = clang -std=c99 -fprofile-instr-generate -fcoverage-mapping
-
CFLAGS= -pedantic -Wall -Wextra -O3 -march=native
DESTDIR=
PREFIX=usr/local
#! /bin/sh
-echo
-echo "Run & record coverage"
-echo "====================="
-"./$1"
-echo
-echo "Generate report"
-echo "==============="
llvm-profdata-3.8 merge default.profraw -o all.profdata
-
-
-echo
-echo "Show report"
-echo "==========="
-llvm-cov show "./$1" -instr-profile=all.profdata
+llvm-cov show "./test.out" -instr-profile=all.profdata