Créer des profils du manteau neigeux - retour accueil
git clone git://bebou.netlib.re/gelinive
Log | Files | Refs | README |
commit ae030bdd247168d92763a1ef391502d326948ad9 parent 3bab6f19a41b23b8dc9ee8be50e7c9c3ac65fec0 Auterice: Arthur Pons <arthur.pons@unistra.fr> Date: Mon, 11 Mar 2024 10:33:19 +0100 On ajoute des tests² Diffstat:
A | makefile | | | 6 | ++++++ |
A | tests/resdata | | | 9 | +++++++++ |
A | tests/test | | | 20 | ++++++++++++++++++++ |
3 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/makefile b/makefile @@ -0,0 +1,6 @@ +test:;tests/test + +all: + +install: + diff --git a/tests/resdata b/tests/resdata @@ -0,0 +1,9 @@ +1 0 0 0 46 100 1 46 +1 1 0 0 0 54 / 46 +1 1 1 5 2 54 4 48 +1 1 2 5 2 52 7 50 +1 1 2 5 2 50 7 52 +1 1 5 5 3 48 10 55 +1 1 6 5 3 45 12 58 +1 1 1 5 40 42 2 98 +1 1 5 10 2 2 27 100 diff --git a/tests/test b/tests/test @@ -0,0 +1,20 @@ +#! /bin/sh + +tempdir=$(mktemp -d);trap "rm -rf $tempdir" EXIt +red="\033[91m" +green="\033[92m" +norm="\033[0m" + +echo "Launching test" + +for file in data +do +printf "Testing file $file through stdin : " +< $file ./gelinive > $tempdir/1 +cmp --silent tests/res$file $tempdir/1 && echo $green"pass"$norm || echo $red"fail"$norm + +printf "Testing file $file through positional argument : " +./gelinive $file > $tempdir/1 +cmp --silent tests/res$file $tempdir/1 && echo $green"pass"$norm || echo $red"fail"$norm +done +