-#set script_dir [file dirname [info script]]/script
-# if { [info exist WorkDirectory] == 0 } {
-# set WorkDirectory "/tmp"
-# if { [array get env TEMP] != "" } {
-# set WorkDirectory "$env(TEMP)"
-# }
-# }
+# On Windows with VC, in typical configuration gl2ps is built with Release
+# mode only which will fail in Debug mode; add TODO for that case in order
+# to handle it once for all tests that can use vexport command
+if { [regexp {Debug mode} [dversion]] } {
+ puts "TODO ?#23540 windows: Error: export of image.*failed"
+ puts "TODO ?#23540 windows: Error: The file has been exported.*different size \[(\]0 "
+}
- set j 0
- while { $mistake != 1 && $j <= 5 } {
- set position_x [expr ${x_start} + $j]
- set position_y [expr ${y_start} + $i]
- puts $position_x
- puts $position_y
- global color2d
- if { [info exists color2d] } {
- set color [ QAAISGetPixelColor2d ${position_x} ${position_y} ]
- } else {
- set color [ QAGetPixelColor ${position_x} ${position_y} ]
- }
- regexp {RED +: +([-0-9.+eE]+)} $color full rd
- regexp {GREEN +: +([-0-9.+eE]+)} $color full gr
- regexp {BLUE +: +([-0-9.+eE]+)} $color full bl
- set rd_int [expr int($rd * 1.e+05)]
- set gr_int [expr int($gr * 1.e+05)]
- set bl_int [expr int($bl * 1.e+05)]
-
- if { $rd_ch != 0 } {
- set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
- } else {
- set tol_rd $rd_int
- }
- if { $gr_ch != 0 } {
- set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
- } else {
- set tol_gr $gr_int
- }
- if { $bl_ch != 0 } {
- set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
- } else {
- set tol_bl $bl_int
- }
-
- if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
- puts "Warning : Point with true color was not found near default coordinates"
- set mistake 0
- } else {
- set mistake 1
- }
- incr j
- }
- incr i
+ set j 0
+ while { $mistake != 1 && $j <= 5 } {
+ set position_x [expr ${x_start} + $j]
+ set position_y [expr ${y_start} + $i]
+ puts $position_x
+ puts $position_y
+ global color2d
+ if { [info exists color2d] } {
+ set color [ QAAISGetPixelColor2d ${position_x} ${position_y} ]
+ } else {
+ set color [ QAGetPixelColor ${position_x} ${position_y} ]
+ }
+ regexp {RED +: +([-0-9.+eE]+)} $color full rd
+ regexp {GREEN +: +([-0-9.+eE]+)} $color full gr
+ regexp {BLUE +: +([-0-9.+eE]+)} $color full bl
+ set rd_int [expr int($rd * 1.e+05)]
+ set gr_int [expr int($gr * 1.e+05)]
+ set bl_int [expr int($bl * 1.e+05)]
+
+ if { $rd_ch != 0 } {
+ set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
+ } else {
+ set tol_rd $rd_int
+ }
+ if { $gr_ch != 0 } {
+ set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
+ } else {
+ set tol_gr $gr_int
+ }
+ if { $bl_ch != 0 } {
+ set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
+ } else {
+ set tol_bl $bl_int
+ }
+
+ if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
+ puts "Warning : Point with true color was not found near default coordinates"
+ set mistake 0
+ } else {
+ set mistake 1
+ }
+ incr j
+ }
+ incr i
- if { [info exists color2d] } {
- set color [ QAAISGetPixelColor2d ${coord_x} ${coord_y} ]
- } else {
- set color [ QAGetPixelColor ${coord_x} ${coord_y} ]
- }
+ if { [info exists color2d] } {
+ set color [ QAAISGetPixelColor2d ${coord_x} ${coord_y} ]
+ } else {
+ set color [ QAGetPixelColor ${coord_x} ${coord_y} ]
+ }
- set info [checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch]
- set stat [lindex $info end]
- if { ${stat} != 1 } {
- puts "Error : Colors are not equal in default coordinate and in the near coordinates too"
- return $stat
- } else {
- puts "Point with valid color was found"
- return $stat
- }
+ set info [checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch]
+ set stat [lindex $info end]
+ if { ${stat} != 1 } {
+ puts "Error : Colors are not equal in default coordinate and in the near coordinates too"
+ return $stat
+ } else {
+ puts "Point with valid color was found"
+ return $stat
+ }
puts "Checking trend: nb = $nbval, mean delta = $mean, sigma = $sigma"
# check if deviation is definitely too big
puts "Checking trend: nb = $nbval, mean delta = $mean, sigma = $sigma"
# check if deviation is definitely too big