@ -48,7 +48,7 @@ class TC_PerformanceTests < Test::Unit::TestCase
$path = string = ` echo $PATH `
def print_debug ( msg )
message = " [INFO] #{ msg } \n "
message = " [INFO] [#{ Time . now . to_f } ] #{ msg } \n "
puts message
end
@ -111,7 +111,7 @@ class TC_PerformanceTests < Test::Unit::TestCase
options = { }
# Set a banner, displayed at the top
# of the help screen.
opts . banner = " Usage: get-coordinates .rb [options] "
opts . banner = " Usage: test-perf .rb [options] "
options [ :application ] = nil
opts . on ( '-a' , '--application APP' , 'Application name in application grid' ) do | app |
@ -201,10 +201,12 @@ class TC_PerformanceTests < Test::Unit::TestCase
system " mcetool --set-inhibit-mode=stay-on "
end
print_debug ( " restart mthome " )
system ( " initctl restart xsession/mthome " )
print_debug ( " stop applifed " )
system ( " initctl stop xsession/applifed " )
#print_debug("restart mthome")
#system("initctl restart xsession/mthome")
#applifed stop/start moved test xml
#print_debug("stop applifed")
#system("initctl stop xsession/applifed")
print_debug ( " move #{ MATTI_LOCATION } to #{ TEMPORARY_MATTI_LOCATION } " )
system " mv #{ MATTI_LOCATION } #{ TEMPORARY_MATTI_LOCATION } "
@ -227,39 +229,39 @@ class TC_PerformanceTests < Test::Unit::TestCase
end
# method called after any test case for cleanup purposes
def teardown
print_debug ( " exit from teardown " )
print_debug ( " move #{ TEMPORARY_MATTI_LOCATION } to #{ MATTI_LOCATION } " )
system " mv #{ TEMPORARY_MATTI_LOCATION } #{ MATTI_LOCATION } "
if @options [ :application ] != nil
print_debug ( " restart mthome " )
system ( " initctl restart xsession/mthome " )
sleep ( 10 )
end
if not system " pgrep applauncherd "
system ( " initctl start xsession/applauncherd " )
end
if not system " pgrep applifed "
system ( " initctl start xsession/applifed " )
#if @options[:application] != nil
# print_debug("restart mthome")
# system("initctl restart xsession/mthome")
# sleep(10)
#end
#if not system "pgrep applauncherd"
# system("initctl start xsession/applauncherd")
#end
#applifed stop/start moved test xml
#if not system "pgrep applifed"
# system("initctl start xsession/applifed")
#applifed start causes booster-m to be used to prestart applications.
#Camera has the least priority and the last one to be prestarted.Hence
# W e wait for the camera to be up and running so that any more booster-m is not used up
wait_for_app ( 'camera-ui' )
end
wait_for_app ( 'applauncherd' )
wait_for_app ( 'booster-q' )
wait_for_app ( 'booster-e' )
wait_for_app ( 'booster-d' )
wait_for_app ( 'booster-m' )
# camera has the least priority and the last one to be prestarted.h ence
# w e wait for the camera to be up and running so that any more booster-m is not used up
# wait_for_app('camera-ui')
# end
#wait_for_app('applauncherd')
#wait_for_app('booster-q')
#wait_for_app('booster-e')
#wait_for_app('booster-d')
#wait_for_app('booster-m')
end
def open_Apps ( appName )
def open_Apps ( )
# Remove the log files if they exist
if FileTest . exists? ( PIXELCHANGED_LOG )
print_debug ( " remove #{ PIXELCHANGED_LOG } " )
@ -337,7 +339,7 @@ class TC_PerformanceTests < Test::Unit::TestCase
def read_file ( appName )
def read_file ( )
def get_matching_lines ( lines , re )
# return a list of lines that match re
lines . collect { | x | if x [ 1 ] =~ re ; x ; else ; nil ; end } . compact
@ -441,19 +443,10 @@ class TC_PerformanceTests < Test::Unit::TestCase
print_debug ( " Kill #{ PIXELCHANGED_BINARY } if any before launching " )
system ( " pkill #{ PIXELCHANGED_BINARY } " )
open_Apps ( @options [ :application ] )
sleep ( 5 )
read_file ( @options [ :application ] )
if @options [ :appCache ] != nil
app_cache_list . push ( @app_from_cache )
end
if @options [ :winCache ] != nil
win_cache_list . push ( @win_from_cache )
end
open_Apps ( )
read_file ( )
app_cache_list . push ( @app_from_cache ) if @options [ :appCache ] != nil
win_cache_list . push ( @win_from_cache ) if @options [ :winCache ] != nil
delay = @end_time - @start_time - MCOMPOSITOR_XGRABSERVER_DELAY_CONSTANT
#start_time_sum += delay