summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-02 14:00:08 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-08-02 14:00:08 (GMT)
commit8745b40e3eb216fc5cfa7373fea3b4ae991f1c3e (patch)
treeeab2aa7ec1941bd3da99f1dbcf64eab04d34667a /test
downloadeeshow-8745b40e3eb216fc5cfa7373fea3b4ae991f1c3e.zip
eeshow-8745b40e3eb216fc5cfa7373fea3b4ae991f1c3e.tar.gz
eeshow-8745b40e3eb216fc5cfa7373fea3b4ae991f1c3e.tar.bz2
rename sch2fig to eeshow
Diffstat (limited to 'test')
-rw-r--r--test/README24
-rwxr-xr-xtest/comp29
-rwxr-xr-xtest/genpng37
3 files changed, 90 insertions, 0 deletions
diff --git a/test/README b/test/README
new file mode 100644
index 0000000..fdc81f2
--- /dev/null
+++ b/test/README
@@ -0,0 +1,24 @@
+Setup
+-----
+
+git clone https://neo900.org/git/ee.git neo900-ee
+cd neo900-ee
+git reset --hard 57eebdcf573311c049bc57527bc03a517aff0fef
+
+cd ..
+
+git clone git://projects.qi-hardware.com/kicad-libs.git
+cd kicad-libs
+git reset --hard 143fa7fe10cabbfe1cb12d010c7426d482d7e6f4
+
+cd ..
+
+./genpng ref
+
+
+Run test
+--------
+
+./genpng
+./comp
+qiv -t _diff*.png
diff --git a/test/comp b/test/comp
new file mode 100755
index 0000000..b406607
--- /dev/null
+++ b/test/comp
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+usage()
+{
+ echo "usage: $0 [dir]" 1>&2
+ exit 1
+}
+
+
+[ "$2" ] && usage
+[ "${1#-}" != "$1" ] && usage
+
+dir=${1:-.}
+
+diffs=0
+rm -f $dir/_diff*png
+for n in $dir/out*.png; do
+ out=`basename "$n"`
+ ref=$dir/ref${out#out}
+ diff=$dir/_diff${out#out}
+ if ! compare -metric AE $ref $n - >/dev/null; then
+ diffs=`expr $diffs + 1`
+ compare -metric AE $ref $n $diff
+ fi
+done
+echo
+[ $diffs = 0 ] && exit 0
+echo "$diffs difference(s)" 1>&2
+exit 1
diff --git a/test/genpng b/test/genpng
new file mode 100755
index 0000000..0d73ec1
--- /dev/null
+++ b/test/genpng
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+usage()
+{
+ echo "usage: $0 [[dir] prefix]" 1>&2
+ exit 1
+}
+
+
+[ "$3" ] && usage
+[ "${1#-}" != "$1" ] && usage
+
+dir=.
+if [ "$2" ]; then
+ dir=$1
+ shift
+fi
+prefix=${1:-out}
+
+sheet=1
+while [ $sheet -le 38 ]; do
+ echo -n .
+ sn=`printf '%02d' $sheet`
+ file=$dir/$prefix$sn.png
+ if [ $sheet = 1 ]; then
+ in=$dir/neo900-ee/hw/neo900.sch
+ else
+ in=$dir/neo900-ee/hw/neo900_SS_`expr $sheet - 1`.sch
+ fi
+ file=$dir/$prefix$sn.png
+ $dir/../eeshow $dir/neo900-ee/hw/neo900.lib \
+ $dir/kicad-libs/components/powered.lib "$in" \
+ -- fig -t $dir/frame.fig SHEET=$sn |
+ fig2dev -L png -m 2 >$file
+ sheet=`expr $sheet + 1`
+done
+echo