Commit c18b97cd0295849189d877b042701b2ef51d21f8

Authored by Loic Dachary
1 parent 4c84a3b6
Exists in master and in 2 other branches v2, v3

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>
Showing 3 changed files with 15 additions and 0 deletions   Show diff stats
README
... ... @@ -24,3 +24,7 @@ To compile, do:
24 24 ./configure
25 25 make
26 26 sudo make install
  27 +
  28 +To run the tests, do:
  29 +
  30 + make check
... ...
tools/Makefile.am
... ... @@ -3,6 +3,8 @@
3 3 INCLUDES=-I./ -I../include
4 4 AM_CFLAGS = -O3 $(SIMD_FLAGS) -fPIC $(INCLUDES)
5 5  
  6 +TESTS=run-tests.sh
  7 +
6 8 bin_PROGRAMS = gf_mult gf_div gf_add gf_time gf_methods gf_poly gf_inline_time
7 9  
8 10 gf_mult_SOURCES = gf_mult.c
... ...
tools/run-tests.sh 0 → 100755
... ... @@ -0,0 +1,9 @@
  1 +#!/bin/bash
  2 +
  3 +for w in 4 8 16 32 64 128 ; do
  4 + ./gf_methods $w -A -U | sh -e
  5 + if [ $? != "0" ] ; then
  6 + echo "Failed unit tests for w=$w"
  7 + break
  8 + fi
  9 +done
... ...