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