]> OCCT Git - occt-copy.git/commitdiff
0027146: Create command checkplatform
authorski <ski@opencascade.com>
Tue, 9 Feb 2016 14:31:17 +0000 (17:31 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 8 Apr 2016 08:42:00 +0000 (11:42 +0300)
Command checkplatform was created.
All test cases were updated.

Global variable os_type was eliminated.
New option -osx (MacOS) for procedure checkplatform was added.

36 files changed:
dox/dev_guides/tests/tests.md
src/DrawResources/CheckCommands.tcl
src/DrawResources/TestCommands.tcl
tests/3rdparty/export/A1
tests/bugs/caf/bug23071
tests/bugs/fclasses/bug23852
tests/bugs/fclasses/bug309
tests/bugs/modalg_2/bug426
tests/bugs/modalg_5/bug23906
tests/bugs/modalg_5/bug25019
tests/bugs/modalg_5/bug25413
tests/bugs/modalg_6/bug26447
tests/bugs/moddata_1/bug15519
tests/bugs/moddata_1/bug21292
tests/bugs/moddata_2/bug567
tests/bugs/moddata_3/bug25487_1
tests/bugs/moddata_3/bug25487_2
tests/bugs/vis/bug21091_3
tests/bugs/vis/bug21091_4
tests/bugs/vis/bug21091_5
tests/bugs/vis/bug21091_6
tests/bugs/vis/bug21091_8
tests/bugs/vis/bug21091_9
tests/bugs/vis/bug22188
tests/bugs/vis/bug232
tests/bugs/vis/bug26424
tests/bugs/xde/bug22898
tests/chamfer/data/complex/B9
tests/demo/draw/getsource
tests/mesh/data/standard/G1
tests/mesh/data/standard/U7
tests/perf/fclasses/bug24947
tests/perf/ncollection/A1
tests/perf/ncollection/A2
tests/perf/ncollection/A3
tests/xml/begin

index f5bcc3de198475f15221175d4d66dd55fb6e993e..1228480c20ba78b8fa60ae350022afd436c52ffa 100644 (file)
@@ -601,12 +601,12 @@ puts "TODO BugNumber ListOfPlatforms: RegularExpression"
 
 Here:
 * *BugNumber* is the bug ID in the tracker. For example: #12345.
-* *ListOfPlatforms* is a list of platforms, at which the bug is reproduced (Linux, Windows, MacOS, or All). Note that the platform name is custom for the OCCT test system; it corresponds to the value of environment variable *os_type* defined in DRAW.
+* *ListOfPlatforms* is a list of platforms, at which the bug is reproduced (Linux, Windows, MacOS, or All). Note that the platform name is custom for the OCCT test system; Use procedure *checkplatform* to get the platform name.
 
 Example:
 ~~~~~
-Draw[2]> puts $env(os_type)
-windows
+Draw[2]> checkplatform
+Windows
 ~~~~~
 
 * RegularExpression is a regular expression, which should be matched against the line indicating the problem in the script output. 
index a8c51e5d47693b150f3eb2a435f7ac0bf8d2bcf7..1caf323fc9c49c95281cdbb0905ee81932fbafb6 100644 (file)
@@ -1022,3 +1022,63 @@ proc checktrinfo {shape args} {
         puts "Error: Maximal deflection is too big"
     }
 }
