cleaner gcc build process
[nestedvm.git] / src / tests / check.sh
1 #!/bin/sh -e
2
3 [ -z "$JAVA" ] && JAVA=java
4  
5 CLASSPATH="$(pwd)/build"; export CLASSPATH
6 if [ "$1" != "running_from_make" ]; then
7         echo "Please don't run this scipt directly. Use make check" >&2
8         exit 1
9 fi
10
11 INT="$2"
12
13 cd tmp
14
15 if [ ! -e .skipmspack ]; then
16
17 mkdir -p mspack
18 cd mspack
19 rm -f *.TTT *.inf FONTINST.EXE *.DLL *.TXT;
20 for f in \
21     andale32.exe arial32.exe arialb32.exe comic32.exe courie32.exe georgi32.exe \
22     impact32.exe times32.exe trebuc32.exe verdan32.exe webdin32.exe; \
23 do
24         [ -e "$f" ] || wget "http://dist.xwt.org/corefonts/$f" || rm -f "$f"
25         [ -e "$f" ] ||  exit 1
26 done
27
28 echo "Extracting MS Core Fonts using MSPackBench..."
29 $JAVA tests.MSPackBench *32.exe
30
31 cat <<EOF | md5sum -cv
32 663974c9fe3ba55b228724fd4d4e445f  AndaleMo.TTF
33 3e7043e8125f1c8998347310f2c315bc  AriBlk.TTF
34 f11c0317db527bdd80fa0afa04703441  Arial.TTF
35 34cd8fd9e4fae9f075d4c9a2c971d065  Arialbd.TTF
36 a2b3bcdb39097b6aed17a766652b92b2  Arialbi.TTF
37 25633f73d92a0646e733e50cf2cc3b07  Ariali.TTF
38 a50f9c96a76356e3d01013e0b042989f  Comic.TTF
39 81d64ec3675c4adc14e9ad2c5c8103a7  Comicbd.TTF
40 f4b306eed95aa7d274840533be635532  Georgia.TTF
41 c61b355a5811e56ed3d7cea5d67c900e  Georgiab.TTF
42 1e4e5d1975bdf4a5c648afbf8872fa13  Georgiai.TTF
43 e5d52bbfff45e1044381bacb7fc8e300  Georgiaz.TTF
44 8fc622c3a2e2d992ec059cca61e3dfc0  Impact.TTF
45 4f97f4d6ba74767259ccfb242ce0e3f7  Times.TTF
46 ed6e29caf3843142d739232aa8642158  Timesbd.TTF
47 6d2bd425ff00a79dd02e4c95f689861b  Timesbi.TTF
48 957dd4f17296522dead302ab4fcdfa8d  Timesi.TTF
49 055460df9ab3c8aadd3330bd30805f11  Trebucbd.ttf
50 3ba52ab1fa0cd726e7868e9c6673902c  Verdana.TTF
51 a2b4dc9afc18e76cfcaa0071fa7cd0da  Verdanab.TTF
52 24b3a293c865a2c265280f017fb24ba5  Verdanai.TTF
53 f7310c29df0070530c48a47f2dca9014  Verdanaz.TTF
54 1a56b45a66b07b4c576d5ead048ed992  Webdings.TTF
55 20f23317e90516cbb7d38bd53b3d1c5b  cour.ttf
56 7d94f95bf383769b51379d095139f2d7  courbd.ttf
57 da414c01f951b020bb09a4165d3fb5fa  courbi.ttf
58 167e27add66e9e8eb0d28a1235dd3bda  couri.ttf
59 70e7be8567bc05f771b59abd9d696407  trebuc.ttf
60 fb5d68cb58c6ad7e88249d65f6900740  trebucbi.ttf
61 8f308fe77b584e20b246aa1f8403d2e9  trebucit.ttf
62 663974c9fe3ba55b228724fd4d4e445f  AndaleMo.TTF
63 3e7043e8125f1c8998347310f2c315bc  AriBlk.TTF
64 f11c0317db527bdd80fa0afa04703441  Arial.TTF
65 34cd8fd9e4fae9f075d4c9a2c971d065  Arialbd.TTF
66 a2b3bcdb39097b6aed17a766652b92b2  Arialbi.TTF
67 25633f73d92a0646e733e50cf2cc3b07  Ariali.TTF
68 a50f9c96a76356e3d01013e0b042989f  Comic.TTF
69 81d64ec3675c4adc14e9ad2c5c8103a7  Comicbd.TTF
70 f4b306eed95aa7d274840533be635532  Georgia.TTF
71 c61b355a5811e56ed3d7cea5d67c900e  Georgiab.TTF
72 1e4e5d1975bdf4a5c648afbf8872fa13  Georgiai.TTF
73 e5d52bbfff45e1044381bacb7fc8e300  Georgiaz.TTF
74 8fc622c3a2e2d992ec059cca61e3dfc0  Impact.TTF
75 4f97f4d6ba74767259ccfb242ce0e3f7  Times.TTF
76 ed6e29caf3843142d739232aa8642158  Timesbd.TTF
77 6d2bd425ff00a79dd02e4c95f689861b  Timesbi.TTF
78 957dd4f17296522dead302ab4fcdfa8d  Timesi.TTF
79 055460df9ab3c8aadd3330bd30805f11  Trebucbd.ttf
80 3ba52ab1fa0cd726e7868e9c6673902c  Verdana.TTF
81 a2b4dc9afc18e76cfcaa0071fa7cd0da  Verdanab.TTF
82 24b3a293c865a2c265280f017fb24ba5  Verdanai.TTF
83 f7310c29df0070530c48a47f2dca9014  Verdanaz.TTF
84 1a56b45a66b07b4c576d5ead048ed992  Webdings.TTF
85 20f23317e90516cbb7d38bd53b3d1c5b  cour.ttf
86 7d94f95bf383769b51379d095139f2d7  courbd.ttf
87 da414c01f951b020bb09a4165d3fb5fa  courbi.ttf
88 167e27add66e9e8eb0d28a1235dd3bda  couri.ttf
89 70e7be8567bc05f771b59abd9d696407  trebuc.ttf
90 fb5d68cb58c6ad7e88249d65f6900740  trebucbi.ttf
91 8f308fe77b584e20b246aa1f8403d2e9  trebucit.ttf
92 EOF
93
94 echo "Core Fonts extracted successfully!"
95
96 cd ..
97
98 fi
99
100 if [ ! -e .skipdjpeg ]; then
101 echo "Decoding some jpegs with DJpeg..."
102
103 rm -f *.tga
104
105 [ -e banner.jpg ] || wget http://www.xwt.org/image/banner.jpg
106 [ -e banner.jpg ] || exit 1
107
108 $JAVA tests.DJpeg -targa -outfile thebride_1280.tga thebride_1280.jpg 
109 echo "e90f6b915aee2fc0d2eb9fc60ace6203  thebride_1280.tga" | md5sum -cv
110
111 $JAVA tests.DJpeg -targa -outfile banner.tga banner.jpg
112 echo "4c7cc29ae2094191a9b0308cf9a04fbd  banner.tga" | md5sum -cv
113
114 echo "JPEGs decoded successfully!"
115
116 fi
117
118 if [ ! -e .skipfreetype ]; then
119
120 cd mspack
121
122 echo "Rendering some fonts with FTBench..."
123 if ! [ -e Verdana.TTF -a -e Arial.TTF -a -e Comic.TTF ]; then
124         echo "Can't find the corefonts - did the mspack test complete?"
125         exit 1
126 fi
127
128 rm -f *.render
129
130 for f in Verdana.TTF Arial.TTF Comic.TTF; do
131         $JAVA tests.FTBench "$f" "$f".render
132 done
133
134 cat <<EOF|md5sum -cv
135 e33b9db5a413af214b2524265af18026  Arial.TTF.render
136 61dee4f697a61ebc1b47decbed04b2da  Comic.TTF.render
137 d5a6d39a63e49c597ed860913e27d2bb  Verdana.TTF.render
138 EOF
139
140 echo "Fonts rendered successfully"
141 cd ..
142
143 fi
144
145 if [ ! -e .skipgc ]; then
146
147 echo "Running gctest from the boehm-gc library..."
148 $JAVA tests.GCTest
149
150 fi
151
152 if [ ! -e .busybox -a -e ../build/tests/BusyBox.class ]; then
153         echo "Running busybox's md5sum command on some ttfs"
154         $JAVA tests.BusyBox ash -c "md5sum mspack/*.ttf > md5.1"
155         md5sum mspack/*.ttf > md5.2
156         cmp md5.1 md5.2 && echo "The BusyBox md5sum command and sh work properly!"
157 fi
158
159 cat <<EOF
160 * * * * * * * * * * * * * * * * * * * * * 
161 * All tests completed with no failures  *
162 * * * * * * * * * * * * * * * * * * * * * 
163
164 EOF