diff --git a/.travis.yml b/.travis.yml index 2fbb685..40e844a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,5 +8,13 @@ compiler: # temporary hack with sed until we will have a proper configure script script: + - set -e - sed -i 's|TOPDIR=/path/to/the/directory/containing/this/makefile|TOPDIR=/home/travis/build/lbfm-rwth/carat|g' Makefile + - sed -i 's|CFLAGS = -g -Wall -DDIAG1|CFLAGS = --coverage -g -Wall -DDIAG1|g' Makefile - make + - cd bin; ln -s `ls -d */` carat + - cd ../tst; ./run_all.sh + +after_script: + - gcov functions/*/*.c + - bash <(curl -s https://codecov.io/bash) diff --git a/tst/Bravais.out b/tst/Bravais.out new file mode 100644 index 0000000..807d3c7 --- /dev/null +++ b/tst/Bravais.out @@ -0,0 +1,19 @@ +#1 +3d0 % invariant matrix +1 +#g3 f1 % bravais group to grp1.dat +3 % generator + 0 0 1 + -1 0 0 + 0 1 0 +3 % generator + 1 0 0 + 0 0 1 + 0 1 0 +3 % generator + 1 0 0 + 0 -1 0 + 0 0 1 +3d0 % invariant form +1 +2^4 * 3^1 = 48 % order of the group diff --git a/tst/Bravais.tst b/tst/Bravais.tst new file mode 100644 index 0000000..a2150b4 --- /dev/null +++ b/tst/Bravais.tst @@ -0,0 +1,11 @@ +# This is a CARAT test file. It must have extension `.tst`. +# Comments and blank lines are ignored. For a test file named +# `testfile.tst`, the correct output of `bash testfile.tst` +# must be placed in the file `testfile.out`. + +# Testing Form_space +../bin/carat/Form_space grp1.dat + +# Testing Bravais_grp +../bin/carat/Bravais_grp grp1.dat + diff --git a/tst/Order.out b/tst/Order.out new file mode 100644 index 0000000..5e5a0a5 --- /dev/null +++ b/tst/Order.out @@ -0,0 +1 @@ +The order of the group is 24 diff --git a/tst/Order.tst b/tst/Order.tst new file mode 100644 index 0000000..64c62cb --- /dev/null +++ b/tst/Order.tst @@ -0,0 +1 @@ +../bin/carat/Order grp1.dat diff --git a/tst/Presentation.out b/tst/Presentation.out new file mode 100644 index 0000000..8566f59 --- /dev/null +++ b/tst/Presentation.out @@ -0,0 +1,24 @@ +23x9 % presentation for group in grp1.dat + 1 1 0 0 0 0 0 0 0 + 4 4 0 0 0 0 0 0 0 + 2 2 0 0 0 0 0 0 0 + 2 -1 2 -1 0 0 0 0 0 + 2 3 -1 -3 0 0 0 0 0 + 4 -3 4 -3 0 0 0 0 0 + 1 4 -1 -4 0 0 0 0 0 + 2 -1 -2 1 0 0 0 0 0 + -4 3 4 3 0 0 0 0 0 + 1 3 -2 1 -3 0 0 0 0 + 2 4 -2 1 -4 0 0 0 0 + 3 4 -3 -3 4 0 0 0 0 + 1 3 1 -2 -3 0 0 0 0 + 2 4 1 -2 -4 0 0 0 0 + 3 -4 -3 -3 4 0 0 0 0 + 2 -4 2 4 -1 0 0 0 0 + 2 -4 3 2 -3 4 0 0 0 + 3 4 2 -3 -3 4 -1 0 0 + 3 3 2 -3 -3 4 -1 -4 0 + 4 3 2 -3 -3 4 -1 -3 0 + 2 3 4 -2 1 -3 -3 4 -1 + 1 3 4 -1 -2 1 -3 -3 4 + -2 1 -1 2 0 0 0 0 0 diff --git a/tst/Presentation.tst b/tst/Presentation.tst new file mode 100644 index 0000000..5812765 --- /dev/null +++ b/tst/Presentation.tst @@ -0,0 +1 @@ +../bin/carat/Presentation grp1.dat diff --git a/tst/grp1.dat b/tst/grp1.dat new file mode 100644 index 0000000..b051374 --- /dev/null +++ b/tst/grp1.dat @@ -0,0 +1,17 @@ +#4 +3 +-1 0 0 +0 -1 0 +0 0 1 +3 +-1 0 0 +0 1 0 +0 0 -1 +3 +0 1 0 +0 0 1 +1 0 0 +3 +0 1 0 +1 0 0 +0 0 1 diff --git a/tst/run_all.sh b/tst/run_all.sh new file mode 100755 index 0000000..f2f5fd7 --- /dev/null +++ b/tst/run_all.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# Inspired by `tst/testspecial/run_all.sh` from GAP +# (see https://github.com/gap-system/gap/) +# +# CARAT test files must have extension `.tst`. +# Comments and blank lines are ignored. For a test file named +# `testfile.tst`, the correct output of `bash testfile.tst` +# must be placed in the file `testfile.out`. +# +# This script iterates over all `*.tst` files, running each test +# and comparing its observed and expected output. +# +set -e +retvalue=0 +for testfile in *.tst; do + echo "### Testing ${testfile}" + name="$(basename -s .tst ${testfile})" + bash -e "./${name}.tst" > "${name}.tmp" 2>&1 + if ! diff -b "${name}.out" "${name}.tmp"; then + echo "${testfile} failed, see observed/expected output above" + retvalue=1 + else + rm -f "${name}.tmp" + fi +done +exit ${retvalue} +