Debian Codegraph @

cmd/infocmp/test.sh

raw
1 #!/bin/bash
2
3 set -e
4
5 go build
6
7 SI=$(which infocmp)
8 BI=./infocmp
9
10 OUT=.out
11
12 mkdir -p $OUT
13
14 TERMS=$(find /usr/share/terminfo -type f)
15 for i in $TERMS; do
16 NAME=$(basename $i)
17
18 TERM=$NAME $SI -1 -L -x > $OUT/$NAME-orig.txt
19 TERM=$NAME $BI -x > $OUT/$NAME-test.txt
20
21 if [[ "$1" == "--no-acs-chars" ]]; then
22 perl -pi -e 's/^\tacs_chars=.*\n//' $OUT/$NAME-orig.txt $OUT/$NAME-test.txt
23 fi
24 done
25
26 md5sum $OUT/*-orig.txt > $OUT/orig.md5
27
28 cp $OUT/orig.md5 $OUT/test.md5
29
30 perl -pi -e 's/-orig\.txt$/-test.txt/g' $OUT/test.md5
31
32 SED=sed
33 if [[ "$(uname)" == "Darwin" ]]; then
34 SED=gsed
35 fi
36
37 for i in $(md5sum -c $OUT/test.md5 |grep FAILED|$SED -s 's/: FAILED//'); do
38 $HOME/src/misc/icdiff/icdiff $($SED -e 's/-test\.txt$/-orig.txt/' <<< "$i") $i
39 done