Class: OrigenTesters::ATP::Validator
- Defined in:
- lib/origen_testers/atp/validator.rb
Direct Known Subclasses
OrigenTesters::ATP::Validators::DuplicateIDs, OrigenTesters::ATP::Validators::Flags, OrigenTesters::ATP::Validators::Jobs, OrigenTesters::ATP::Validators::MissingIDs
Instance Attribute Summary collapse
-
#flow ⇒ Object
readonly
Returns the value of attribute flow.
Class Method Summary collapse
Instance Method Summary collapse
- #error(message) ⇒ Object
-
#initialize(flow) ⇒ Validator
constructor
A new instance of Validator.
- #process(node) ⇒ Object
- #setup ⇒ Object
-
#test_process(node) ⇒ Object
For test purposes, returns true if validation failed rather than exiting the process.
Methods inherited from Processor
#clean_flag, #extract_volatiles, #handler_missing, #process_all, #run, #volatile?, #volatile_flags
Constructor Details
#initialize(flow) ⇒ Validator
Returns a new instance of Validator.
14 15 16 |
# File 'lib/origen_testers/atp/validator.rb', line 14 def initialize(flow) @flow = flow end |
Instance Attribute Details
#flow ⇒ Object (readonly)
Returns the value of attribute flow.
4 5 6 |
# File 'lib/origen_testers/atp/validator.rb', line 4 def flow @flow end |
Class Method Details
.testing ⇒ Object
10 11 12 |
# File 'lib/origen_testers/atp/validator.rb', line 10 def self.testing @testing end |
.testing=(value) ⇒ Object
6 7 8 |
# File 'lib/origen_testers/atp/validator.rb', line 6 def self.testing=(value) @testing = value end |
Instance Method Details
#error(message) ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/origen_testers/atp/validator.rb', line 42 def error() # This is a hack to make the specs pass, for some reason RSpec # seems to be swallowing the Origen log output after the first # test that generates an error if Validator.testing puts else Origen.log.error() end end |
#process(node) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/origen_testers/atp/validator.rb', line 18 def process(node) if @top_level_called super else @top_level_called = true setup super(node) unless @testing exit 1 if on_completion end end end |
#setup ⇒ Object
39 40 |
# File 'lib/origen_testers/atp/validator.rb', line 39 def setup end |
#test_process(node) ⇒ Object
For test purposes, returns true if validation failed rather than exiting the process
33 34 35 36 37 |
# File 'lib/origen_testers/atp/validator.rb', line 33 def test_process(node) @testing = true process(node) on_completion end |