+
+help checkplatform {
+  Return name of current platform if no options are given.
+
+  Use: checkplatform [options...]
+  Allowed options are:
+    -windows : return 1 if current platform is 'Windows', overwise return 0
+    -linux   : return 1 if current platform is 'Linux', overwise return 0
+    -osx     : return 1 if current platform is 'MacOS X', overwise return 0
+
+  Only one option can be used at once.
+  If no option is given, procedure will return the name of current platform.
+}
+proc checkplatform {args} {
+    set check_for_windows false
+    set check_for_linux false
+    set check_for_macosx false
+
+    set options {{"-windows" check_for_windows 0}
+                 {"-linux" check_for_linux 0}
+                 {"-osx" check_for_macosx 0}}
+
+    _check_args ${args} ${options} "checkplatform"
+
+    if { [regexp "indows" $::tcl_platform(os)] } {
+        set current_platform Windows
+    } elseif { $::tcl_platform(os) == "Linux" } {
+        set current_platform Linux
+    } elseif { $::tcl_platform(os) == "Darwin" } {
+        set current_platform MacOS
+    }
+
+    # no args are given
+    if { !${check_for_windows} && !${check_for_linux} && !${check_for_macosx}} {
+        return ${current_platform}
+    }
+
+    # check usage of proc checkplatform
+    if { [expr [string is true ${check_for_windows}] + [string is true ${check_for_linux}] + [string is true ${check_for_macosx}] ] > 1} {
+        error "Error: wrong usage of command checkplatform, only single option can be used at once"
+    }
+
+    # checking for Windows platform
+    if { ${check_for_windows} && ${current_platform} == "Windows" } {
+        return 1
+    }
+
+    # checking for Mac OS X platforms
+    if { ${check_for_linux} && ${current_platform} == "Linux" } {
+        return 1
+    }
+
+    # checking for Mac OS X platforms
+    if { ${check_for_macosx} && ${current_platform} == "MacOS" } {
+        return 1
+    }
+
+    # current platform is not equal to given as argument platform, return false
+    return 0
+}
index 62707dae6429da4f4620d6ed0626825d1bf153d7..c9ca2055e187e977a7e5fb07cbcacbbd3cee0cc4 100644 (file)
@@ -1182,7 +1182,7 @@ proc _check_log {dir group gridname casename errors log {_summary {}} {_html_log
             # check if line defines specific treatment of some messages
             if [regexp -nocase {^[ \s]*TODO ([^:]*):(.*)$} $line res platforms pattern] {
                 if { ! [regexp -nocase {\mAll\M} $platforms] && 
-                     ! [regexp -nocase "\\m$env(os_type)\\M" $platforms] } {
+                     ! [regexp -nocase "\\m[checkplatform]\\M" $platforms] } {
                     lappend html_log [_html_highlight IGNORE $line]
                     continue ;# TODO statement is for another platform
                 }
@@ -1206,7 +1206,7 @@ proc _check_log {dir group gridname casename errors log {_summary {}} {_html_log
             }
             if [regexp -nocase {^[ \s]*REQUIRED ([^:]*):[ \s]*(.*)$} $line res platforms pattern] {
                 if { ! [regexp -nocase {\mAll\M} $platforms] && 
-                     ! [regexp -nocase "\\m$env(os_type)\\M" $platforms] } {
+                     ! [regexp -nocase "\\m[checkplatform]\\M" $platforms] } {
                     lappend html_log [_html_highlight IGNORE $line]
                     continue ;# REQUIRED statement is for another platform
                 }
@@ -1742,21 +1742,6 @@ proc _log_xml_summary {logdir filename log include_cout} {
     return
 }
 
-# define custom platform name 
-proc _tests_platform_def {} {
-    global env tcl_platform
-
-    if [info exists env(os_type)] { return }
-    set env(os_type) $tcl_platform(platform)
-    if { $tcl_platform(os) == "Linux" } {
-        set env(os_type) Linux
-    }
-    if { $tcl_platform(os) == "Darwin" } {
-        set env(os_type) MacOS
-    } 
-}
-_tests_platform_def
-
 # Auxiliary procedure to split path specification (usually defined by
 # environment variable) into list of directories or files
 proc _split_path {pathspec} {
index a74e924225a6dc2a7b9e92dfa1ee28bb97d3d719..ef9023e0728eb963f628ce70174d98e04ebe2ef8 100755 (executable)
@@ -18,9 +18,8 @@ set aFile $imagedir/shape.pdf
 
 set format PDF
 
-
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
-  set size 144401
-} else {
+if { [checkplatform -windows] } {
   set size 154489
+} else {
+  set size 144401
 }
index 92ee70358f7a020f0128ed7b8c45aa85c0f17147..3d2bc9e679be2ba342525abb60638482d5798c49 100755 (executable)
@@ -49,7 +49,7 @@ if [catch {SaveAs D ${FileName} }] {
     puts "There is not ${FileName2} file"
     #
     
-    if { [string compare $tcl_platform(platform) "windows"] == 0 } {
+    if { [checkplatform -windows] } {
       puts "OS = Windows NT"
       set status 1
     }
@@ -61,7 +61,7 @@ if [catch {SaveAs D ${FileName} }] {
   } else {
     puts "There is not ${FileName3} file"
     #
-    if { [string compare $tcl_platform(platform) "windows"] == 0 } {
+    if { [checkplatform -windows] } {
       puts "OS = Windows NT"
     } else {
       puts "OS = Unix"
index e01538dda6e3a66b0b558e3514ed479566cc9fce..075f8ca9eb7602efcc9101f6136b28eebfec5833 100755 (executable)
@@ -10,10 +10,7 @@ pload DCAF
 
 set BugNumber OCC23852
 
-set OS_platform $tcl_platform(platform)
-puts "OS = ${OS_platform}"
-
-if { [string compare ${OS_platform} "windows"] == 0 } {
+if { [checkplatform -windows] } {
 
    # Windows, #1
    set OSD_Path "\\\\Server\\Shared\\Folder\\File.Extension"
@@ -51,9 +48,7 @@ if { [string compare ${OS_platform} "windows"] == 0 } {
       puts "${BugNumber}, Extension, #2: Error"
    }
 
-}
-
-if { [string compare ${OS_platform} "unix"] == 0 } {
+} else {
    # Linux
    set OSD_Path "//Server/Shared/Folder/File.Extension"
    puts "OSD_Path = ${OSD_Path}"
index ef76f4d259eb52bd2ba96f8e82a3333666fa3fd0..201a2034f2be6b763a759f674e95e7939ad37e0b 100644 (file)
@@ -19,14 +19,14 @@ if { ${ll} != 2 } {
     set result2 [lindex ${result} 1]
     set CurrentDirectory [pwd]
     set UpTrek "[file join [file dirname [file dirname ${CurrentDirectory}]] [file tail ${CurrentDirectory}]]"
-    if { [string compare $tcl_platform(platform) "windows"] != 0} {
-      set res1 [ string range $result1 1 [expr [string length $result1] -3 ] ]
-      set res2 [ string range $result2 1 [expr [string length $result2] -3 ] ]
-    } else {
+    if { [checkplatform -windows] } {
       set res1 [ string range $result1 3 [expr [string length $result1] -2 ] ]
       set res2 [ string range $result2 3 [expr [string length $result2] -2 ] ]
       set CurrentDirectory [ string range $CurrentDirectory 2 [expr [string length $CurrentDirectory] -1 ]]
       set UpTrek [ string range $UpTrek 2 [expr [string length $UpTrek] -1 ]]
+    } else {
+      set res1 [ string range $result1 1 [expr [string length $result1] -3 ] ]
+      set res2 [ string range $result2 1 [expr [string length $result2] -3 ] ]
     }
     if {[string compare ${res1} "${CurrentDirectory}"] == 0} {
       puts "OCC309: OK 1"
index d5bc921d82cc1c494af356e387f2c2e2a901ea64..beb76b362cf4b295fcd23198671fcd214aeacb71 100755 (executable)
@@ -1,5 +1,4 @@
-set env(os_type) $tcl_platform(platform)
-if {[string compare $env(os_type) "windows"] != 0 } {
+if { ![checkplatform -windows] } {
     puts "TODO ?OCC12345 MacOS: \\*\\* Exception"
     puts "TODO ?OCC12345 MacOS: An exception was caught"
     puts "TODO ?OCC12345 MacOS: TEST INCOMPLETE"
index f1e2dd7d975b242a6be74a00b82639c4b56962bd..27878e75d0229e39e112bffe7271c2fbf96f13c6 100755 (executable)
@@ -20,7 +20,7 @@ set q2 [dchrono h show]
 
 regexp {CPU user time: ([-0-9.+eE]+) seconds} $q2 full z
 puts "$z"
-if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
+if { [checkplatform -windows] }  {
    puts "OS = Windows NT"
    set max_time 0.5
 } else {
index 53c9d0b51fd1e749f40a05af7cb55b6664c8be79..103d78d3bee56fe43412667f372ac5a064d42ab9 100755 (executable)
@@ -30,7 +30,7 @@ set q2 [dchrono h2 show]
 #
 regexp {CPU user time: ([-0-9.+eE]+) seconds} $q1 full t1
 puts "$t1"
-if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
+if { [checkplatform -windows] }  {
    puts "OS = Windows NT"
    set max_time1 20
 } else {
@@ -46,7 +46,7 @@ if { $t1 > ${max_time1} } {
 #
 regexp {CPU user time: ([-0-9.+eE]+) seconds} $q2 full t2
 puts "$t2"
-if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
+if { [checkplatform -windows] }  {
    puts "OS = Windows NT"
    set max_time2 20
 } else {
index afb3ba95c8457a4e4a35dbcca1f50d18747c1b25..e87037cecda3eeae09890726602ea64aa1f40162 100644 (file)
@@ -20,8 +20,7 @@ set chrono_info [dchrono perf_h show]
 regexp {CPU user time: ([-0-9.+eE]+) seconds} $chrono_info full CPU_time
 puts "Elapsed time is: $CPU_time"
 
-set currentOS $tcl_platform(os)
-if {[string compare $currentOS "Windows NT"] == 0} {
+if { [checkplatform -windows] } {
   if {[regexp {Debug mode} [dversion]]} {
     # initial CPU_time for WINDOWS in DEBUG mode is 90 sec
     puts "Checking WINDOWS performance in debug mode..."
@@ -41,8 +40,7 @@ if {[string compare $currentOS "Windows NT"] == 0} {
       puts "Done!"
     }
   }
-}
-if {[string compare $currentOS "Linux"] == 0} {
+} else {
   if {[regexp {Debug mode} [dversion]]} {
     # initial CPU_time for LINUX in DEBUG mode is 90 sec
     puts "Checking LINUX performance in debug mode..."
index 8aae157bbfb94f4504bb3ca9222a9decbec71625..34e49d3b6bbf92c465fa7873bece01e5d46b958d 100644 (file)
@@ -19,7 +19,7 @@ for {set i 1} {$i <= 1000} {incr i} {
 }
 
 dchrono cr stop
-if { [string compare $tcl_platform(platform) "windows"] == 0 } {
+if { [checkplatform -windows] } {
   set max_time 7.5
 } else {
   set max_time 4.5
index a542c69b423a8edcaeaeb53c1cb4e98644eb80f7..b69856f6ca7fb29a3a675950c4167073e59545f0 100755 (executable)
@@ -18,7 +18,7 @@ tclean result
 set Deflection 1.
 catch {incmesh result ${Deflection} }
 
-if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
+if { [checkplatform -windows] }  {
    set good_tri  96265
    set good_nod  71339
    set good_defl 27.956052399907215
index f4174c56a1800259e4f57283c6348628be40673c..02a0ece69d12dd7017167d36f07d6293e7697942 100755 (executable)
@@ -33,7 +33,7 @@ puts "CPU_user_time=${CPU_user_time}"
 checkprops result -s 1.40193e+07
 checknbshapes result -vertex 372 -edge 369 -wire 2 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 1 -shape 745
 
-if {[string compare $tcl_platform(platform) "windows"] == 0} {
+if { [checkplatform -windows] } {
    puts "windows"
    set Good_CPU_user_time 0.
 } else {
index 66d877826a646a8db86ca6745f92756a3a0c9dd8..cb44a2561f0e2ed152c40cf9d88914fdeb44cd9a 100755 (executable)
@@ -12,7 +12,7 @@ puts ""
 restore [locate_data_file OCC567a.draw] s1 
 restore [locate_data_file OCC567b.draw] s2 
 
-if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
+if { [checkplatform -windows] }  {
    puts "OS = Windows NT"
    set N_repeat 10
 } else {
index 8d7fa1feac7a32a2d3a08a4c4cfc25ac72338ae6..57fa4f33db7cfbdaf0c5c3c1c2dcbffcb09a3ea2 100644 (file)
@@ -19,11 +19,8 @@ set chrono_info [dchrono perf_h show]
 regexp {CPU user time: ([-0-9.+eE]+) seconds} $chrono_info full CPU_time
 puts "Elapsed time is: $CPU_time"
 
-# Check current OS
-set currentOS $tcl_platform(os)
-
 # Check prformance on Windows
-if {[string compare $currentOS "Windows NT"] == 0} {
+if { [checkplatform -windows] } {
   if {[regexp {Debug mode} [dversion]]} {
     # DEBUG mode
     # initial CPU_time for WINDOWS in DEBUG mode is 410 ((186+19)*2) sec
@@ -45,10 +42,7 @@ if {[string compare $currentOS "Windows NT"] == 0} {
       puts "Done!"
     }
   }
-}
-
-# Check performance on Linux
-if {[string compare $currentOS "Linux"] == 0} {
+} else {
   if {[regexp {Debug mode} [dversion]]} {
     # DEBUG mode
     # initial CPU_time for LINUX in DEBUG mode is 900 sec
index c4bc26e3fb0b20f75cbf7045a5d0a1763095f649..17b300f55dd5f44b5700e677b1862f0d7efe445b 100644 (file)
@@ -21,11 +21,8 @@ set chrono_info [dchrono perf_h show]
 regexp {CPU user time: ([-0-9.+eE]+) seconds} $chrono_info full CPU_time
 puts "Elapsed time is: $CPU_time"
 
-# Check current OS
-set currentOS $tcl_platform(os)
-
 # Check prformance on Windows
-if {[string compare $currentOS "Windows NT"] == 0} {
+if { [checkplatform -windows] } {
   if {[regexp {Debug mode} [dversion]]} {
     # DEBUG mode
     # initial CPU_time for WINDOWS in DEBUG mode is 1208 ((549+55)*2) sec
@@ -47,10 +44,7 @@ if {[string compare $currentOS "Windows NT"] == 0} {
       puts "Done!"
     }
   }
-}
-
-# Check performance on Linux
-if {[string compare $currentOS "Linux"] == 0} {
+} else {
   if {[regexp {Debug mode} [dversion]]} {
     # DEBUG mode
     # initial CPU_time for LINUX in DEBUG mode is 1500 sec
index dbfa696b48241b0c78f2776ef3e9f407b57a0b0e..b5dac67b8035f07cc6cedd1f4478d7c82ec41ccb 100755 (executable)
@@ -22,10 +22,10 @@ set aFile ${imagedir}/${test_image}.pdf
 
 vexport ${aFile} PDF
 
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
-   set refsize 144401
-} else {
+if { [checkplatform -windows] } {
    set refsize 153993
+} else {
+   set refsize 144401
 }
 
 if { [file exists ${aFile}] } {
index bbe04d2ffb38cfe603008488b1565d2e24f13ffb..8c51d4d45ccd92816cd226d43b1e66b274302d69 100755 (executable)
@@ -47,10 +47,10 @@ set aFile ${imagedir}/${test_image}.pdf
 
 vexport ${aFile} PDF
 
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
-   set refsize 10107
-} else {
+if { [checkplatform -windows] } {
    set refsize 10131
+} else {
+   set refsize 10107
 }
 
 if { [file exists ${aFile}] } {
index 71dba90a8669339791564781f4ce9845b7b7423b..ec1974cdc845f443723e44a041f091ee43b08887 100755 (executable)
@@ -47,10 +47,10 @@ set aFile ${imagedir}/${test_image}.ps
 
 vexport ${aFile} PS
 
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
-   set refsize 10386
-} else {
+if { [checkplatform -windows] } {
    set refsize 10410
+} else {
+   set refsize 10386
 }
 
 if { [file exists ${aFile}] } {
index 03718a45689afee04cc67de936b8427285ff5e1e..904238a81094be07a17ed5f2d6300e2bea94ded1 100755 (executable)
@@ -46,10 +46,10 @@ set aFile ${imagedir}/${test_image}.eps
 
 vexport ${aFile} EPS
 
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
-   set refsize 10330
-} else {
+if { [checkplatform -windows] } {
    set refsize 10354
+} else {
+   set refsize 10330
 }
 
 if { [file exists ${aFile}] } {
index a9d91b7dc1af05f0ebcd6affd2d841cb3261d879..d22829d02eb248e3467e562335e6a1072cbc90b6 100755 (executable)
@@ -47,10 +47,10 @@ set aFile ${imagedir}/${test_image}.svg
 
 vexport ${aFile} SVG
 
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
-   set refsize 14207
-} else {
+if { [checkplatform -windows] } {
    set refsize 14091
+} else {
+   set refsize 14207
 }
 
 if { [file exists ${aFile}] } {
index 3b41b1cb412f018e7aa5949590e9826d00654d99..8eb7ddc38a43c0600795cfeacaf560e2c12089e5 100755 (executable)
@@ -47,10 +47,10 @@ set aFile ${imagedir}/${test_image}.pgf
 
 vexport ${aFile} PGF
 
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
-   set refsize 20438
-} else {
+if { [checkplatform -windows] } {
    set refsize 20810
+} else {
+   set refsize 20438
 }
 
 if { [file exists ${aFile}] } {
index 3fded74fdc33048994703f09594002ac03fd417d..88768391d4334a627b5193a35257969cd363be90 100755 (executable)
@@ -20,10 +20,10 @@ vdisplay result
 vsetdispmode 1
 vfit
 
-if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
-   set good_tri  6114
-   set good_nod  3080
-   set good_defl 0.50050406431775729
+if { [checkplatform -windows] }  {
+    set good_tri  6114
+    set good_nod  3080
+    set good_defl 0.50050406431775729
 } else {
     set good_tri  6148
     set good_nod  3097
index ff58877512451aa46c7e944b33469dff607f387a..927850cebeac13c0cc858bf325606416165289e3 100755 (executable)
@@ -61,8 +61,7 @@ set result23 [regexp "$Yellow" [vreadpixel $x4 $y4 rgb]]
 set result24 [regexp "$Yellow" [vreadpixel $x5 $y5 rgb]]
 set result25 [regexp "$Yellow" [vreadpixel $x6 $y6 rgb]]
 
-set env(os_type) $tcl_platform(platform)
-if { [string compare $env(os_type) "windows"] != 0 } {
+if { ![checkplatform -windows] } {
   set result31 [regexp "$Cyan" [vreadpixel $x2 $y2 rgb]]
   if { $result31 == 0 } {
     set IsFaulty 1
index 97ecdb01cb92a14ad468441c7e5ae59d792511c8..cb51865a215d4d38f099bb1ef2e235436135536a 100644 (file)
@@ -12,15 +12,12 @@ vclear
 vaxo
 vzbufftrihedron
 
-if { [array get env os_type] != "" } {
-   set os $env(os_type)
-}
-if { [string compare $os "windows"] != 0 } {
-  # Linux platform
-  set ok_color "GRAY85"
-} else {
+if { [checkplatform -windows] } {
   # Windows platform
   set ok_color "GRAY52"
+} else {
+  # Linux platform
+  set ok_color "GRAY85"
 }
 
 set bug_info [vreadpixel 71 350 rgb name]
index b1972c96ffebb87b8302f0e3b83e0a404ade6948..e6bbf4ff0815b0ba1bd20f67c9bfd78776cfe54e 100644 (file)
@@ -4,8 +4,7 @@ puts "TODO OCC24156 MacOS: Error: unsupported locale specification"
 # Just run multiple conversions of the shape to and from diferent formats and 
 # check that the result is good shape with expected area
 
-set anOS $tcl_platform(os)
-if { ${anOS} == "Linux" } {
+if { [checkplatform -linux] } {
   dlocale LC_ALL fr_FR
 } else {
   dlocale LC_ALL French
index 3ce8ce73f5f3cab3499a7cb223d30780df8c4cbf..b1b295ff8655a3c4fcb57af468158d09b106c8dc 100644 (file)
@@ -7,10 +7,9 @@ dset SCALE 100
 if { [string compare $command chamf_sequence] == 0 } {
   puts "TODO #22909 ALL: Error: The tests should be reviewed"
   puts "Error: The tests should be reviewed."
-  set env(os_type) $tcl_platform(platform)
   
   set nf 0
-  if { [string compare ${env(os_type)} "windows"] != 0 } {
+  if { ![checkplatform -windows] } {
     if { [string compare $group dist_dist] == 0 } {
       set nf 2
     } elseif { [string compare $group equal_dist] == 0 } {
@@ -18,13 +17,13 @@ if { [string compare $command chamf_sequence] == 0 } {
     }
   }
   
-  if { [string compare ${env(os_type)} "windows"] == 0} {
+  if { [checkplatform -windows] } {
     if {[string compare $group dist_dist] == 0 || [string compare $group equal_dist] == 0 } {
       set nf 2
     }
   }
 
-  if { [string compare ${env(os_type)} "MacOS"] == 0 } {
+  if { [checkplatform -osx] } {
     if { [string compare $group dist_dist] == 0 } {
       puts "TODO OCC24156 MacOS: chamfer is not done. compute of chamfer failed"
       set nf 8
@@ -39,7 +38,7 @@ if { [string compare $command chamf_sequence] == 0 } {
   }  
 
   if { $nf != 0 } {
-     #puts "TODO OCC22909 $env(os_type):Faulty shapes in variables faulty_1 to faulty_$nf"
+     #puts "TODO OCC22909 [checkplatform]:Faulty shapes in variables faulty_1 to faulty_$nf"
      puts "TODO OCC22909 ALL:Faulty shapes in variables faulty_1 to faulty_"
   }
 }
index 49cd13ac9bd2267b36406a412f6e6b7a46f6152d..9282696b404864d0ba23782f50efd61f58abea44 100755 (executable)
@@ -1,8 +1,7 @@
 # test for command getsource
 
 # check that path returned for command pload is as expected
-set env(os_type) $tcl_platform(platform)
-if { [string compare $env(os_type) "windows"] == 0 } {
+if { [checkplatform -windows] } {
     set expected src/Draw/Draw_PloadCommands.cxx
 } else {
     set expected /src/Draw/Draw_PloadCommands.cxx
index 5d66d3bbcf79f118993d0ba90c6e4fcb27106bd0..974d1636229e063f94f1bd96fd3d1c393dc9d3fa 100755 (executable)
@@ -1,5 +1,4 @@
 set TheFileName shading_055.brep
-set env(os_type) $tcl_platform(os)
 if { [string compare $command "shading"] == 0 } {
    set nb 62
 }
@@ -11,4 +10,4 @@ if { [string compare $command "mesh"] == 0 } {
 }
 
 set bug_cross "OCC22687"
-set nbcross($env(os_type)) $nb
+set nbcross([checkplatform]) $nb
index 4d8af619171b491f778298f226af81a7785e0a5c..00637a9fd601c6706914433ebbe47ef9304aacd3 100755 (executable)
@@ -10,16 +10,16 @@ if { [string compare $command "shading"] == 0 } {
   set nbt 8
   set nbl 8
   set nbn 83
-  set nbwithouttri($env(os_type)) $nbt
-  set nbfree($env(os_type)) $nbl
-  set nbfreenodes($env(os_type)) $nbn
+  set nbwithouttri([checkplatform]) $nbt
+  set nbfree([checkplatform]) $nbl
+  set nbfreenodes([checkplatform]) $nbn
 } else {
   set bug_withouttri "OCC23105"
 ##set nbt 14
   set nbt 8
   set nbn 60
   set nbl 12
-  set nbwithouttri($env(os_type)) $nbt
-  set nbfree($env(os_type)) $nbl
-  set nbfreenodes($env(os_type)) $nbn
+  set nbwithouttri([checkplatform]) $nbt
+  set nbfree([checkplatform]) $nbl
+  set nbfreenodes([checkplatform]) $nbn
 }
index d7288cec5e99605dec39bd2ba98aaa1266541356..39bb04bee2bbf98a9e2151d48b589476b6bb1615 100644 (file)
@@ -2,7 +2,7 @@
 
 set libname TKSTEP
 
-switch -nocase $env(os_type) {
+switch -nocase [checkplatform] {
   windows {set libname    ${libname}.dll}
   linux   {set libname lib${libname}.so}
   macos   {set libname lib${libname}.dylib}
index 18acdf6b15a0ca2df8868c57c8a6e117c4fc0d21..9c5092447355917862fec58aea67a3d58aa32764 100644 (file)
@@ -17,18 +17,7 @@ foreach line [split $info "\n"] {
 }
 lappend values "$diff_cl"
 
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
-  set check_values  { 1.2363286058767904
-                      2.7537414143534
-                      1.5596260162601621
-                      3.937043746844462
-                      1.2133020329576465
-                      1.2164522569168656
-                      1.2495457282327385
-                      0.10352433841051313
-                      0.45175659293697572
-                    }
-} else {
+if { [checkplatform -windows] } {
   set check_values  { 1.383409071179103
                       5.1472531605899908
                       5.55719377028335395
@@ -40,18 +29,30 @@ if { [string compare $tcl_platform(platform) "windows"] != 0 } {
                       0.21983563611646603
                     }
   if { [regexp {64} [dversion]] } {
-   set check_values  { 1.5
-                      5.2
-                      5.7
-                      5.7
-                      1.7
-                      1.3
-                      1.6
-                      0.4
-                      0.4
+    set check_values  { 1.5
+                        5.2
+                        5.7
+                        5.7
+                        1.7
+                        1.3
+                        1.6
+                        0.4
+                        0.4
+                      }
+    }
+} else {
+  set check_values  { 1.2363286058767904
+                      2.7537414143534
+                      1.5596260162601621
+                      3.937043746844462
+                      1.2133020329576465
+                      1.2164522569168656
+                      1.2495457282327385
+                      0.10352433841051313
+                      0.45175659293697572
                     }
- }
 }
+
 set index 0
 foreach key $keys {
   set value [lindex $values $index]
index e7286d00351e2462138b591ccabe1ce724591f35..98bd0c69155c26687334c8ef2701d4014c22264d 100644 (file)
@@ -15,18 +15,18 @@ foreach line [split $info "\n"] {
   }
 }
 
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
-  set check_values  { 0.1540285
-                      0.1286995
-                      0.1607561
-                      0.3624441
-                    }
-} else {
+if { [checkplatform -windows] } {
   set check_values  { 0.018136771
                       0.008694706
                       0.019123649
                       0.784462745
                     }
+} else {
+  set check_values  { 0.1540285
+                      0.1286995
+                      0.1607561
+                      0.3624441
+                    }
 }
 
 set index 0
index 8847bad490f02d2fdf6c90de703e54db136d7075..fb45495fa31225fb8e920830844d12d2f89b7385 100644 (file)
@@ -15,18 +15,18 @@ foreach line [split $info "\n"] {
   }
 }
 
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
-  set check_values  { 0.1549615
-                      0.1290805
-                      0.1602191
-                      0.3487175
-                    }
-} else {
+if { [checkplatform -windows] } {
   set check_values  { 0.017762852
                       0.008435507
                       0.018746851
                       0.079263713
                     }
+} else {
+  set check_values  { 0.1549615
+                      0.1290805
+                      0.1602191
+                      0.3487175
+                    }
 }
 
 set index 0
index 840942ae81d68561fbd1f50d3a5e3f059f61f3f9..476f0676af3add15c1e68b199ffdd80605c3c614 100755 (executable)
@@ -22,12 +22,11 @@ if { [info exists test_image ] == 0 } {
 
 set WorkDirectory $imagedir
 
-set env(os_type) $tcl_platform(platform)
-if { [regexp "indows" $env(os_type)] } {
+if { [checkplatform -windows] } {
     if {[regexp -nocase {jdk} $env(PATH)] || [regexp -nocase {java} $env(PATH)]} {
-       set Java "java"
+        set Java "java"
     } else {
-       puts "Warning: environment variable PATH doesn't contain path to Java"
+        puts "Warning: environment variable PATH doesn't contain path to Java"
     }
 } else {
     catch {set Java $env(JAVAHOME)/bin/java}