1 # Main script in this test grid; does all the job.
2 # Individual test scripts are used only to specify data file and reference
3 # test data (expected values of test execution).
5 # - load specified data file
6 # - check transfer status, shape, and attributes against expected values
9 # Set flag dump_file to 1 in order to regenerate script files with actual data
10 # used as reference. In this mode all tests intentionaly report failure.
12 ########################################################################
13 set mist_Second 0; set mist_w 0; set mist 0; set isIGES 0;
14 ############################################ DATA c ################
15 set dfal_First 0; set dwar_First 0; set dcomp_First 0
16 set dfal_Second 0; set dwar_Second 0; set dcomp_Second 0
17 ############################################# TPSTAT c ##############
18 set fal_First 0; set war_First 0; set comp_First 0
19 set fal_Second 0; set war_Second 0; set comp_Second 0
20 ###################################### DECAF information ##########
21 set nblev0_First 0; set nblev1_First 0; set nblev2_First 0; set nblev_total_First 0; set nbshname_First 0;
22 set nbshcolor_First 0; set nbshlayer_First 0;
23 set nbcentroid_First 0; set nbvolume_First 0; set nbarea_First 0;
24 set nbcolor_First 0; set colors_First ""; set nblayer_First 0; set layers_First "";
25 set nblev0_Second 0; set nblev1_Second 0; set nblev2_Second 0; set nblev_total_Second 0; set nbshname_Second 0;
26 set nbshcolor_Second 0; set nbshlayer_Second 0;
27 set nbcentroid_Second 0; set nbvolume_Second 0; set nbarea_Second 0;
28 set nbcolor_Second 0; set colors_Second ""; set nblayer_Second 0; set layers_Second "";
29 ############################################# TOLERANCE ############
30 set MaxTol_First 0; set AvgTol_First 0
31 set MaxTol_Second 0; set AvgTol_Second 0
32 ############################################# STATSHAPE ############
33 set sol_First 0; set she_First 0; set fac_First 0; set fwir_First 0; set fedg_First 0; set sedg_First 0
34 set sol_Second 0; set she_Second 0; set fac_Second 0; set fwir_Second 0; set fedg_Second 0; set sedg_Second 0
35 ############################################# NBSHAPES #############
36 set fa_First 0; set sh_First 0; set so_First 0; set co_First 0; set shpp_First 0
37 set fa_Second 0; set sh_Second 0; set so_Second 0; set co_Second 0; set shpp_Second 0
38 ###################################### CHECKSHAPE ##################
39 set chwi_First 0; set chfa_First 0; set chsh_First 0; set chso_First 0
40 set chwi_Second 0; set chfa_Second 0; set chsh_Second 0; set chso_Second 0
41 ###################################################################
44 set todo_mask "puts \"TODO CR23096 ALL: "
45 set Mandriva_todo_mask "puts \"TODO CR23096 ALL:"
47 ##################################################################
50 if { [string length $filename] > 1} {
51 set ext [file extension $filename]
52 set ReadCommand ReadStep
53 set WriteCommand WriteStep
55 if { $ext == ".igs" || $ext == ".iges" } {
56 set ReadCommand ReadIges
57 set WriteCommand WriteIges
60 if {[info exist ProductMode] && $ProductMode == "OFF"} {
61 set tmp [param read.step.product.mode OFF]
63 set path_file [locate_data_file $filename]
64 if { [catch { $ReadCommand D_First $path_file } catch_result] } {
65 set err_msg "Error: First - file was not read - exception "
67 append todo_msg $todo_mask $err_msg $end_line
75 # Get information about translation
80 if { [llength $tps_2] > 0 } {
81 # Finding all strings with warnings
82 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+W:} $tps_2]
83 # Extracting counts of warnings
84 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
85 # Calculating total number of warnings
86 foreach i $b {set dwar_First [expr $dwar_First + $i]}
87 set dwar_First [expr $dwar_First/4]
89 # Finding all strings with faulties
90 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+F:} $tps_2]
91 # Extracting counts of faulties
92 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
93 # Calculating total number of faulties
94 foreach i $b {set dfal_First [expr $dfal_First + $i]}
95 set dfal_First [expr $dfal_First/4]
96 # Calculating total number of faulties and warnings
97 set dcomp_First [expr $dfal_First + $dwar_First]
100 puts " DATA c checking was NOT provided"
105 set colvo [llength $tps_1]
106 if { ${colvo} > 0 } {
107 # Finding failed messages
108 set err_list [regexp -all -inline {[^\r\n:]*failed[^\r\n]*} $tps_1]
109 if { $err_list != 0 } {
110 foreach err_msg $err_list {
111 if { [regexp "\\(" $err_msg] } {
112 set err_msg [string map {\( \\\\(} $err_msg]
114 if { [regexp "\\)" $err_msg] } {
115 set err_msg [string map {\) \\\\)} $err_msg]
117 if { [regexp {transfer failed[^\r\n]*} $err_msg err_full_msg] } {
118 set err_msg "$err_full_msg"
120 if { ![regexp "$err_msg" $todo_msg] } {
121 append todo_msg $todo_mask $err_msg $end_line
126 # Finding all strings with warnings
127 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+W:} $tps_1]
128 # Extracting counts of warnings
129 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
130 # Calculating total number of warnings
131 foreach i $b {set war_First [expr $war_First + $i]}
132 set war_First [expr $war_First/4]
134 # Finding all strings with faulties
135 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+F:} $tps_1]
136 # Extracting counts of faulties
137 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
138 # Calculating total number of faulties
139 foreach i $b {set fal_First [expr $fal_First + $i]}
140 set fal_First [expr $fal_First/4]
141 # Calculating total number of faulties and warnings
142 set comp_First [expr $fal_First + $war_First]
144 puts " TPSTAT c checking was NOT provided"
147 # Get DECAF information about (color, layers and properties)
150 set xst [ XStat D_First ]
152 if { [llength $xst] > 0 } {
153 regexp {level +N +0 +: +([-0-9.+eE]+)} $xst full nblev0_First
154 regexp {level +N +1 +: +([-0-9.+eE]+)} $xst full nblev1_First
155 regexp {level +N +2 +: +([-0-9.+eE]+)} $xst full nblev2_First
156 regexp {Total +number +of +labels +for +shapes +in +the +document += +([-0-9.+eE]+)} $xst full nblev_total_First
157 regexp {Number +of +labels +with +name += +([-0-9.+eE]+)} $xst full nbshname_First
158 regexp {Number +of +labels +with +color +link += +([-0-9.+eE]+)} $xst full nbshcolor_First
159 regexp {Number +of +labels +with +layer +link += +([-0-9.+eE]+)} $xst full nbshlayer_First
160 regexp {Number +of +Centroid Props += +([-0-9.+eE]+)} $xst full nbcentroid_First
161 regexp {Number +of +Volume Props += +([-0-9.+eE]+)} $xst full nbvolume_First
162 regexp {Number +of +Area Props += +([-0-9.+eE]+)} $xst full nbarea_First
163 regexp {Number +of +colors += +([-0-9.+eE]+)} $xst full nbcolor_First
164 regexp {Number +of +colors += +[-0-9.+eE]+\n([^\n]*)} $xst full colors_First
165 regexp {Number +of +layers += +([-0-9.+eE]+)} $xst full nblayer_First
166 regexp {Number +of +layers += +[-0-9.+eE]+\n([^\n]*)} $xst full layers_First
168 puts " DECAF information was NOT provided"
171 # Get shape for standard analysis
173 if { [catch { XGetOneShape res_1 D_First } catch_result] } {
174 set err_msg "Error : First - cannot get shape from document - exception"
176 append todo_msg $todo_mask $err_msg $end_line
179 if { $mist < 1 && [info exists res_1] == 0 } {
180 set err_msg "Error : First - cannot read any relevant data from the file"
182 append todo_msg $todo_mask $err_msg $end_line
191 set tol [tolerance res_1]
193 if { [llength $tol] > 0 } {
194 regexp {Tolerance +MAX=([-0-9.+eE]+) +AVG=([-0-9.+eE]+) +MIN=[-0-9.+eE]+} $tol full MaxTol_First AvgTol_First
196 puts " TOLERANCE checking was NOT provided"
201 set tps_3 [ statshape res_1]
202 set col [llength $tps_3]
204 regexp {([-0-9.+eE]+)\t+ +EDGE \(Free\)} $tps_3 full fedg_First
205 regexp {([-0-9.+eE]+)\t+ +EDGE \(Shared\)} $tps_3 full sedg_First
206 regexp {([-0-9.+eE]+)\t+ +WIRE \(Free\)} $tps_3 full fwir_First
207 regexp {([-0-9.+eE]+)\t+ +FACE} $tps_3 full fac_First
208 regexp {([-0-9.+eE]+)\t+ +SHELL} $tps_3 full she_First
209 regexp {([-0-9.+eE]+)\t+ +SOLID} $tps_3 full sol_First
211 puts " STATSHAPE checking was NOT provided"
216 set nbs [ nbshapes res_1]
217 if { [llength ${nbs}] > 0 } {
218 regexp {FACE +: +([-0-9.+eE]+)} $nbs full fa_First
219 regexp {SHELL +: +([-0-9.+eE]+)} $nbs full sh_First
220 regexp {SOLID +: +([-0-9.+eE]+)} $nbs full so_First
221 regexp {COMPOUND +: +([-0-9.+eE]+)} $nbs full co_First
222 regexp {SHAPE +: +([-0-9.+eE]+)} $nbs full shpp_First
224 puts " NBSHAPES checking was NOT provided"
228 set chbr [checkshape res_1 ff]
229 if { [llength ${chbr}] > 0 } {
230 regexp {WIRE\t+: +([-0-9.+eE]+).+} $chbr full chwi_First
231 regexp {FACE\t+: +([-0-9.+eE]+).+} $chbr full chfa_First
232 regexp {SHELL\t+: +([-0-9.+eE]+).+} $chbr full chsh_First
233 regexp {SOLID\t+: +([-0-9.+eE]+).+} $chbr full chso_First
235 puts " CHECKSHAPE checking was NOT provided"
242 puts "-----------------------------WRITING FILE ------------------------------"
243 file delete $imagedir/${casename}_D_First$ext
244 if { [catch { $WriteCommand D_First $imagedir/${casename}_D_First$ext } catch_result] } {
245 set err_msg "Error: First - file was not written - exception"
247 append todo_msg $todo_mask $err_msg $end_line
252 if { [catch { $ReadCommand D_Second $imagedir/${casename}_D_First$ext } catch_result] } {
253 set err_msg "Errorr: Second - file was not read - exception"
255 append todo_msg $todo_mask $err_msg $end_line
259 catch {[file delete $imagedir/${casename}_D_First$ext]}
262 if { [catch { Close D_First } catch_result] } {
263 set err_msg "Error : cannot close a document D_First - exception"
265 append todo_msg $todo_mask $err_msg $end_line
270 if { $mist_w > 0 || $mist_Second > 0 } {
274 # Get information about translation
279 if { [llength $tps_2] > 0 } {
280 # Finding all strings with warnings
281 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+W:} $tps_2]
282 # Extracting counts of warnings
283 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
284 # Calculating total number of warnings
285 foreach i $b {set dwar_Second [expr $dwar_Second + $i]}
286 set dwar_Second [expr $dwar_Second/4]
288 # Finding all strings with faulties
289 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+F:} $tps_2]
290 # Extracting counts of faulties
291 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
292 # Calculating total number of faulties
293 foreach i $b {set dfal_Second [expr $dfal_Second + $i]}
294 set dfal_Second [expr $dfal_Second/4]
295 # Calculating total number of faulties and warnings
296 set dcomp_Second [expr $dfal_Second + $dwar_Second]
300 puts " DATA c checking was NOT provided"
306 set colvo [llength $tps_1]
307 if { ${colvo} > 0 } {
308 # Finding failed messages
309 set err_list [regexp -all -inline {[^\r\n:]*failed[^\r\n]*} $tps_1]
310 if { $err_list != 0 } {
311 foreach err_msg $err_list {
312 if { [regexp "\\(" $err_msg] } {
313 set err_msg [string map {\( \\\\(} $err_msg]
315 if { [regexp "\\)" $err_msg] } {
316 set err_msg [string map {\) \\\\)} $err_msg]
318 if { [regexp {transfer failed[^\r\n]*} $err_msg err_full_msg] } {
319 set err_msg "$err_full_msg"
321 if { ![regexp "$err_msg" $todo_msg] } {
322 append todo_msg $todo_mask $err_msg $end_line
327 # Finding all strings with warnings
328 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+W:} $tps_1]
329 # Extracting counts of warnings
330 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
331 # Calculating total number of warnings
332 foreach i $b {set war_Second [expr $war_Second + $i]}
333 set war_Second [expr $war_Second/4]
335 # Finding all strings with faulties
336 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+F:} $tps_1]
337 # Extracting counts of faulties
338 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
339 # Calculating total number of faulties
340 foreach i $b {set fal_Second [expr $fal_Second + $i]}
341 set fal_Second [expr $fal_Second/4]
342 # Calculating total number of faulties and warnings
343 set comp_Second [expr $fal_Second + $war_Second]
345 puts " TPSTAT c checking was NOT provided"
348 # Get DECAF information about (color, layers and properties)
351 set xst [ XStat D_Second ]
352 if { [llength $xst] > 0 } {
353 regexp {level +N +0 +: +([-0-9.+eE]+)} $xst full nblev0_Second
354 regexp {level +N +1 +: +([-0-9.+eE]+)} $xst full nblev1_Second
355 regexp {level +N +2 +: +([-0-9.+eE]+)} $xst full nblev2_Second
356 regexp {Total +number +of +labels +for +shapes +in +the +document += +([-0-9.+eE]+)} $xst full nblev_total_Second
357 regexp {Number +of +labels +with +name += +([-0-9.+eE]+)} $xst full nbshname_Second
358 regexp {Number +of +labels +with +color +link += +([-0-9.+eE]+)} $xst full nbshcolor_Second
359 regexp {Number +of +labels +with +layer +link += +([-0-9.+eE]+)} $xst full nbshlayer_Second
360 regexp {Number +of +Centroid Props += +([-0-9.+eE]+)} $xst full nbcentroid_Second
361 regexp {Number +of +Volume Props += +([-0-9.+eE]+)} $xst full nbvolume_Second
362 regexp {Number +of +Area Props += +([-0-9.+eE]+)} $xst full nbarea_Second
363 regexp {Number +of +colors += +([-0-9.+eE]+)} $xst full nbcolor_Second
364 regexp {Number +of +colors += +[-0-9.+eE]+\n([^\n]*)} $xst full colors_Second
365 regexp {Number +of +layers += +([-0-9.+eE]+)} $xst full nblayer_Second
366 regexp {Number +of +layers += +[-0-9.+eE]+\n([^\n]*)} $xst full layers_Second
368 puts " DECAF information was NOT provided"
370 # Get shape for standard analysis
372 if { [catch { XGetOneShape res_2 D_Second } catch_result] } {
373 set err_msg "Error : Second - cannot get shape from document - exception"
375 append todo_msg $todo_mask $err_msg $end_line
378 if { $mist < 1 && [info exists res_2] == 0 } {
379 set err_msg "Error : Second - cannot read any relevant data from the file"
381 append todo_msg $todo_mask $err_msg $end_line
391 set tol [tolerance res_2]
392 if { [llength $tol] > 0 } {
393 regexp {Tolerance +MAX=([-0-9.+eE]+) +AVG=([-0-9.+eE]+) +MIN=[-0-9.+eE]+} $tol full MaxTol_Second AvgTol_Second
395 puts " TOLERANCE checking was NOT provided"
400 set tps_3 [ statshape res_2]
401 set col [llength $tps_3]
403 regexp {([-0-9.+eE]+)\t+ +EDGE \(Free\)} $tps_3 full fedg_Second
404 regexp {([-0-9.+eE]+)\t+ +EDGE \(Shared\)} $tps_3 full sedg_Second
405 regexp {([-0-9.+eE]+)\t+ +WIRE \(Free\)} $tps_3 full fwir_Second
406 regexp {([-0-9.+eE]+)\t+ +FACE} $tps_3 full fac_Second
407 regexp {([-0-9.+eE]+)\t+ +SHELL} $tps_3 full she_Second
408 regexp {([-0-9.+eE]+)\t+ +SOLID} $tps_3 full sol_Second
410 puts " STATSHAPE checking was NOT provided"
415 set nbs [ nbshapes res_2]
416 if { [llength ${nbs}] > 0 } {
417 regexp {FACE +: +([-0-9.+eE]+)} $nbs full fa_Second
418 regexp {SHELL +: +([-0-9.+eE]+)} $nbs full sh_Second
419 regexp {SOLID +: +([-0-9.+eE]+)} $nbs full so_Second
420 regexp {COMPOUND +: +([-0-9.+eE]+)} $nbs full co_Second
421 regexp {SHAPE +: +([-0-9.+eE]+)} $nbs full shpp_Second
423 puts " NBSHAPES checking was NOT provided"
427 set chbr [checkshape res_2 ff]
428 if { [llength ${chbr}] > 0 } {
429 regexp {WIRE\t+: +([-0-9.+eE]+).+} $chbr full chwi_Second
430 regexp {FACE\t+: +([-0-9.+eE]+).+} $chbr full chfa_Second
431 regexp {SHELL\t+: +([-0-9.+eE]+).+} $chbr full chsh_Second
432 regexp {SOLID\t+: +([-0-9.+eE]+).+} $chbr full chso_Second
434 puts " CHECKSHAPE checking was NOT provided"
439 #Collect results of loop back test
442 set dat_check "DATA : OK"
443 set tpst_check "TPSTAT : OK"
444 set check_check "CHECKSHAPE : OK"
445 set nbsh_check "NBSHAPES : OK"
446 set ststh_check "STATSHAPE : OK"
447 set toler_check "TOLERANCE : OK"
448 set lbls_check "LABELS : OK"
449 set prps_check "PROPS : OK"
450 set clrs_check "COLORS : OK"
451 set lrs_check "LAYERS : OK"
453 if { $dcomp_First < $dcomp_Second || $dfal_First < $dfal_Second } {
454 set dat_check "DATA : Faulty"
455 append todo_msg $todo_mask $dat_check $end_line
457 if { $fal_First < $fal_Second || $war_First < $war_Second } {
459 set tpst_check "TPSTAT : Faulty"
460 append todo_msg $todo_mask $tpst_check $end_line
462 if { $chwi_First < $chwi_Second || $chfa_First < $chfa_Second || $chsh_First < $chsh_Second || $chso_First < $chso_Second } {
463 set check_check "CHECKSHAPE : Faulty"
464 append todo_msg $todo_mask $check_check $end_line
466 if { $so_First < $so_Second || $sh_First < $sh_Second || $fa_First < $fa_Second } {
467 set nbsh_check "NBSHAPES : Faulty"
468 append todo_msg $todo_mask $nbsh_check $end_line
470 if { $sol_First < $sol_Second || $she_First < $she_Second || $fac_First < $fac_Second || $fwir_First < $fwir_Second } {
471 set ststh_check "STATSHAPE : Faulty"
472 append todo_msg $todo_mask $ststh_check $end_line
475 if { ([expr 1.*($MaxTol_Second - $MaxTol_First)] > [expr 0.0001 * $MaxTol_First] && [expr 1. * abs($MaxTol_First-$MaxTol_Second)] > 0.0000001) || ($MaxTol_Second == 0 && $MaxTol_First > 0)} {
476 set toler_check "TOLERANCE : Faulty"
477 append todo_msg $todo_mask $toler_check $end_line
480 if { $nblev0_First != $nblev0_Second || $nblev1_First != $nblev1_Second || $nblev2_First != $nblev2_Second || $nblev_total_First != $nblev_total_Second || $nbshname_First != $nbshname_Second || $nbshcolor_First != $nbshcolor_Second || $nbshlayer_First != $nbshlayer_Second } {
481 set lbls_check "LABELS : Faulty"
482 append todo_msg $todo_mask $lbls_check $end_line
484 if { $nbcentroid_First != $nbcentroid_Second || $nbvolume_First != $nbvolume_Second || $nbarea_First != $nbarea_Second } {
485 set prps_check "PROPS : Faulty"
486 append todo_msg $todo_mask $prps_check $end_line
488 if { $nbcolor_First != $nbcolor_Second } {
489 set clrs_check "COLORS : Faulty"
490 append todo_msg $todo_mask $clrs_check $end_line
492 if { $nblayer_First != $nblayer_Second } {
493 set lrs_check "LAYERS : Faulty"
494 append todo_msg $todo_mask $lrs_check $end_line
501 append result [format "DATA : Faulties = %s ( %s ) Warnings = %s ( %s ) Summary = %s ( %s )\n" \
502 $dfal_Second $dfal_First $dwar_Second $dwar_First $dcomp_Second $dcomp_First ]
503 append result [format "TPSTAT : Faulties = %s ( %s ) Warnings = %s ( %s ) Summary = %s ( %s )\n" \
504 $fal_Second $fal_First $war_Second $war_First $comp_Second $comp_First ]
505 append result [format "CHECKSHAPE : Wires = %s ( %s ) Faces = %s ( %s ) Shells = %s ( %s ) Solids = %s ( %s )\n" \
506 $chwi_Second $chwi_First $chfa_Second $chfa_First $chsh_Second $chsh_First $chso_Second $chso_First ]
507 append result [format "NBSHAPES : Solid = %s ( %s ) Shell = %s ( %s ) Face = %s ( %s ) \n" \
508 $so_Second $so_First $sh_Second $sh_First $fa_Second $fa_First ]
509 append result [format "STATSHAPE : Solid = %s ( %s ) Shell = %s ( %s ) Face = %s ( %s ) FreeWire = %s ( %s ) \n" \
510 $sol_Second $sol_First $she_Second $she_First $fac_Second $fac_First $fwir_Second $fwir_First ]
511 append result [format "TOLERANCE : MaxTol = %14.10g ( %14.10g ) AvgTol = %14.10g ( %14.10g )\n" \
512 $MaxTol_Second $MaxTol_First $AvgTol_Second $AvgTol_First ]
513 append result [format "LABELS : N0Labels = %s ( %s ) N1Labels = %s ( %s ) N2Labels = %s ( %s ) TotalLabels = %s ( %s ) NameLabels = %s ( %s ) ColorLabels = %s ( %s ) LayerLabels = %s ( %s )\n" \
514 $nblev0_Second $nblev0_First $nblev1_Second $nblev1_First $nblev2_Second $nblev2_First $nblev_total_Second $nblev_total_First $nbshname_Second $nbshname_First $nbshcolor_Second $nbshcolor_First $nbshlayer_Second $nbshlayer_First ]
515 append result [format "PROPS : Centroid = %s ( %s ) Volume = %s ( %s ) Area = %s ( %s )\n" \
516 $nbcentroid_Second $nbcentroid_First $nbvolume_Second $nbvolume_First $nbarea_Second $nbarea_First ]
517 append result [format "NCOLORS : NColors = %s ( %s )\n" \
518 $nbcolor_Second $nbcolor_First ]
519 append result [format "COLORS : Colors = %s ( %s )\n" \
520 [lsort $colors_Second] [lsort $colors_First] ]
521 append result [format "NLAYERS : NLayers = %s ( %s )\n" \
522 $nblayer_Second $nblayer_First ]
523 append result [format "LAYERS : Layers = %s ( %s )\n" \
524 [lsort $layers_Second] [lsort $layers_First] ]
529 puts "########################### RESULTS ###############################"
531 puts "========================== Loop Back test ========================="
534 set err_msg "Error : Here is reading problem"
536 append todo_msg $todo_mask $err_msg $end_line
538 puts "File was read PROPERLY - OK"
541 set err_msg "Error : Here is writing problem"
543 append todo_msg $todo_mask $err_msg $end_line
545 puts "File was write PROPERLY - OK"
547 if {$mist_Second > 0 } {
548 set err_msg "Error : Here is reading problem for writing file"
550 append todo_msg $todo_mask $err_msg $end_line
552 puts "Writing file was read PROPERLY - OK"
565 if { $todo_msg != "" } {
574 set err_compare_ref ""
576 # Put reference data to the test script file if option "dump" is set
577 if { $dump_file == 1 } {
578 set fd_stream [open $dirname/$groupname/$gridname/$casename w]
579 puts $fd_stream "# !!!! This file is generated automatically, do not edit manually! See end script"
580 if { $todo_msg != "" } {
581 set ind [string first "differences" $todo_msg 0]
583 puts $fd_stream $todo_msg
588 if {[info exist LinuxFaulties] && [llength $LinuxFaulties] != 0} {
589 for {set i 0} { $i < [llength $LinuxFaulties] } { incr i } {
590 puts $fd_stream "$Mandriva_todo_mask [lindex $LinuxFaulties $i] : Faulty $end_line"
594 if {[info exist LinuxFaulties] && [llength $LinuxFaulties] != 0} {
595 puts $fd_stream "set LinuxFaulties \{$LinuxFaulties\}"
598 if {[info exist ProductMode] && $ProductMode == "OFF"} {
599 puts $fd_stream "set ProductMode OFF"
601 puts $fd_stream "set filename $filename"
604 puts $fd_stream "set ref_data \{"
605 puts $fd_stream $result
609 } elseif { $mist != 1 } {
610 puts "========================== Comparision with reference data ========"
612 # Comparision of reference data with obtained result
613 set ref_list [split $ref_data \n]
614 set cur_list [split $result \n]
615 set nb_ref [llength $ref_list]
616 set nb_cur [llength $cur_list]
617 for { set i 0 } { $i < $nb_cur } { incr i } {
619 set refstr [lindex $ref_list $j]
620 set curstr [lindex $cur_list $i]
624 if {[regexp "DATA :" $refstr]} {
626 set data_ref [split $refstr " "]
627 set data_cur [split $curstr " "]
628 set k_ref 1; set k_cur 1
629 for { set k 1 } { $k <= 2 } { incr k } {
630 while {[string is integer -strict [lindex $data_ref $k_ref]] == 0} {incr k_ref}
631 while {[string is integer -strict [lindex $data_cur $k_cur]] == 0} {incr k_cur}
632 set ref_number [lindex $data_ref $k_ref]
633 set cur_number [lindex $data_cur $k_cur]
636 if { $cur_number > $ref_number} {
641 if {[regexp "TPSTAT :" $refstr]} {
643 set data_ref [split $refstr " "]
644 set data_cur [split $curstr " "]
645 set k_ref 1; set k_cur 1
646 for { set k 1 } { $k <= 2 } { incr k } {
647 while {[string is integer -strict [lindex $data_ref $k_ref]] == 0} {incr k_ref}
648 while {[string is integer -strict [lindex $data_cur $k_cur]] == 0} {incr k_cur}
649 set ref_number [lindex $data_ref $k_ref]
650 set cur_number [lindex $data_cur $k_cur]
653 if { $cur_number > $ref_number} {
658 if {[regexp "CHECKSHAPE :" $refstr]} {
660 set data_ref [split $refstr " "]
661 set data_cur [split $curstr " "]
662 set k_ref 1; set k_cur 1
663 for { set k 1 } { $k <= 8 } { incr k } {
664 while {[string is integer -strict [lindex $data_ref $k_ref]] == 0} {incr k_ref}
665 while {[string is integer -strict [lindex $data_cur $k_cur]] == 0} {incr k_cur}
666 set ref_number [lindex $data_ref $k_ref]
667 set cur_number [lindex $data_cur $k_cur]
670 if { $cur_number > $ref_number} {
676 if {[regexp "TOLERANCE :" $refstr]} {
678 set data_ref [split $refstr " "]
679 set data_cur [split $curstr " "]
680 set k_ref 1; set k_cur 1
681 for { set k 1 } { $k <= 4 } { incr k } {
682 while {[string is double -strict [lindex $data_ref $k_ref]] == 0} {incr k_ref}
683 while {[string is double -strict [lindex $data_cur $k_cur]] == 0} {incr k_cur}
684 set ref_number [lindex $data_ref $k_ref]
685 set cur_number [lindex $data_cur $k_cur]
688 if { [expr 1. * ($cur_number-$ref_number)] > 0.0001 &&
689 [expr 1. * ($cur_number-$ref_number)] > [expr 0.01 * $ref_number]} {
697 if {$refstr != $curstr} {set isOK 0}
702 append err_compare_ref " Reference data - $refstr\n"
703 append err_compare_ref " Current data - $curstr\n"
704 append err_compare_ref "----------------------------------------------\n"
709 if { $dump_file != 0 } {
710 puts "Error : Running in regeneration mode, comparision was not performed!"
712 puts "Generation of test file $groupname/$gridname/$casename successful"
714 puts "Generation of reference data failed"
717 if { $ref_Compare > 0} {
718 puts "Error : $ref_Compare differences with reference data found :\n$err_compare_ref"
720 puts "Comparision of current result with reference data - OK\n"
724 puts "--------------------------------------------------------------------"
730 if { [info exists res_2] && [isdraw res_2] } {
739 checkview -screenshot -2d -path ${imagedir}/${test_image}.png
741 if { [catch { Close D_Second } catch_result] } {
742 puts "Error : cannot close a document D_Second"
747 puts "TEST COMPLETED"