Class: OrigenAppGenerators::TestEngineering::TestBlock

Inherits:
Plugin
  • Object
show all
Defined in:
lib/origen_app_generators/test_engineering/test_block.rb

Overview

Generates a generic plugin shell

Instance Method Summary collapse

Methods inherited from Plugin

#get_common_user_input

Methods inherited from Base

#get_common_user_input, #get_lastest_origen_version, #set_source_paths, #set_type

Constructor Details

#initialize(*args) ⇒ TestBlock

Returns a new instance of TestBlock.



7
8
9
10
# File 'lib/origen_app_generators/test_engineering/test_block.rb', line 7

def initialize(*args)
  @audience = :internal
  super
end

Instance Method Details

#concludeObject



35
36
37
38
39
# File 'lib/origen_app_generators/test_engineering/test_block.rb', line 35

def conclude
  puts "New test module created at: #{destination_root}"
  puts
  puts 'Generate an example pattern by running "origen g example"'
end

#final_modificationsObject



27
28
29
30
31
32
33
# File 'lib/origen_app_generators/test_engineering/test_block.rb', line 27

def final_modifications
  prepend_to_file "lib/#{@name}.rb", "require 'origen_testers'\n"
  # Add require line
  doc_helpers = /gem 'origen_doc_helpers'/
  inject_into_file 'Gemfile', "\ngem 'origen_jtag'\ngem 'origen_arm_debug'\n",
                   after: doc_helpers
end

#generate_filesObject



20
21
22
23
24
25
# File 'lib/origen_app_generators/test_engineering/test_block.rb', line 20

def generate_files
  @runtime_dependencies = [
    ['origen_testers', '>= 0.6.1']
  ]
  build_filelist
end

#get_user_inputObject



12
13
14
15
16
17
18
# File 'lib/origen_app_generators/test_engineering/test_block.rb', line 12

def get_user_input
  # The methods to get the common user input that applies to all applications will
  # get called at the start automatically, you have a chance here to ask any additional
  # questions that are specific to the type of application being generated
  get_ip_names
  get_sub_block_name
end