First pass at adding opengl interface
[clnl] / bin / diagnose-view-test
1 #!/bin/bash
2
3 if ! [ -n "$1" ] ; then
4   echo "Uhm, need a test name, yo"
5   exit 1
6 fi
7 TEST=$@
8
9 sbcl --eval "(asdf:load-system :clnl-test)" --eval "(quit)" &> /dev/null
10
11 runtestfn() {
12   sbcl \
13     --noinform --disable-ldb --lose-on-corruption --end-runtime-options \
14     --eval "(asdf:load-system :clnl-test)" \
15     --eval "(clnl-test::$1 \"$TEST\")" \
16     --eval "(quit)" 2> /dev/null | sed -n '/^----$/,$p' | tail -n +2
17 }
18
19 scalaprog=bin/viewruncmd.scala
20
21 scalafile=$(mktemp -u -p . --suffix .scala.png)
22 clfile=$(mktemp -u -p . --suffix .cl.ppm)
23
24 runtestfn "test-scala-input" | $scalaprog | sed -n '/^----$/,$p' | tail -n +2
25 mv scala.png $scalafile
26 checksum=$(runtestfn "test-debug")
27 mv cl.ppm $clfile
28
29 echo
30 echo "If the images are equal, use $checksum for CL checksum (note that you may get a different checksum on travis, see as of yet unwritten documentation for details)"
31 echo "The compare result is (Less than 1500 is probably equivalent):"
32 compare -metric RMSE $clfile $scalafile NULL:
33 echo
34 echo
35 echo "Here are the results of identify (make sure they are the same size):"
36 identify $clfile
37 identify $scalafile
38 echo "Make sure that turtles are on top of each other correctly and all correct colors."
39 echo -n "Hit enter to view them ..."
40 read
41
42 display $scalafile &
43 scalafiledisplaypid=$!
44 display $clfile &
45 clfiledisplaypid=$!
46
47 echo -n "... and hit enter to finish"
48 read
49
50 kill $scalafiledisplaypid
51 kill $clfiledisplaypid
52
53 rm $scalafile
54 rm $clfile