calypso 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/calypso.rb +40 -0
- data/lib/calypso/kbuild.rb +14 -0
- data/lib/calypso/unittest.rb +9 -0
- data/lib/calypso/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 598059a4f02a44be7bc28d7d0d92b79de0121ca6
|
4
|
+
data.tar.gz: 3ada6ac13a393c41b6d1be9d8af1756fb00f84e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97637b03e5954551e63308cc4398af0092fdca10e52d0906b8572ce81211df59dff170f33962e0d9bc227d5c7a4372a5ab3c6a88965f495afed222897b341309
|
7
|
+
data.tar.gz: be91f78c64e2e3525d8c5e9221b8d178a0c97b9b7d20c41edf52f0d9bace8cb44e1c0478cd2f033cdef18225158835352b4142427a957c8d7a83dfb7785616a5
|
data/lib/calypso.rb
CHANGED
@@ -46,6 +46,7 @@ module Calypso
|
|
46
46
|
options.run_mode = :all
|
47
47
|
options.tty_fix = false
|
48
48
|
options.tty_fix = true if ENV['TTY_FIX'].eql? 'true'
|
49
|
+
options.update = false
|
49
50
|
|
50
51
|
parser = OptionParser.new do |p|
|
51
52
|
p.banner = "Usage: calypso [options] -c [config]"
|
@@ -56,6 +57,10 @@ module Calypso
|
|
56
57
|
options.parser = :yaml
|
57
58
|
end
|
58
59
|
|
60
|
+
p.on('-u', '--update', "Update configuration files") do
|
61
|
+
options.update = true
|
62
|
+
end
|
63
|
+
|
59
64
|
p.on('-b', '--bare', "Do not recompile ETA/OS before running the test") do
|
60
65
|
options.bare = true
|
61
66
|
end
|
@@ -123,6 +128,11 @@ module Calypso
|
|
123
128
|
config = Calypso::ParserProxy.new(options.parser, options.config)
|
124
129
|
config.parse
|
125
130
|
|
131
|
+
if options.update
|
132
|
+
Calypso.update(config, options)
|
133
|
+
exit
|
134
|
+
end
|
135
|
+
|
126
136
|
case options.run_mode
|
127
137
|
when :all
|
128
138
|
Calypso.run(config, options)
|
@@ -133,6 +143,36 @@ module Calypso
|
|
133
143
|
end
|
134
144
|
end
|
135
145
|
|
146
|
+
# Update the Kbuild configurations.
|
147
|
+
#
|
148
|
+
# @param parser [Calypso::ParserProxy] Config parser
|
149
|
+
# @param options [OpenStruct] Program options
|
150
|
+
# @param hwid [String] Harware ID of the tests to update
|
151
|
+
# @return [nil]
|
152
|
+
def update_hw(parser, options, hwid)
|
153
|
+
hw = parser.hardware[hwid]
|
154
|
+
tests = hw.tests
|
155
|
+
|
156
|
+
tests.each do |test|
|
157
|
+
puts "Updating #{test.name}"
|
158
|
+
puts ""
|
159
|
+
test.update
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
# Update the Kbuild configurations.
|
164
|
+
#
|
165
|
+
# @param parser [Calypso::ParserProxy] Config parser
|
166
|
+
# @param options [OpenStruct] Program options
|
167
|
+
# @return [nil]
|
168
|
+
def update(parser, options)
|
169
|
+
hw = parser.hardware
|
170
|
+
|
171
|
+
hw.each do |hwid, hwdata|
|
172
|
+
Calypso.update_hw(parser, options, hwid)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
136
176
|
# Run a single test.
|
137
177
|
#
|
138
178
|
# @param parser [Calypso::ParserProxy] Configuration parser.
|
data/lib/calypso/kbuild.rb
CHANGED
@@ -44,6 +44,20 @@ module Calypso
|
|
44
44
|
FileUtils.copy(@conf, "#{Dir.pwd}/.config")
|
45
45
|
end
|
46
46
|
|
47
|
+
# Save the configuration file back to the test directory.
|
48
|
+
#
|
49
|
+
# @return [nil]
|
50
|
+
def save_config
|
51
|
+
FileUtils.copy("#{Dir.pwd}/.config", @conf)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Run the prebuild targets.
|
55
|
+
#
|
56
|
+
# @return [nil]
|
57
|
+
def prepare
|
58
|
+
system("make #{ETAOS_PREBUILD_TARGETS}")
|
59
|
+
end
|
60
|
+
|
47
61
|
# Run the clean target on ETA/OS.
|
48
62
|
def clean
|
49
63
|
system("make #{ETAOS_CLEAN_TARGETS}")
|
data/lib/calypso/unittest.rb
CHANGED
@@ -88,6 +88,15 @@ module Calypso
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
+
# Update the unit test configuration file.
|
92
|
+
#
|
93
|
+
# @return [nil]
|
94
|
+
def update
|
95
|
+
kbuild = Kbuild.new(@conf, @path)
|
96
|
+
kbuild.prepare
|
97
|
+
kbuild.save_config
|
98
|
+
end
|
99
|
+
|
91
100
|
# Check if the test ran succesfully.
|
92
101
|
#
|
93
102
|
# @return [Boolean] Whether or not the test executed succesfully.
|
data/lib/calypso/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calypso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michel Megens
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,28 +42,28 @@ dependencies:
|
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 3.4.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 3.4.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: serialport
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.3.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.3.0
|
69
69
|
description: Automate tests for embedded system based on a specific configuration.
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.5.1
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Embedded test automation.
|