From 162e04e6fcaeff78f3dadefffefbbc6aa9f70d89 Mon Sep 17 00:00:00 2001 From: tTh Date: Tue, 23 Aug 2022 12:24:22 +0200 Subject: [PATCH] making a fluffy testbed --- .gitignore | 1 + Tests/README.md | 6 ++++++ Tests/a.sh | 3 +-- Tests/config.sh | 8 ++++++++ Tests/functions.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ Tests/xper.sh | 17 +++++++++++++++++ 6 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 Tests/config.sh create mode 100644 Tests/functions.sh create mode 100755 Tests/xper.sh diff --git a/.gitignore b/.gitignore index 861a864..3adeee1 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ Lib/t_t16x24 Lib/testbmp Tests/*.tga +Tests/*.gif Tests/t_t16x24 Tools/genplot2 diff --git a/Tests/README.md b/Tests/README.md index 13e755e..632e243 100644 --- a/Tests/README.md +++ b/Tests/README.md @@ -2,6 +2,12 @@ Tester, c'est douter. +## État des lieux + +Pas grand chose. + +Allez quand même voir `config.sh` et `functions.sh` pour avoir une idée +du désastre actuel ## Mais encore ? diff --git a/Tests/a.sh b/Tests/a.sh index 01e93f2..3d5cff9 100755 --- a/Tests/a.sh +++ b/Tests/a.sh @@ -1,7 +1,6 @@ #!/bin/bash -SRC="/tmp/src.tga" -BW="/tmp/bw.tga" +source ./config.sh DST="foo.tga" diff --git a/Tests/config.sh b/Tests/config.sh new file mode 100644 index 0000000..a1309f4 --- /dev/null +++ b/Tests/config.sh @@ -0,0 +1,8 @@ + + +SRC="/tmp/src.tga" +BW="/tmp/bw.tga" +GIF89A="flashy.gif" + +# find the last version of tga_* +COMDIR="../Tools" diff --git a/Tests/functions.sh b/Tests/functions.sh new file mode 100644 index 0000000..94e26b6 --- /dev/null +++ b/Tests/functions.sh @@ -0,0 +1,43 @@ + + +# --------------------------------------------------------------- +test_des_xpers () +{ +command=$1 +echo ; echo " Test du xper $command" + +# generation d'une image sur laquelle travailler +$COMDIR/tga_mires mircol0 $SRC "hard xper '$command'" + + +case $command in + zero) + $COMDIR/tga_effects $SRC x0 $DST 64 128 192 + ;; + un) + $COMDIR/tga_effects $SRC x1 $DST 64 128 192 + ;; + deux) + $COMDIR/tga_effects $SRC x2 $DST 64 128 192 + ;; + trois) + $COMDIR/tga_effects $SRC x3 $DST 42 R1 "rg" + ;; + quatre) + $COMDIR/tga_effects $SRC x4 $DST 27 + ;; + cinq) + $COMDIR/tga_effects $SRC x5 $DST 64 128 192 + ;; + *) + echo "==== ERROR ON $command ====" + exit 1 ;; +esac + +gif89a=$(printf "flashy_%s.gif" $command) + +convert -delay 80 $SRC $DST $gif89a +} +# --------------------------------------------------------------- +# --------------------------------------------------------------- + diff --git a/Tests/xper.sh b/Tests/xper.sh new file mode 100755 index 0000000..91af79b --- /dev/null +++ b/Tests/xper.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +source ./config.sh +source ./functions.sh + +DST="foo.tga" + +$COMDIR/tga_tools version + + +test_des_xpers "zero" +test_des_xpers "un" +test_des_xpers "deux" +test_des_xpers "trois" +test_des_xpers "quatre" +test_des_xpers "cinq" +