Module: Origen::Tester::Ultraflex::Files
- Included in:
 - Origen::Tester::Ultraflex
 - Defined in:
 - lib/origen/tester/ultraflex/files.rb
 
Overview
Methods for handling all Ultraflex file parsing, e.g. datalogs, test time profiles, etc.
Instance Method Summary (collapse)
- 
  
    
      - (Object) read_test_times(file, _options = {}) 
    
    
  
  
  
  
  
  
  
  
  
    
Reads all lines from a Ultraflex detailed execution time file, returning the lines as an array like this:.
 
Instance Method Details
- (Object) read_test_times(file, _options = {})
Reads all lines from a Ultraflex detailed execution time file, returning the lines as an array like this:
[
  {:name => "power_cycle", :index => 1, :group => 3, :time => 0.00461},
  {:name => "power_cycle", :index => 2, :group => 3, :time => 0.00481},
  {:name => "power_cycle", :index => 3, :group => 3, :time => 0.00438},
  {:name => "nvm_mass_erase", :index => nil, :group => nil, :time => 0.19863},
]
  
      16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41  | 
    
      # File 'lib/origen/tester/ultraflex/files.rb', line 16 def read_test_times(file, = {}) tests = [] File.readlines(file).each do |line| unless line.strip.empty? || line =~ /Entire Job/ # https://rubular.com/r/vZOcqovTsf if line =~ /(\w+) ?(\(.*?\))? \d\d\d\d (\d+\.\d+).*/ t = { name: Regexp.last_match[1], time: Regexp.last_match[3].to_f.round(6) } # If an indexed test if Regexp.last_match[2] str = Regexp.last_match[2].gsub('(', '').gsub(')', '') fields = str.split('/') i = fields[0].to_i g = fields[1].to_i t[:index] = i t[:group] = g else t[:index] = nil t[:group] = nil end tests << t end end end tests end  |