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 Mandriva2010:"
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 all strings with warnings
108 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+W:} $tps_1]
109 # Extracting counts of warnings
110 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
111 # Calculating total number of warnings
112 foreach i $b {set war_First [expr $war_First + $i]}
113 set war_First [expr $war_First/4]
115 # Finding all strings with faulties
116 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+F:} $tps_1]
117 # Extracting counts of faulties
118 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
119 # Calculating total number of faulties
120 foreach i $b {set fal_First [expr $fal_First + $i]}
121 set fal_First [expr $fal_First/4]
122 # Calculating total number of faulties and warnings
123 set comp_First [expr $fal_First + $war_First]
127 puts " TPSTAT c checking was NOT provided"
130 # Get DECAF information about (color, layers and properties)
133 set xst [ XStat D_First ]
135 if { [llength $xst] > 0 } {
136 regexp {level +N +0 +: +([-0-9.+eE]+)} $xst full nblev0_First
137 regexp {level +N +1 +: +([-0-9.+eE]+)} $xst full nblev1_First
138 regexp {level +N +2 +: +([-0-9.+eE]+)} $xst full nblev2_First
139 regexp {Total +number +of +labels +for +shapes +in +the +document += +([-0-9.+eE]+)} $xst full nblev_total_First
140 regexp {Number +of +labels +with +name += +([-0-9.+eE]+)} $xst full nbshname_First
141 regexp {Number +of +labels +with +color +link += +([-0-9.+eE]+)} $xst full nbshcolor_First
142 regexp {Number +of +labels +with +layer +link += +([-0-9.+eE]+)} $xst full nbshlayer_First
143 regexp {Number +of +Centroid Props += +([-0-9.+eE]+)} $xst full nbcentroid_First
144 regexp {Number +of +Volume Props += +([-0-9.+eE]+)} $xst full nbvolume_First
145 regexp {Number +of +Area Props += +([-0-9.+eE]+)} $xst full nbarea_First
146 regexp {Number +of +colors += +([-0-9.+eE]+)} $xst full nbcolor_First
147 regexp {Number +of +colors += +[-0-9.+eE]+\n([^\n]*)} $xst full colors_First
148 regexp {Number +of +layers += +([-0-9.+eE]+)} $xst full nblayer_First
149 regexp {Number +of +layers += +[-0-9.+eE]+\n([^\n]*)} $xst full layers_First
151 puts " DECAF information was NOT provided"
154 # Get shape for standard analysis
156 if { [catch { XGetOneShape res_1 D_First } catch_result] } {
157 set err_msg "Error : First - cannot get shape from document - exception"
159 append todo_msg $todo_mask $err_msg $end_line
162 if { $mist < 1 && [info exists res_1] == 0 } {
163 set err_msg "Error : First - cannot read any relevant data from the file"
165 append todo_msg $todo_mask $err_msg $end_line
174 set tol [tolerance res_1]
176 if { [llength $tol] > 0 } {
177 regexp {Tolerance +MAX=([-0-9.+eE]+) +AVG=([-0-9.+eE]+) +MIN=[-0-9.+eE]+} $tol full MaxTol_First AvgTol_First
179 puts " TOLERANCE checking was NOT provided"
184 set tps_3 [ statshape res_1]
185 set col [llength $tps_3]
187 regexp {([-0-9.+eE]+)\t+ +EDGE \(Free\)} $tps_3 full fedg_First
188 regexp {([-0-9.+eE]+)\t+ +EDGE \(Shared\)} $tps_3 full sedg_First
189 regexp {([-0-9.+eE]+)\t+ +WIRE \(Free\)} $tps_3 full fwir_First
190 regexp {([-0-9.+eE]+)\t+ +FACE} $tps_3 full fac_First
191 regexp {([-0-9.+eE]+)\t+ +SHELL} $tps_3 full she_First
192 regexp {([-0-9.+eE]+)\t+ +SOLID} $tps_3 full sol_First
194 puts " STATSHAPE checking was NOT provided"
199 set nbs [ nbshapes res_1]
200 if { [llength ${nbs}] > 0 } {
201 regexp {FACE +: +([-0-9.+eE]+)} $nbs full fa_First
202 regexp {SHELL +: +([-0-9.+eE]+)} $nbs full sh_First
203 regexp {SOLID +: +([-0-9.+eE]+)} $nbs full so_First
204 regexp {COMPOUND +: +([-0-9.+eE]+)} $nbs full co_First
205 regexp {SHAPE +: +([-0-9.+eE]+)} $nbs full shpp_First
207 puts " NBSHAPES checking was NOT provided"
211 set chbr [checkshape res_1 ff]
212 if { [llength ${chbr}] > 0 } {
213 regexp {WIRE\t+: +([-0-9.+eE]+).+} $chbr full chwi_First
214 regexp {FACE\t+: +([-0-9.+eE]+).+} $chbr full chfa_First
215 regexp {SHELL\t+: +([-0-9.+eE]+).+} $chbr full chsh_First
216 regexp {SOLID\t+: +([-0-9.+eE]+).+} $chbr full chso_First
218 puts " CHECKSHAPE checking was NOT provided"
225 puts "-----------------------------WRITING FILE ------------------------------"
226 file delete $imagedir/${casename}_D_First$ext
227 if { [catch { $WriteCommand D_First $imagedir/${casename}_D_First$ext } catch_result] } {
228 set err_msg "Error: First - file was not written - exception"
230 append todo_msg $todo_mask $err_msg $end_line
235 if { [catch { $ReadCommand D_Second $imagedir/${casename}_D_First$ext } catch_result] } {
236 set err_msg "Errorr: Second - file was not read - exception"
238 append todo_msg $todo_mask $err_msg $end_line
242 catch {[file delete $imagedir/${casename}_D_First$ext]}
245 if { [catch { Close D_First } catch_result] } {
246 set err_msg "Error : cannot close a document D_First - exception"
248 append todo_msg $todo_mask $err_msg $end_line
253 if { $mist_w > 0 || $mist_Second > 0 } {
257 # Get information about translation
262 if { [llength $tps_2] > 0 } {
263 # Finding all strings with warnings
264 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+W:} $tps_2]
265 # Extracting counts of warnings
266 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
267 # Calculating total number of warnings
268 foreach i $b {set dwar_Second [expr $dwar_Second + $i]}
269 set dwar_Second [expr $dwar_Second/4]
271 # Finding all strings with faulties
272 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+F:} $tps_2]
273 # Extracting counts of faulties
274 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
275 # Calculating total number of faulties
276 foreach i $b {set dfal_Second [expr $dfal_Second + $i]}
277 set dfal_Second [expr $dfal_Second/4]
278 # Calculating total number of faulties and warnings
279 set dcomp_Second [expr $dfal_Second + $dwar_Second]
283 puts " DATA c checking was NOT provided"
289 set colvo [llength $tps_1]
290 if { ${colvo} > 0 } {
291 # Finding all strings with warnings
292 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+W:} $tps_1]
293 # Extracting counts of warnings
294 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
295 # Calculating total number of warnings
296 foreach i $b {set war_Second [expr $war_Second + $i]}
297 set war_Second [expr $war_Second/4]
299 # Finding all strings with faulties
300 set a [regexp -all -inline {[\t ]+([-0-9.+eE]+)[\t ]+F:} $tps_1]
301 # Extracting counts of faulties
302 set b [regexp -all -inline {([-0-9.+eE]+)} $a]
303 # Calculating total number of faulties
304 foreach i $b {set fal_Second [expr $fal_Second + $i]}
305 set fal_Second [expr $fal_Second/4]
306 # Calculating total number of faulties and warnings
307 set comp_Second [expr $fal_Second + $war_Second]
311 puts " TPSTAT c checking was NOT provided"
314 # Get DECAF information about (color, layers and properties)
317 set xst [ XStat D_Second ]
318 if { [llength $xst] > 0 } {
319 regexp {level +N +0 +: +([-0-9.+eE]+)} $xst full nblev0_Second
320 regexp {level +N +1 +: +([-0-9.+eE]+)} $xst full nblev1_Second
321 regexp {level +N +2 +: +([-0-9.+eE]+)} $xst full nblev2_Second
322 regexp {Total +number +of +labels +for +shapes +in +the +document += +([-0-9.+eE]+)} $xst full nblev_total_Second
323 regexp {Number +of +labels +with +name += +([-0-9.+eE]+)} $xst full nbshname_Second
324 regexp {Number +of +labels +with +color +link += +([-0-9.+eE]+)} $xst full nbshcolor_Second
325 regexp {Number +of +labels +with +layer +link += +([-0-9.+eE]+)} $xst full nbshlayer_Second
326 regexp {Number +of +Centroid Props += +([-0-9.+eE]+)} $xst full nbcentroid_Second
327 regexp {Number +of +Volume Props += +([-0-9.+eE]+)} $xst full nbvolume_Second
328 regexp {Number +of +Area Props += +([-0-9.+eE]+)} $xst full nbarea_Second
329 regexp {Number +of +colors += +([-0-9.+eE]+)} $xst full nbcolor_Second
330 regexp {Number +of +colors += +[-0-9.+eE]+\n([^\n]*)} $xst full colors_Second
331 regexp {Number +of +layers += +([-0-9.+eE]+)} $xst full nblayer_Second
332 regexp {Number +of +layers += +[-0-9.+eE]+\n([^\n]*)} $xst full layers_Second
334 puts " DECAF information was NOT provided"
336 # Get shape for standard analysis
338 if { [catch { XGetOneShape res_2 D_Second } catch_result] } {
339 set err_msg "Error : Second - cannot get shape from document - exception"
341 append todo_msg $todo_mask $err_msg $end_line
344 if { $mist < 1 && [info exists res_2] == 0 } {
345 set err_msg "Error : Second - cannot read any relevant data from the file"
347 append todo_msg $todo_mask $err_msg $end_line
357 set tol [tolerance res_2]
358 if { [llength $tol] > 0 } {
359 regexp {Tolerance +MAX=([-0-9.+eE]+) +AVG=([-0-9.+eE]+) +MIN=[-0-9.+eE]+} $tol full MaxTol_Second AvgTol_Second
361 puts " TOLERANCE checking was NOT provided"
366 set tps_3 [ statshape res_2]
367 set col [llength $tps_3]
369 regexp {([-0-9.+eE]+)\t+ +EDGE \(Free\)} $tps_3 full fedg_Second
370 regexp {([-0-9.+eE]+)\t+ +EDGE \(Shared\)} $tps_3 full sedg_Second
371 regexp {([-0-9.+eE]+)\t+ +WIRE \(Free\)} $tps_3 full fwir_Second
372 regexp {([-0-9.+eE]+)\t+ +FACE} $tps_3 full fac_Second
373 regexp {([-0-9.+eE]+)\t+ +SHELL} $tps_3 full she_Second
374 regexp {([-0-9.+eE]+)\t+ +SOLID} $tps_3 full sol_Second
376 puts " STATSHAPE checking was NOT provided"
381 set nbs [ nbshapes res_2]
382 if { [llength ${nbs}] > 0 } {
383 regexp {FACE +: +([-0-9.+eE]+)} $nbs full fa_Second
384 regexp {SHELL +: +([-0-9.+eE]+)} $nbs full sh_Second
385 regexp {SOLID +: +([-0-9.+eE]+)} $nbs full so_Second
386 regexp {COMPOUND +: +([-0-9.+eE]+)} $nbs full co_Second
387 regexp {SHAPE +: +([-0-9.+eE]+)} $nbs full shpp_Second
389 puts " NBSHAPES checking was NOT provided"
393 set chbr [checkshape res_2 ff]
394 if { [llength ${chbr}] > 0 } {
395 regexp {WIRE\t+: +([-0-9.+eE]+).+} $chbr full chwi_Second
396 regexp {FACE\t+: +([-0-9.+eE]+).+} $chbr full chfa_Second
397 regexp {SHELL\t+: +([-0-9.+eE]+).+} $chbr full chsh_Second
398 regexp {SOLID\t+: +([-0-9.+eE]+).+} $chbr full chso_Second
400 puts " CHECKSHAPE checking was NOT provided"
405 #Collect results of loop back test
408 set dat_check "DATA : OK"
409 set tpst_check "TPSTAT : OK"
410 set check_check "CHECKSHAPE : OK"
411 set nbsh_check "NBSHAPES : OK"
412 set ststh_check "STATSHAPE : OK"
413 set toler_check "TOLERANCE : OK"
414 set lbls_check "LABELS : OK"
415 set prps_check "PROPS : OK"
416 set clrs_check "COLORS : OK"
417 set lrs_check "LAYERS : OK"
419 if { $dcomp_First < $dcomp_Second || $dfal_First < $dfal_Second } {
420 set dat_check "DATA : Faulty"
421 append todo_msg $todo_mask $dat_check $end_line
423 if { $fal_First < $fal_Second || $war_First < $war_Second } {
425 set tpst_check "TPSTAT : Faulty"
426 append todo_msg $todo_mask $tpst_check $end_line
428 if { $chwi_First < $chwi_Second || $chfa_First < $chfa_Second || $chsh_First < $chsh_Second || $chso_First < $chso_Second } {
429 set check_check "CHECKSHAPE : Faulty"
430 append todo_msg $todo_mask $check_check $end_line
432 if { ($isIGES == 0 && $shpp_First > $shpp_Second) ||
433 ($isIGES == 1 && ($shpp_First - $co_First) > ($shpp_Second - $co_Second))} {
434 set nbsh_check "NBSHAPES : Faulty"
435 append todo_msg $todo_mask $nbsh_check $end_line
437 if { $sol_First < $sol_Second || $she_First < $she_Second || $fac_First < $fac_Second || $fwir_First < $fwir_Second || $fedg_First < $fedg_Second} {
438 set ststh_check "STATSHAPE : Faulty"
439 append todo_msg $todo_mask $ststh_check $end_line
442 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)} {
443 set toler_check "TOLERANCE : Faulty"
444 append todo_msg $todo_mask $toler_check $end_line
447 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 } {
448 set lbls_check "LABELS : Faulty"
449 append todo_msg $todo_mask $lbls_check $end_line
451 if { $nbcentroid_First != $nbcentroid_Second || $nbvolume_First != $nbvolume_Second || $nbarea_First != $nbarea_Second } {
452 set prps_check "PROPS : Faulty"
453 append todo_msg $todo_mask $prps_check $end_line
455 if { $nbcolor_First != $nbcolor_Second } {
456 set clrs_check "COLORS : Faulty"
457 append todo_msg $todo_mask $clrs_check $end_line
459 if { $nblayer_First != $nblayer_Second } {
460 set lrs_check "LAYERS : Faulty"
461 append todo_msg $todo_mask $lrs_check $end_line
468 append result [format "DATA : Faulties = %s ( %s ) Warnings = %s ( %s ) Summary = %s ( %s )\n" \
469 $dfal_Second $dfal_First $dwar_Second $dwar_First $dcomp_Second $dcomp_First ]
470 append result [format "TPSTAT : Faulties = %s ( %s ) Warnings = %s ( %s ) Summary = %s ( %s )\n" \
471 $fal_Second $fal_First $war_Second $war_First $comp_Second $comp_First ]
472 append result [format "CHECKSHAPE : Wires = %s ( %s ) Faces = %s ( %s ) Shells = %s ( %s ) Solids = %s ( %s )\n" \
473 $chwi_Second $chwi_First $chfa_Second $chfa_First $chsh_Second $chsh_First $chso_Second $chso_First ]
474 append result [format "NBSHAPES : Solid = %s ( %s ) Shell = %s ( %s ) Face = %s ( %s ) Summary = %s ( %s )\n" \
475 $so_Second $so_First $sh_Second $sh_First $fa_Second $fa_First $shpp_Second $shpp_First ]
476 append result [format "STATSHAPE : Solid = %s ( %s ) Shell = %s ( %s ) Face = %s ( %s ) FreeWire = %s ( %s ) FreeEdge = %s ( %s ) SharedEdge = %s ( %s )\n" \
477 $sol_Second $sol_First $she_Second $she_First $fac_Second $fac_First $fwir_Second $fwir_First $fedg_Second $fedg_First $sedg_Second $sedg_First ]
478 append result [format "TOLERANCE : MaxTol = %14.10g ( %14.10g ) AvgTol = %14.10g ( %14.10g )\n" \
479 $MaxTol_Second $MaxTol_First $AvgTol_Second $AvgTol_First ]
480 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" \
481 $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 ]
482 append result [format "PROPS : Centroid = %s ( %s ) Volume = %s ( %s ) Area = %s ( %s )\n" \
483 $nbcentroid_Second $nbcentroid_First $nbvolume_Second $nbvolume_First $nbarea_Second $nbarea_First ]
484 append result [format "NCOLORS : NColors = %s ( %s )\n" \
485 $nbcolor_Second $nbcolor_First ]
486 append result [format "COLORS : Colors = %s ( %s )\n" \
487 [lsort $colors_Second] [lsort $colors_First] ]
488 append result [format "NLAYERS : NLayers = %s ( %s )\n" \
489 $nblayer_Second $nblayer_First ]
490 append result [format "LAYERS : Layers = %s ( %s )\n" \
491 [lsort $layers_Second] [lsort $layers_First] ]
496 puts "########################### RESULTS ###############################"
498 puts "========================== Loop Back test ========================="
501 set err_msg "Error : Here is reading problem"
503 append todo_msg $todo_mask $err_msg $end_line
505 puts "File was read PROPERLY - OK"
508 set err_msg "Error : Here is writing problem"
510 append todo_msg $todo_mask $err_msg $end_line
512 puts "File was write PROPERLY - OK"
514 if {$mist_Second > 0 } {
515 set err_msg "Error : Here is reading problem for writing file"
517 append todo_msg $todo_mask $err_msg $end_line
519 puts "Writing file was read PROPERLY - OK"
532 if { $todo_msg != "" } {
541 set err_compare_ref ""
543 # Put reference data to the test script file if option "dump" is set
544 if { $dump_file == 1 } {
545 set fd_stream [open $dirname/$groupname/$gridname/$casename w]
546 puts $fd_stream "# !!!! This file is generated automatically, do not edit manually! See end script"
547 if { $todo_msg != "" } {
548 puts $fd_stream $todo_msg
551 if {[info exist LinuxFaulties] && [llength $LinuxFaulties] != 0} {
552 for {set i 0} { $i < [llength $LinuxFaulties] } { incr i } {
553 puts $fd_stream "$Mandriva_todo_mask [lindex $LinuxFaulties $i] : Faulty $end_line"
556 if {[info exist LinuxDiff] && $LinuxDiff != 0} {
557 puts $fd_stream "$Mandriva_todo_mask Error : $LinuxDiff differences with reference data found :$end_line"
560 if {[info exist LinuxDiff] && $LinuxDiff != 0} {
561 puts $fd_stream "set LinuxDiff $LinuxDiff"
564 if {[info exist LinuxFaulties] && [llength $LinuxFaulties] != 0} {
565 puts $fd_stream "set LinuxFaulties \{$LinuxFaulties\}"
568 if {[info exist ProductMode] && $ProductMode == "OFF"} {
569 puts $fd_stream "set ProductMode OFF"
571 puts $fd_stream "set filename $filename"
574 puts $fd_stream "set ref_data \{"
575 puts $fd_stream $result
579 } elseif { $mist != 1 } {
580 puts "========================== Comparision with reference data ========"
582 # Comparision of reference data with obtained result
583 set ref_list [split $ref_data \n]
584 set cur_list [split $result \n]
585 set nb_ref [llength $ref_list]
586 set nb_cur [llength $cur_list]
587 for { set i 0 } { $i < $nb_cur } { incr i } {
589 set refstr [lindex $ref_list $j]
590 set curstr [lindex $cur_list $i]
594 if {[regexp "DATA :" $refstr]} {
596 set data_ref [split $refstr " "]
597 set data_cur [split $curstr " "]
598 set k_ref 1; set k_cur 1
599 for { set k 1 } { $k <= 2 } { incr k } {
600 while {[string is integer -strict [lindex $data_ref $k_ref]] == 0} {incr k_ref}
601 while {[string is integer -strict [lindex $data_cur $k_cur]] == 0} {incr k_cur}
602 set ref_number [lindex $data_ref $k_ref]
603 set cur_number [lindex $data_cur $k_cur]
606 if { $cur_number > $ref_number} {
611 if {[regexp "TPSTAT :" $refstr]} {
613 set data_ref [split $refstr " "]
614 set data_cur [split $curstr " "]
615 set k_ref 1; set k_cur 1
616 for { set k 1 } { $k <= 2 } { incr k } {
617 while {[string is integer -strict [lindex $data_ref $k_ref]] == 0} {incr k_ref}
618 while {[string is integer -strict [lindex $data_cur $k_cur]] == 0} {incr k_cur}
619 set ref_number [lindex $data_ref $k_ref]
620 set cur_number [lindex $data_cur $k_cur]
623 if { $cur_number > $ref_number} {
628 if {[regexp "CHECKSHAPE :" $refstr]} {
630 set data_ref [split $refstr " "]
631 set data_cur [split $curstr " "]
632 set k_ref 1; set k_cur 1
633 for { set k 1 } { $k <= 8 } { incr k } {
634 while {[string is integer -strict [lindex $data_ref $k_ref]] == 0} {incr k_ref}
635 while {[string is integer -strict [lindex $data_cur $k_cur]] == 0} {incr k_cur}
636 set ref_number [lindex $data_ref $k_ref]
637 set cur_number [lindex $data_cur $k_cur]
640 if { $cur_number > $ref_number} {
646 if {[regexp "TOLERANCE :" $refstr]} {
648 set data_ref [split $refstr " "]
649 set data_cur [split $curstr " "]
650 set k_ref 1; set k_cur 1
651 for { set k 1 } { $k <= 4 } { incr k } {
652 while {[string is double -strict [lindex $data_ref $k_ref]] == 0} {incr k_ref}
653 while {[string is double -strict [lindex $data_cur $k_cur]] == 0} {incr k_cur}
654 set ref_number [lindex $data_ref $k_ref]
655 set cur_number [lindex $data_cur $k_cur]
658 if { [expr 1. * ($cur_number-$ref_number)] > 0.0001 &&
659 [expr 1. * ($cur_number-$ref_number)] > [expr 0.01 * $ref_number]} {
667 if {$refstr != $curstr} {set isOK 0}
672 append err_compare_ref " Reference data - $refstr\n"
673 append err_compare_ref " Current data - $curstr\n"
674 append err_compare_ref "----------------------------------------------\n"
679 if { $dump_file != 0 } {
680 puts "Error : Running in regeneration mode, comparision was not performed!"
682 puts "Generation of test file $groupname/$gridname/$casename successful"
684 puts "Generation of reference data failed"
687 if { $ref_Compare > 0} {
688 puts "Error : $ref_Compare differences with reference data found :\n$err_compare_ref"
690 puts "Comparision of current result with reference data - OK\n"
694 puts "--------------------------------------------------------------------"
700 if { [info exists res_2] && [isdraw res_2] } {
705 xwd $imagedir/${test_image}.png
707 if { [catch { Close D_Second } catch_result] } {
708 puts "Error : cannot close a document D_Second"
713 puts "TEST COMPLETED"