scripts-reco

Des scripts pour faciliter le reconditionnement de portables - retour accueil

git clone git://bebou.netlib.re/scripts-reco

Log | Files | Refs | README |

commit 118cae42e8b1618aa53c9f4756426eb109be9b2d
parent e8d6acfeca210ea7295636fed1edaf0e0d5821a2
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Tue, 18 Mar 2025 17:08:55 +0100

Ajout d'un test du pad

A factoriser et pousser les améliorations dans le test clavier

Diffstat:
Aclavier/pad | 4++++
Mgenerique.sh | 1+
Atests/pad | 32++++++++++++++++++++++++++++++++
3 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/clavier/pad b/clavier/pad @@ -0,0 +1,4 @@ +1 +2 +3 +MotionNotify diff --git a/generique.sh b/generique.sh @@ -1,5 +1,6 @@ #! /usr/bin/env ./bin/common.sh +lancer_test pad lancer_test rapport lancer_test luminosite lancer_test ecran diff --git a/tests/pad b/tests/pad @@ -0,0 +1,32 @@ +# pad + +update_layout() { + if [ "$i" = "0" ];then + cat "$disposition" + else + cat "$disposition" | sed -E "1,$i s/(.*)/\x1b[92m\1\x1b[0m/" + fi +} + +command -V mawk > /dev/null && awk_inter="mawk -W interactive" || awk_inter="stdbuf -i0 -o0 gawk" + +disposition=clavier/pad +[ ! -p "$tmpdir/kbd_fifo" ] && mkfifo $tmpdir/kbd_fifo +stdbuf -i0 -o0 xev | $awk_inter ' + /^MotionNotify/ {print $1} + /button [0-9]+/ {print substr($4,1,1)}' > $tmpdir/kbd_fifo& +awk_pid=$! + +i=0 +while read key;do + clear;update_layout; + ps -q "$awk_pid" > /dev/null || break + printf "verification de $key, ligne $i\n" + while read entered;do + if [ "$entered" = "$key" ];then + echo "oui";i=$(($i+1));break; + else + printf "reçu : %s, voulu : %s\n" "$entered" "$key" + fi + done < $tmpdir/kbd_fifo +done < "$disposition"