loaders: JPG: Fix bussy loop on corrupted file.
[gfxprim.git] / tests / framework / res2html.sh
blob7141919325591321f576c3f16ca85163ec94eb6f
1 #!/bin/sh
4 # Quick hack to generate html from result directory
7 resdir=$1
9 die()
11 echo ""
12 echo "* ERROR * ERROR * ERROR * ERROR * ERROR * ERROR *"
13 echo ""
14 echo "$1"
15 echo ""
16 echo "* ERROR * ERROR * ERROR * ERROR * ERROR * ERROR *"
17 echo ""
18 exit 1
21 BINDIR=$(pwd)
23 echo "Running in resdir $resdir"
25 cd "$resdir" || die "Failed to cd into $resdir"
27 echo "<html>" > index.html
28 echo " <head>" >> index.html
29 echo " </head>" >> index.html
30 echo " <body>" >> index.html
31 echo " <h1>Test Results</h1>" >> index.html
32 echo " <table bgcolor=\"#99a\">" >> index.html
33 echo " <tr bgcolor=\"#bbbbff\">" >> index.html
34 echo " <td><b>Suite</b></td>" >> index.html
35 echo " <td><b>Fail</b></td>" >> index.html
36 echo " <td><b>Skip</b></td>" >> index.html
37 echo " <td><b>All</b></td>" >> index.html
38 echo " <td><b>Link</b></td>" >> index.html
39 echo " </tr>" >> index.html
41 for i in *; do
42 if ! [ -d "$i" ]; then
43 continue
46 echo " <tr><td colspan=\"6\" bgcolor=\"#bbf\">&nbsp;$i</td></tr>" >> index.html
48 for j in "$i/"*.json; do
49 ts_name=$(basename "$j" ".json")
50 echo "$j -> $i/$ts_name.html"
51 $BINDIR/log2html.py -s "$i/$ts_name.html" "$j" >> index.html
52 $BINDIR/log2html.py "$j" > "$i/$ts_name.html"
53 done
54 done
56 echo " </table>" >> index.html
57 echo " </body>" >> index.html
58 echo "</html>" >> index.html