Skip to content

Instantly share code, notes, and snippets.

@listrophy
Created March 2, 2012 22:59
Show Gist options
  • Save listrophy/f7309ce2f3b3dfce56e8 to your computer and use it in GitHub Desktop.
Save listrophy/f7309ce2f3b3dfce56e8 to your computer and use it in GitHub Desktop.
ruby isn't streaming instruments output
task :test => :coffeescript do
template = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate'
app = '~/dev/ios/TravisCI/build/TravisCI.app'
variables = {
'UIASCRIPT' => '~/dev/ios/TravisCI/automation/uiautomation.js',
'UIARESULTSPATH' => '~/dev/ios/TravisCI/automation/results'
}.map{|key,val| "-e #{key} #{val}"}.join(' ')
STDOUT.sync = true
Open3.popen2e("instruments -t #{template} #{app} #{variables}") do |stdin, stdout, wait_thr|
stdout.each_line do |line|
puts line
end
puts "status: #{wait_thr.value}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment