origen_testers 0.17.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/version.rb +1 -1
- data/lib/origen_testers/api.rb +11 -1
- data/lib/origen_testers/flow.rb +43 -8
- data/lib/origen_testers/origen_ext/generator/flow.rb +5 -0
- data/lib/origen_testers/smartest_based_tester/base/test_method.rb +2 -0
- data/lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb +6 -2
- data/program/components/_prb1_main.rb +5 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f682217ab30f290fbde9388a14b9c7e63f00d7bb
|
4
|
+
data.tar.gz: 87288b479896b7e11d09b815f86339141f0a46ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb4f04a3f01c882aa949740d9caf1e9c684aa63a1f7e64c2ea81083be05419fbfbf8df399a560128fffaf8fdc25d346779c853b9c15e13442a54bf9995a6ee05
|
7
|
+
data.tar.gz: 4a02c66488678badc29a9cfcc2c972ab514071276a18dd6edece67eadd55b1a1951854b083c200d9942ae3952b89985e0d954929fd32cc7156859e8f8665e2e2
|
data/config/version.rb
CHANGED
data/lib/origen_testers/api.rb
CHANGED
@@ -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
|
-
|
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 = {})
|
data/lib/origen_testers/flow.rb
CHANGED
@@ -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
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
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
|
-
|
59
|
-
|
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
|
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.
|
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
|
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
|