origen_testers 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd766d675c5dc9794ac28a826929bd9ddca1c602
4
- data.tar.gz: 6a892c83abbc5fafda9b09cc6a25ff143d704d51
3
+ metadata.gz: f682217ab30f290fbde9388a14b9c7e63f00d7bb
4
+ data.tar.gz: 87288b479896b7e11d09b815f86339141f0a46ae
5
5
  SHA512:
6
- metadata.gz: fed7f00ff4816dc84fa81d977617bad88812e6acdef1bf71c0599e3362077c5f27008f226d1b9aaf4aefb0eb74123f78a63c22eec2c16d8896576a444f7c5546
7
- data.tar.gz: fa32ef3cec160f14984c94a22f7e2a8b3f2d2790b74582eec54ae4dda37d0c877b84dce979e99189e26e2794b6f7986134c66b07fd6200e61f8732f4234c39e0
6
+ metadata.gz: bb4f04a3f01c882aa949740d9caf1e9c684aa63a1f7e64c2ea81083be05419fbfbf8df399a560128fffaf8fdc25d346779c853b9c15e13442a54bf9995a6ee05
7
+ data.tar.gz: 4a02c66488678badc29a9cfcc2c972ab514071276a18dd6edece67eadd55b1a1951854b083c200d9942ae3952b89985e0d954929fd32cc7156859e8f8665e2e2
data/config/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module OrigenTesters
2
2
  MAJOR = 0
3
- MINOR = 17
3
+ MINOR = 18
4
4
  BUGFIX = 0
5
5
  DEV = nil
6
6
 
@@ -142,7 +142,17 @@ module OrigenTesters
142
142
  def c1(msg, options = {})
143
143
  prefix = comment_char + ' '
144
144
  prefix += step_comment_prefix + ' ' if @step_comment_on
145
- push_comment(prefix + msg.to_s)
145
+ if Origen.tester.generating == :program
146
+ cc_coms = OrigenTesters::Flow.cc_comments
147
+ # cc call must be on line directly before test method
148
+ line_number = caller_locations(2, 1)[0].lineno + 1
149
+ unless cc_coms[line_number]
150
+ cc_coms[line_number] = []
151
+ end
152
+ cc_coms[line_number] << msg
153
+ else
154
+ push_comment(prefix + msg.to_s)
155
+ end
146
156
  end
147
157
 
148
158
  def c2(msg, options = {})
@@ -48,6 +48,38 @@ module OrigenTesters
48
48
  @lines
49
49
  end
50
50
 
51
+ # @api private
52
+ def self.ht_comments
53
+ unless @ht_comments.is_a? Hash
54
+ @ht_comments = {}
55
+ end
56
+ @ht_comments
57
+ end
58
+
59
+ # @api private
60
+ def self.ht_comments=(val)
61
+ unless @ht_comments.is_a? Hash
62
+ @ht_comments = {}
63
+ end
64
+ @ht_comments = val
65
+ end
66
+
67
+ # @api private
68
+ def self.cc_comments
69
+ unless @cc_comments.is_a? Hash
70
+ @cc_comments = {}
71
+ end
72
+ @cc_comments
73
+ end
74
+
75
+ # @api private
76
+ def self.cc_comments=(val)
77
+ unless @cc_comments.is_a? Hash
78
+ @cc_comments = {}
79
+ end
80
+ @cc_comments = val
81
+ end
82
+
51
83
  # Returns the abstract test program model, this is shared by all
52
84
  # flow created together in a generation run
53
85
  def program
@@ -173,14 +205,17 @@ module OrigenTesters
173
205
  # e.g. a POR, in that case they will not want the description to be attached to the POR, but to
174
206
  # the test that follows it
175
207
  unless options[:inhibit_description_consumption]
176
- comments = OrigenTesters::Flow.comment_stack.last
177
- if options[:source_line_number]
178
- while comments.first && comments.first.first < options[:source_line_number]
179
- options[:description] ||= []
180
- c = comments.shift
181
- if c[0] + c[1].size == options[:source_line_number]
182
- options[:description] += c[1]
183
- end
208
+ ht_coms = OrigenTesters::Flow.ht_comments
209
+ cc_coms = OrigenTesters::Flow.cc_comments
210
+ line_no = options[:source_line_number]
211
+ # options[:then] only present on the second iteration of the same test same loop (not sure what this is really)
212
+ # This method is called twice per test method in a loop but the second call should not consume a comment
213
+ if line_no && !options[:then]
214
+ if ht_coms[line_no]
215
+ options[:description] ||= ht_coms[line_no]
216
+ end
217
+ if cc_coms[line_no] && cc_coms[line_no].first
218
+ options[:description] ||= [cc_coms[line_no].shift]
184
219
  end
185
220
  end
186
221
  end
@@ -24,6 +24,11 @@ module Origen
24
24
  OrigenTesters::Flow.callstack << file
25
25
  flow_comments, comments = *_extract_comments(OrigenTesters::Flow.callstack.last, line.to_i)
26
26
  OrigenTesters::Flow.comment_stack << comments
27
+ OrigenTesters::Flow.ht_comments = {}
28
+ comments.each do |src_line, com_array|
29
+ flow_src_line = src_line + com_array.size
30
+ OrigenTesters::Flow.ht_comments[flow_src_line] = com_array
31
+ end
27
32
  if OrigenTesters::Flow.flow_comments
28
33
  top = false
29
34
  name = options[:name] || Pathname.new(file).basename('.rb').to_s.sub(/^_/, '')
@@ -15,6 +15,7 @@ module OrigenTesters
15
15
  attr_reader :parameters
16
16
  attr_accessor :class_name
17
17
  attr_accessor :abs_class_name
18
+ attr_accessor :limits_id
18
19
 
19
20
  def initialize(options)
20
21
  @type = options[:type]
@@ -25,6 +26,7 @@ module OrigenTesters
25
26
  define_singleton_method('limits') do
26
27
  @limits
27
28
  end
29
+ @limits_id = options[:methods].delete(:limits_id)
28
30
  @limits = TestMethods::Limits.new(self)
29
31
  # Add any methods
30
32
  if options[:methods][:methods]
@@ -55,8 +55,12 @@ module OrigenTesters
55
55
  private
56
56
 
57
57
  def test_name
58
- name = test_method.test_name if test_method.respond_to?(:test_name)
59
- name || 'Functional'
58
+ if test_method.limits_id.nil?
59
+ name = test_method.try(:test_name) || test_method.try(:_test_name) || test_method.try('TestName')
60
+ name || 'Functional'
61
+ else
62
+ test_method.limits_id
63
+ end
60
64
  end
61
65
  end
62
66
  end
@@ -221,5 +221,10 @@ Flow.create do |options|
221
221
  bin 13, unless_enable: "AlarmEnabled"
222
222
  end
223
223
 
224
+ 3.times do |k|
225
+ cc "cc test #{k}"
226
+ func "cc_test_#{k}".to_sym
227
+ end
228
+
224
229
  pass 1, description: "Good die!", softbin: 1
225
230
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen_testers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-28 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen
@@ -45,6 +45,9 @@ dependencies:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.1'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 1.1.1
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,6 +55,9 @@ dependencies:
52
55
  - - "~>"
53
56
  - !ruby/object:Gem::Version
54
57
  version: '1.1'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 1.1.1
55
61
  description:
56
62
  email:
57
63
  - stephen.f.mcginty@gmail.com