add make check target and basic tests

To conveniently run tests as

 $ make check
 ============================================================================
 Testsuite summary for gf-complete 1.0
 ============================================================================
 # TOTAL: 1
 # PASS:  1
 # SKIP:  0
 # XFAIL: 0
 # FAIL:  0
 # XPASS: 0
 # ERROR: 0
 ============================================================================

The run-tests.sh script loops over gf_methods and is introduced because
autotools does not allow tests to have parameters in the Makefile.am

Signed-off-by: Loic Dachary <loic@dachary.org>
master
Loic Dachary 2014-03-29 11:51:27 +01:00
parent 4c84a3b650
commit c18b97cd02
3 changed files with 15 additions and 0 deletions

4
README
View File

@ -24,3 +24,7 @@ To compile, do:
./configure
make
sudo make install
To run the tests, do:
make check

View File

@ -3,6 +3,8 @@
INCLUDES=-I./ -I../include
AM_CFLAGS = -O3 $(SIMD_FLAGS) -fPIC $(INCLUDES)
TESTS=run-tests.sh
bin_PROGRAMS = gf_mult gf_div gf_add gf_time gf_methods gf_poly gf_inline_time
gf_mult_SOURCES = gf_mult.c

9
tools/run-tests.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
for w in 4 8 16 32 64 128 ; do
./gf_methods $w -A -U | sh -e
if [ $? != "0" ] ; then
echo "Failed unit tests for w=$w"
break
fi
done