test_ids 1.2.3 → 1.2.4
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 +4 -4
- data/config/application.rb +34 -34
- data/config/boot.rb +4 -2
- data/config/commands.rb +21 -19
- data/config/shared_commands.rb +5 -3
- data/config/version.rb +1 -1
- data/lib/tasks/test_ids.rake +1 -0
- data/lib/test_ids/allocator.rb +156 -150
- data/lib/test_ids/bin_array.rb +13 -12
- data/lib/test_ids/commands/clear.rb +16 -11
- data/lib/test_ids/commands/repair.rb +10 -5
- data/lib/test_ids/configuration.rb +12 -21
- data/lib/test_ids/git.rb +57 -57
- data/lib/test_ids/origen/origen.rb +3 -1
- data/lib/test_ids/origen_testers/flow.rb +9 -9
- data/lib/test_ids/shutdown_handler.rb +2 -0
- data/lib/test_ids.rb +87 -111
- data/lib/test_ids_dev/dut.rb +2 -0
- data/lib/test_ids_dev/interface.rb +3 -1
- data/program/prb1.rb +2 -0
- metadata +19 -24
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d358c2adcb8219fc81608948ddc5081c25774393be286ca3e6f6ac7661ba2da3
|
|
4
|
+
data.tar.gz: 8fdc97199d75ef15e06c28057f0c4ef455df5631ff730ed917a51d3728fb31d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6bf8c0ad0421c6fabd3d6e0042d273596fa887cef60a7029187e6929099d2fe3c18a5c905df0cbaa1f0c0619b30650d60c8378096c9e151541912a20a0ea9e1c
|
|
7
|
+
data.tar.gz: 3bd3882e560dda2bcfc021ac55971ca1eb4677aa8c738610a631567c1b30c345e365f4db9f86d9a2f3e2559480d7e72178796344a207226384ad859b6ae0fe92
|
data/config/application.rb
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'origen'
|
|
2
4
|
class TestIdsApplication < Origen::Application
|
|
3
|
-
|
|
4
5
|
# See http://origen-sdk.org/origen/api/Origen/Application/Configuration.html
|
|
5
6
|
# for a full list of the configuration options available
|
|
6
7
|
|
|
7
8
|
# These attributes should never be changed, the duplication here will be resolved in future
|
|
8
9
|
# by condensing these attributes that do similar things
|
|
9
|
-
self.name =
|
|
10
|
-
self.namespace =
|
|
11
|
-
config.name =
|
|
12
|
-
config.initials =
|
|
10
|
+
self.name = 'test_ids'
|
|
11
|
+
self.namespace = 'TestIds'
|
|
12
|
+
config.name = 'test_ids'
|
|
13
|
+
config.initials = 'TestIds'
|
|
13
14
|
# Change this to point to the revision control repository for this plugin
|
|
14
|
-
config.rc_url =
|
|
15
|
+
config.rc_url = 'ssh://git@github.com:Origen-SDK/test_ids.git'
|
|
15
16
|
config.release_externally = true
|
|
16
17
|
|
|
17
18
|
# To enable deployment of your documentation to a web server (via the 'origen web'
|
|
18
19
|
# command) fill in these attributes.
|
|
19
|
-
config.web_directory =
|
|
20
|
-
config.web_domain =
|
|
20
|
+
config.web_directory = 'git@github.com:Origen-SDK/Origen-SDK.github.io.git/test_ids'
|
|
21
|
+
config.web_domain = 'http://origen-sdk.org/test_ids'
|
|
21
22
|
|
|
22
23
|
# When false Origen will be less strict about checking for some common coding errors,
|
|
23
24
|
# it is recommended that you leave this to true for better feedback and easier debug.
|
|
@@ -29,46 +30,46 @@ class TestIdsApplication < Origen::Application
|
|
|
29
30
|
# Require the lint tests to pass before allowing a release to proceed
|
|
30
31
|
run_on_tag: true,
|
|
31
32
|
# Auto correct violations where possible whenever 'origen lint' is run
|
|
32
|
-
auto_correct: true
|
|
33
|
+
auto_correct: true
|
|
33
34
|
# Limit the testing for large legacy applications
|
|
34
|
-
#level: :easy,
|
|
35
|
+
# level: :easy,
|
|
35
36
|
# Run on these directories/files by default
|
|
36
|
-
#files: ["lib", "config/application.rb"],
|
|
37
|
+
# files: ["lib", "config/application.rb"],
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
config.shared = {
|
|
40
|
-
command_launcher:
|
|
41
|
+
command_launcher: 'config/shared_commands.rb'
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
config.semantically_version = true
|
|
44
45
|
|
|
45
46
|
# An example of how to set application specific LSF parameters
|
|
46
|
-
#config.lsf.project = "msg.te"
|
|
47
|
-
|
|
47
|
+
# config.lsf.project = "msg.te"
|
|
48
|
+
|
|
48
49
|
# An example of how to specify a prefix to add to all generated patterns
|
|
49
|
-
#config.pattern_prefix = "nvm"
|
|
50
|
+
# config.pattern_prefix = "nvm"
|
|
50
51
|
|
|
51
52
|
# An example of how to add header comments to all generated patterns
|
|
52
|
-
#config.pattern_header do
|
|
53
|
+
# config.pattern_header do
|
|
53
54
|
# cc "This is a pattern created by the example origen application"
|
|
54
|
-
#end
|
|
55
|
+
# end
|
|
55
56
|
|
|
56
57
|
# By default all generated output will end up in ./output.
|
|
57
58
|
# Here you can specify an alternative directory entirely, or make it dynamic such that
|
|
58
|
-
# the output ends up in a setup specific directory.
|
|
59
|
-
#config.output_directory do
|
|
59
|
+
# the output ends up in a setup specific directory.
|
|
60
|
+
# config.output_directory do
|
|
60
61
|
# "#{Origen.root}/output/#{$dut.class}"
|
|
61
|
-
#end
|
|
62
|
+
# end
|
|
62
63
|
|
|
63
64
|
# Similarly for the reference files, generally you want to setup the reference directory
|
|
64
65
|
# structure to mirror that of your output directory structure.
|
|
65
|
-
#config.reference_directory do
|
|
66
|
+
# config.reference_directory do
|
|
66
67
|
# "#{Origen.root}/.ref/#{$dut.class}"
|
|
67
|
-
#end
|
|
68
|
-
|
|
68
|
+
# end
|
|
69
|
+
|
|
69
70
|
# This will automatically deploy your documentation after every tag
|
|
70
|
-
def after_release_email(
|
|
71
|
-
command =
|
|
71
|
+
def after_release_email(_tag, _note, _type, _selector, _options)
|
|
72
|
+
command = 'origen web compile --remote --api'
|
|
72
73
|
Dir.chdir Origen.root do
|
|
73
74
|
system command
|
|
74
75
|
end
|
|
@@ -76,20 +77,20 @@ class TestIdsApplication < Origen::Application
|
|
|
76
77
|
|
|
77
78
|
# Ensure that all tests pass before allowing a release to continue
|
|
78
79
|
def validate_release
|
|
79
|
-
if !system(
|
|
80
|
+
if !system('origen specs') || !system('origen examples')
|
|
80
81
|
puts "Sorry but you can't release with failing tests, please fix them and try again."
|
|
81
82
|
exit 1
|
|
82
83
|
else
|
|
83
|
-
puts
|
|
84
|
+
puts 'All tests passing, proceeding with release process!'
|
|
84
85
|
end
|
|
85
86
|
end
|
|
86
|
-
|
|
87
|
+
|
|
87
88
|
# To enabled source-less pattern generation create a class (for example PatternDispatcher)
|
|
88
89
|
# to generate the pattern. This should return false if the requested pattern has been
|
|
89
90
|
# dispatched, otherwise Origen will proceed with looking up a pattern source as normal.
|
|
90
|
-
#def before_pattern_lookup(requested_pattern)
|
|
91
|
+
# def before_pattern_lookup(requested_pattern)
|
|
91
92
|
# PatternDispatcher.new.dispatch_or_return(requested_pattern)
|
|
92
|
-
#end
|
|
93
|
+
# end
|
|
93
94
|
|
|
94
95
|
# If you use pattern iterators you may come across the case where you request a pattern
|
|
95
96
|
# like this:
|
|
@@ -97,11 +98,10 @@ class TestIdsApplication < Origen::Application
|
|
|
97
98
|
#
|
|
98
99
|
# However it cannot be found by Origen since the pattern name is actually example_pat_bx.atp
|
|
99
100
|
# In the case where the pattern cannot be found Origen will pass the name to this translator
|
|
100
|
-
# if it exists, and here you can make any substitutions to help Origen find the file you
|
|
101
|
+
# if it exists, and here you can make any substitutions to help Origen find the file you
|
|
101
102
|
# want. In this example any instances of _b\d, where \d means a number, are replaced by
|
|
102
103
|
# _bx.
|
|
103
|
-
#config.pattern_name_translator do |name|
|
|
104
|
+
# config.pattern_name_translator do |name|
|
|
104
105
|
# name.gsub(/_b\d/, "_bx")
|
|
105
|
-
#end
|
|
106
|
-
|
|
106
|
+
# end
|
|
107
107
|
end
|
data/config/boot.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# This file is used to boot your plugin when it is running in standalone mode
|
|
2
4
|
# from its own workspace - i.e. when the plugin is being developed.
|
|
3
5
|
#
|
|
@@ -8,12 +10,12 @@
|
|
|
8
10
|
# the development environment for this app. For example, this is typically used
|
|
9
11
|
# to load some additional test classes to use your plugin APIs so that they can
|
|
10
12
|
# be tested and/or interacted with in the console.
|
|
11
|
-
require
|
|
13
|
+
require 'test_ids'
|
|
12
14
|
|
|
13
15
|
module TestIdsDev
|
|
14
16
|
# Example of how to explicitly require a file
|
|
15
17
|
# require "test_ids_dev/my_file"
|
|
16
|
-
|
|
18
|
+
|
|
17
19
|
# Load all files in the lib/test_ids_dev directory.
|
|
18
20
|
# Note that there is no problem from requiring a file twice (Ruby will ignore
|
|
19
21
|
# the second require), so if you have a file that must be required first, then
|
data/config/commands.rb
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# This file should be used to extend the origen with application specific commands
|
|
2
4
|
|
|
3
|
-
# Map any command aliases here, for example to allow 'origen ex' to refer to a
|
|
4
|
-
# command called execute you would add a reference as shown below:
|
|
5
|
-
aliases ={
|
|
6
|
-
# "ex" => "execute",
|
|
5
|
+
# Map any command aliases here, for example to allow 'origen ex' to refer to a
|
|
6
|
+
# command called execute you would add a reference as shown below:
|
|
7
|
+
aliases = {
|
|
8
|
+
# "ex" => "execute",
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
# The requested command is passed in here as @command, this checks it against
|
|
@@ -13,33 +15,33 @@ aliases ={
|
|
|
13
15
|
# Now branch to the specific task code
|
|
14
16
|
case @command
|
|
15
17
|
|
|
16
|
-
when
|
|
18
|
+
when 'tags'
|
|
17
19
|
Dir.chdir Origen.root do
|
|
18
|
-
system(
|
|
20
|
+
system('ripper-tags -R')
|
|
19
21
|
end
|
|
20
22
|
exit 0
|
|
21
23
|
|
|
22
24
|
# Example of how to make a command to run unit tests, this simply invokes RSpec on
|
|
23
25
|
# the spec directory
|
|
24
|
-
when
|
|
25
|
-
require
|
|
26
|
+
when 'specs'
|
|
27
|
+
require 'rspec'
|
|
26
28
|
exit RSpec::Core::Runner.run(['spec'])
|
|
27
29
|
|
|
28
30
|
# Example of how to make a command to run diff-based tests
|
|
29
|
-
when
|
|
31
|
+
when 'examples', 'test'
|
|
30
32
|
Origen.load_application
|
|
31
33
|
status = 0
|
|
32
34
|
|
|
33
35
|
# Program generator integration test
|
|
34
|
-
ARGV = %w
|
|
36
|
+
ARGV = %w[program/prb1.rb -t default -e default -r approved]
|
|
35
37
|
load "#{Origen.top}/lib/origen/commands/program.rb"
|
|
36
|
-
ARGV = %W
|
|
38
|
+
ARGV = %W[program/prb1.rb -t dut2 -o #{Origen.root}/output/dut2 -e default -r approved/dut2]
|
|
37
39
|
load "#{Origen.top}/lib/origen/commands/program.rb"
|
|
38
40
|
|
|
39
|
-
if Origen.app.stats.changed_files
|
|
40
|
-
Origen.app.stats.new_files
|
|
41
|
-
Origen.app.stats.changed_patterns
|
|
42
|
-
Origen.app.stats.new_patterns
|
|
41
|
+
if Origen.app.stats.changed_files.zero? &&
|
|
42
|
+
Origen.app.stats.new_files.zero? &&
|
|
43
|
+
Origen.app.stats.changed_patterns.zero? &&
|
|
44
|
+
Origen.app.stats.new_patterns.zero?
|
|
43
45
|
|
|
44
46
|
Origen.app.stats.report_pass
|
|
45
47
|
else
|
|
@@ -47,13 +49,13 @@ when "examples", "test"
|
|
|
47
49
|
status = 1
|
|
48
50
|
end
|
|
49
51
|
puts
|
|
50
|
-
if @command ==
|
|
52
|
+
if @command == 'test'
|
|
51
53
|
Origen.app.unload_target!
|
|
52
|
-
require
|
|
54
|
+
require 'rspec'
|
|
53
55
|
result = RSpec::Core::Runner.run(['spec'])
|
|
54
56
|
status = status == 1 ? 1 : result
|
|
55
57
|
end
|
|
56
|
-
exit status
|
|
58
|
+
exit status # Exit with a 1 on the event of a failure per std unix result codes
|
|
57
59
|
|
|
58
60
|
# Always leave an else clause to allow control to fall back through to the
|
|
59
61
|
# Origen command handler.
|
|
@@ -68,4 +70,4 @@ else
|
|
|
68
70
|
test Run both specs and examples, -c will enable coverage
|
|
69
71
|
EOT
|
|
70
72
|
|
|
71
|
-
end
|
|
73
|
+
end
|
data/config/shared_commands.rb
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# The requested command is passed in here as @command
|
|
2
4
|
case @command
|
|
3
5
|
|
|
4
|
-
when
|
|
6
|
+
when 'test_ids:rollback'
|
|
5
7
|
if ARGV[0]
|
|
6
8
|
local = TestIds::Git.path_to_local
|
|
7
9
|
TestIds::Git.new(local: local).rollback(ARGV[0])
|
|
8
10
|
else
|
|
9
|
-
puts
|
|
11
|
+
puts 'You must supply a commit ID to rollback to, e.g. origen test_ids:rollback 456ac3f53'
|
|
10
12
|
end
|
|
11
13
|
exit 0
|
|
12
14
|
|
|
13
|
-
when
|
|
15
|
+
when 'test_ids:clear', 'test_ids:repair'
|
|
14
16
|
require "test_ids/commands/#{@command.split(':').last}"
|
|
15
17
|
exit 0
|
|
16
18
|
|
data/config/version.rb
CHANGED
data/lib/tasks/test_ids.rake
CHANGED