0027146: Create command checkplatform
[occt.git] / tests / bugs / moddata_3 / bug25487_1
CommitLineData
150e93a7 1puts "========"
2puts "OCC25487"
3puts "========"
4puts ""
5##########################################
6# Extrema_GenExtPS needs to be optimized
7##########################################
8
9pload DATAEXCHANGEKERNEL
10
11# Restore testing shape and get timing characteristics for operation stepread
12dchrono perf_h reset
13dchrono perf_h start
14stepread [locate_data_file OCC25487_LP1.stp] a *
15dchrono perf_h stop
16
17# Get elapsed time for operation stepread
18set chrono_info [dchrono perf_h show]
19regexp {CPU user time: ([-0-9.+eE]+) seconds} $chrono_info full CPU_time
20puts "Elapsed time is: $CPU_time"
21
150e93a7 22# Check prformance on Windows
863f782a 23if { [checkplatform -windows] } {
150e93a7 24 if {[regexp {Debug mode} [dversion]]} {
25 # DEBUG mode
26 # initial CPU_time for WINDOWS in DEBUG mode is 410 ((186+19)*2) sec
27 puts "Checking WINDOWS performance in debug mode..."
28 if {$CPU_time > 410.} {
29 puts "ERROR: OCC25487 is reproduced."
30 puts " Low performance: $CPU_time (but should be less than 410 sec)"
31 } else {
32 puts "Done!"
33 }
34 } else {
35 # OPTIMIZE mode
36 # initial CPU_time for WINDOWS in OPTIMIZE mode is 205 (186+19) sec
37 puts "Checking WINDOWS performance in optimize mode..."
38 if {$CPU_time > 205.} {
39 puts "ERROR: OCC25487 is reproduced."
40 puts " Low performance: $CPU_time (but should be less than 205 sec)"
41 } else {
42 puts "Done!"
43 }
44 }
863f782a 45} else {
150e93a7 46 if {[regexp {Debug mode} [dversion]]} {
47 # DEBUG mode
e159a668 48 # initial CPU_time for LINUX in DEBUG mode is 900 sec
150e93a7 49 puts "Checking LINUX performance in debug mode..."
e159a668 50 if {$CPU_time > 900.} {
150e93a7 51 puts "ERROR: OCC25487 is reproduced."
e159a668 52 puts " Low performance: $CPU_time (but should be less than 900 sec)"
150e93a7 53 } else {
54 puts "Done!"
55 }
56 } else {
57 # OPTIMIZE mode
e159a668 58 # initial CPU_time for LINUX in OPTIMIZE mode is 190 (173+17) sec
150e93a7 59 puts "Checking LINUX performance in optimize mode..."
e159a668 60 if {$CPU_time > 190.} {
150e93a7 61 puts "ERROR: OCC25487 is reproduced."
e159a668 62 puts " Low performance: $CPU_time (but should be less than 190 sec)"
150e93a7 63 } else {
64 puts "Done!"
65 }
66 }
67}