/[projet1]/public/pc/tools/osdk/main/TestSuite/osdk_check.bat
Defence Force logotype

Contents of /public/pc/tools/osdk/main/TestSuite/osdk_check.bat

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1257 - (show annotations)
Sat Feb 14 20:12:17 2015 UTC (4 years, 10 months ago) by dbug
File MIME type: text/plain
File size: 6846 byte(s)
First version of a test suite for the OSDK components.
This first attempt validates that PictConv generates identical results given the same input parameters on a known set of pictures.
1 @ECHO OFF
2 ::
3 :: The idea is to run each of the OSDK tools to generate a particular set of data,
4 :: and then check if the result matches a precomputed MD5.
5 ::
6 :: If the result is the same, it means the version is correct (as far as the test suite is concerned).
7 :: If the results are different, it may mean:
8 :: - One of the tools is broken
9 :: - One of the tools generated data in an inconsistent way (it may not clean data correctly)
10 :: - One of the tools is inserting things that are run dependent (like a version number of time stamp)
11 :: - One of the tools may be generating more efficient things (like a more optimized compiler, or a better conversion algorithm for pictconv)
12 ::
13 :: Whatever the result, it should be investigated before deploying a new version
14 ::
15 :: In order to run this script, you have to make sure that the OSDK variable points to the set of tools you want to check
16 ::
17
18 :: Clear variables
19 SET MD5CREATE=
20
21 :: Set the MD5 mode in check mode
22 ::SET MD5CREATE=YES
23
24 :: Create the folders we need
25 md output >NUL
26 del /q /s output\*.* >NUL
27 pushd output
28 md pictconv >NUL
29 popd
30
31 :: Pictconv testing
32 SET PICTCONV=%OSDK%\Bin\PictConv
33 SET PICTCONV_COLOR=%PICTCONV% -f1 -d0 -o2 -u1
34 SET PICTCONV_MONOCHROM=%PICTCONV% -f0 -f0 -o2
35 SET PICTCONV_MONOCHROM_SRC=%PICTCONV% -f0 -f0 -o2
36
37 %PICTCONV_COLOR% pictures\twilighte_im_title.png output\pictconv\twilighte_im_title.hir
38 %PICTCONV_COLOR% pictures\twilighte_whitehall.png output\pictconv\twilighte_whitehall.hir
39 %PICTCONV_COLOR% pictures\twilighte_im_sprites.png output\pictconv\twilighte_im_sprites.hir
40 %PICTCONV_COLOR% pictures\space_1999_sparks.png output\pictconv\space_1999_sparks.hir
41 %PICTCONV_COLOR% pictures\twilighte_otype_1.png output\pictconv\twilighte_otype_1.hir
42 %PICTCONV_COLOR% pictures\dbug_karhu.png output\pictconv\dbug_karhu.hir
43 %PICTCONV_COLOR% pictures\dbug_space1999_planets.png output\pictconv\dbug_space1999_planets.hir
44 %PICTCONV_COLOR% pictures\dbug_atmos_connectors.png output\pictconv\dbug_atmos_connectors.hir
45 %PICTCONV_COLOR% pictures\dbug_space1999.png output\pictconv\dbug_space1999.hir
46 %PICTCONV_COLOR% pictures\dbug_1337_logo.png output\pictconv\dbug_1337_logo.hir
47 %PICTCONV_COLOR% pictures\dbug_oric1.png output\pictconv\dbug_oric1.hir
48 %PICTCONV_COLOR% pictures\twilighte_tol_title.png output\pictconv\twilighte_tol_title.hir
49 %PICTCONV_COLOR% pictures\twilighte_tol_doors.png output\pictconv\twilighte_tol_doors.hir
50 %PICTCONV_COLOR% pictures\skooldaze.png output\pictconv\skooldaze.hir
51 %PICTCONV_COLOR% pictures\toxic_slime.png output\pictconv\toxic_slime.hir
52 %PICTCONV_COLOR% pictures\twilighte_ripped.png output\pictconv\twilighte_ripped.hir
53 %PICTCONV_COLOR% pictures\murder_on_the_atlantic.png output\pictconv\murder_on_the_atlantic.hir
54 %PICTCONV_COLOR% pictures\damsel.gif output\pictconv\damsel.hir
55 %PICTCONV_COLOR% pictures\dbug_windows95.gif output\pictconv\dbug_windows95.hir
56 %PICTCONV_COLOR% pictures\dbug_yessagician.gif output\pictconv\dbug_yessagician.hir
57 %PICTCONV_COLOR% pictures\diamond_2.gif output\pictconv\diamond_2.hir
58 %PICTCONV_COLOR% pictures\exocet_blueface.gif output\pictconv\exocet_blueface.hir
59 %PICTCONV_COLOR% pictures\exocet_fists.gif output\pictconv\exocet_fists.hir
60 %PICTCONV_COLOR% pictures\exocet_moonguy.gif output\pictconv\exocet_moonguy.hir
61 %PICTCONV_COLOR% pictures\karate_2.gif output\pictconv\karate_2.hir
62 %PICTCONV_COLOR% pictures\mooz_oric.gif output\pictconv\mooz_oric.hir
63 %PICTCONV_COLOR% pictures\mooz_supertomato.gif output\pictconv\mooz_supertomato.hir
64 %PICTCONV_COLOR% pictures\prez_story.gif output\pictconv\prez_story.hir
65 %PICTCONV_COLOR% pictures\tomb_1.gif output\pictconv\tomb_1.hir
66 %PICTCONV_COLOR% pictures\trois_mats.gif output\pictconv\trois_mats.hir
67 %PICTCONV_COLOR% pictures\twilighte_beast.gif output\pictconv\twilighte_beast.hir
68 %PICTCONV_COLOR% pictures\twilighte_dragons.gif output\pictconv\twilighte_dragons.hir
69 %PICTCONV_COLOR% pictures\twilighte_pegasus.gif output\pictconv\twilighte_pegasus.hir
70 %PICTCONV_COLOR% pictures\twilighte_sonix.gif output\pictconv\twilighte_sonix.hir
71 %PICTCONV_COLOR% pictures\mooz_barbitoric.gif output\pictconv\mooz_barbitoric.hir
72 %PICTCONV_COLOR% pictures\mondrian.png output\pictconv\mondrian.hir
73
74 %PICTCONV_COLOR% pictures\output-buffy.png output\pictconv\output-buffy.hir
75 %PICTCONV_COLOR% pictures\output-homer.png output\pictconv\output-homer.hir
76 %PICTCONV_COLOR% pictures\output-lena.png output\pictconv\output-lena.hir
77 %PICTCONV_COLOR% pictures\Flowers.bmp output\pictconv\flowers_gloky.hir
78 %PICTCONV_COLOR% pictures\pinky-indecence.bmp output\pictconv\pinky-indecence.hir
79 %PICTCONV_COLOR% pictures\pinky-breast.bmp output\pictconv\pinky-breast.hir
80 %PICTCONV_COLOR% pictures\einstein.png output\pictconv\einstein.hir
81 %PICTCONV_COLOR% pictures\eastwood.bmp output\pictconv\eastwood.hir
82
83 %PICTCONV_COLOR% pictures\output-mire.png output\pictconv\output-mire.hir
84
85 %PICTCONV_MONOCHROM% pictures\title_picture.png output\pictconv\title_picture.hir
86 %PICTCONV_MONOCHROM% pictures\title_picture_2.png output\pictconv\title_picture_2.hir
87 %PICTCONV_MONOCHROM% pictures\british_board_censors.png output\pictconv\british_board_censors.hir
88 %PICTCONV_MONOCHROM% pictures\Font6x8_ArtDeco.png output\pictconv\Font6x8_ArtDeco.hir
89 %PICTCONV_MONOCHROM% pictures\Font12x16_ArtDeco.png output\pictconv\Font12x16_ArtDeco.hir
90
91 %PICTCONV_MONOCHROM_SRC% pictures\loading_data.png output\pictconv\loading_data.s
92
93 ::
94 :: Generates/checks the md5list
95 ::
96 call:CheckTool pictconv
97
98 goto EndOk
99
100
101 :CheckTool
102 IF "%MD5CREATE%"=="YES" GOTO CreateMD5
103
104 :CheckMD5
105 ECHO Checking MD5 list for %1
106 pushd output\%1
107 md5sum --check ../../%1_md5list.txt >../md5checkoutput.txt
108 popd
109 IF ERRORLEVEL 1 GOTO Error
110 GOTO:EOF
111
112 :CreateMD5
113 ECHO Creating MD5 list for %1
114 pushd output\%1
115 md5sum *.* > ../../%1_md5list.txt
116 popd
117 IF ERRORLEVEL 1 GOTO Error
118 GOTO:EOF
119
120
121
122 :Error
123 ECHO.
124 ECHO !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR
125 ECHO !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR
126 ECHO !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR
127 ECHO.
128 ECHO One or more tool has returned an error code
129 ECHO --------------------------------------------------------------------------------
130 find "FAILED" output\md5checkoutput.txt
131 ECHO --------------------------------------------------------------------------------
132 ECHO.
133 ECHO !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR
134 ECHO !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR
135 ECHO !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR !! ERROR
136 ECHO.
137 goto End
138
139
140 :EndOk
141 ECHO.
142 ECHO No error found
143 ECHO.
144 goto End
145
146
147 :End
148 pause

  ViewVC Help
Powered by ViewVC 1.1.26