testkit123 0.3.1 → 0.5.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/testkit123.rb +27 -15
- data.tar.gz.sig +0 -0
- metadata +28 -49
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2bb68a709ae975a1f5fdb89fd11258535f4245868ca3a788027cb222bd379d4a
|
|
4
|
+
data.tar.gz: 3f3406a2e22fce8f96a0d9c357bfd285fcfd9220ed722dee9a5699bbff766e9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e7cc861ff7fa8782c0e5457b47f62130c3d0daa7e511640ece793477b2c9aff91d8ed0daec117b41b099522ba5cb240fca7e4848170694cfd4bbb35c0a505be
|
|
7
|
+
data.tar.gz: eb47de3581c38f7010589c1b885e9bca6bb160859303270e1749f43758e60492d55ce6649346939287ae4df82d49c639742c2209f307e66b46263b148c7cd7fb
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/testkit123.rb
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# file: testkit123.rb
|
|
4
4
|
|
|
5
|
-
require 'rxfhelper'
|
|
6
5
|
require 'fileutils'
|
|
7
6
|
require 'testdata_text'
|
|
8
7
|
require 'simple-config'
|
|
8
|
+
require 'rxfreadwrite'
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
module StringFormat
|
|
@@ -49,7 +49,7 @@ class TestKit123
|
|
|
49
49
|
puts '@project_config: ' + @project_config.inspect if @debug
|
|
50
50
|
puts 'localpath: ' + localpath.inspect if @debug
|
|
51
51
|
|
|
52
|
-
if File.
|
|
52
|
+
if File.exist? @project_config then
|
|
53
53
|
|
|
54
54
|
config = SimpleConfig.new(@project_config, debug: false).to_h
|
|
55
55
|
puts ('config: ' + config.inspect).debug if @debug
|
|
@@ -73,7 +73,7 @@ class TestKit123
|
|
|
73
73
|
#
|
|
74
74
|
def add_test(testnode)
|
|
75
75
|
|
|
76
|
-
s2 , filetype =
|
|
76
|
+
s2 , filetype = RXFReader.read @testdata_file
|
|
77
77
|
puts 'filetype: ' + filetype.inspect if @debug
|
|
78
78
|
|
|
79
79
|
xml = if s2.lstrip[0] == '<' then
|
|
@@ -97,7 +97,7 @@ class TestKit123
|
|
|
97
97
|
|
|
98
98
|
puts '1) Reading the config file' if @debug
|
|
99
99
|
raise "missing the config file " unless @project_config
|
|
100
|
-
raise "config file not found" unless File.
|
|
100
|
+
raise "config file not found" unless File.exist? @project_config
|
|
101
101
|
|
|
102
102
|
config_file = @project_config
|
|
103
103
|
|
|
@@ -136,7 +136,7 @@ class TestKit123
|
|
|
136
136
|
|
|
137
137
|
testdata = @h[:testdata].gsub(/(?<=\.)\w+$/, ext)
|
|
138
138
|
puts 'testdata: ' + testdata.inspect if @debug
|
|
139
|
-
buffer_testdata, _ =
|
|
139
|
+
buffer_testdata, _ = RXFReader.read(testdata)
|
|
140
140
|
|
|
141
141
|
FileUtils.mkdir_p datafilepath
|
|
142
142
|
|
|
@@ -144,7 +144,7 @@ class TestKit123
|
|
|
144
144
|
File.write testdata_file, eval('%{' + buffer_testdata + '}')
|
|
145
145
|
|
|
146
146
|
test_template_rsf = @h[:testx]
|
|
147
|
-
buffer_test, _ =
|
|
147
|
+
buffer_test, _ = RXFReader.read(test_template_rsf)
|
|
148
148
|
|
|
149
149
|
test_rsffile = File.join(config[:data_path], "#{proj}.rsf")
|
|
150
150
|
File.write test_rsffile, eval('%{' + buffer_test + '}')
|
|
@@ -179,7 +179,8 @@ end
|
|
|
179
179
|
def create_standalone(n)
|
|
180
180
|
|
|
181
181
|
# use the test number to find the test to copy from the test file
|
|
182
|
-
|
|
182
|
+
puts '@project_config: ' + @project_config.inspect
|
|
183
|
+
|
|
183
184
|
config = SimpleConfig.new(@project_config, debug: false).to_h
|
|
184
185
|
puts ('config: ' + config.inspect).debug if @debug
|
|
185
186
|
|
|
@@ -212,7 +213,7 @@ end
|
|
|
212
213
|
[r[:test], r[:raw_args].split(/, */)]
|
|
213
214
|
end
|
|
214
215
|
|
|
215
|
-
s2 , filetype =
|
|
216
|
+
s2 , filetype = RXFReader.read testdata_file
|
|
216
217
|
puts 'filetype: ' + filetype.inspect if @debug
|
|
217
218
|
|
|
218
219
|
xml = if s2.lstrip[0] == '<' then
|
|
@@ -251,16 +252,26 @@ end
|
|
|
251
252
|
|
|
252
253
|
input_vars = testnode.xpath('records/input/summary/*/name()')
|
|
253
254
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
if @debug then
|
|
256
|
+
puts 'input_vars: ' + input_vars.inspect
|
|
257
|
+
puts 'tests[i][1]: ' + tests[i][1].inspect
|
|
258
|
+
puts 'zip: ' + tests[i][1].zip(input_vars).inspect
|
|
259
|
+
end
|
|
260
|
+
|
|
257
261
|
tests[i][1].zip(input_vars).each do |x|
|
|
258
262
|
testcode.gsub!(/\b#{x[0]}\b/, 'test_' + x[1])
|
|
259
263
|
end
|
|
260
264
|
|
|
261
265
|
args = testnode.xpath('records/input/summary/*').map do |input|
|
|
262
|
-
|
|
263
|
-
|
|
266
|
+
|
|
267
|
+
value = input.texts.join.gsub(/'/,"\'").strip
|
|
268
|
+
|
|
269
|
+
if value.lines.length > 1 then
|
|
270
|
+
"test_%s =<<EOF\n%s\nEOF\n" % [input.name, value ]
|
|
271
|
+
else
|
|
272
|
+
"test_%s = '%s'\n" % [input.name, value ]
|
|
273
|
+
end
|
|
274
|
+
|
|
264
275
|
end
|
|
265
276
|
|
|
266
277
|
vars = testnode.xpath('records/input/summary/*').map(&:name)
|
|
@@ -268,7 +279,7 @@ end
|
|
|
268
279
|
puts 'args: ' + args.inspect if @debug
|
|
269
280
|
|
|
270
281
|
vars.each do |var|
|
|
271
|
-
testcode.gsub!(/\b#{var}\b/, 'test_' + var)
|
|
282
|
+
testcode.gsub!(/\b#{var}[^:]\b/, 'test_' + var)
|
|
272
283
|
end
|
|
273
284
|
|
|
274
285
|
puts 'gems: ' + require_gems.inspect if @debug
|
|
@@ -279,7 +290,8 @@ end
|
|
|
279
290
|
% [n, title, testnode.text('summary/type')] + \
|
|
280
291
|
"# --------------------------------------------\n\n" + \
|
|
281
292
|
"require '#{proj}'\n" + require_gems.map {|x| "require '%s'" \
|
|
282
|
-
% x}.join("\n") +
|
|
293
|
+
% x}.join("\n") + \
|
|
294
|
+
"\nrequire 'rxfreadwrite'\n\n\n" \
|
|
283
295
|
+ before_test.gsub(/^ /,'') + "\n" + args.join("\n") \
|
|
284
296
|
+ codex[0..-2].join + 'puts ' + codex.last
|
|
285
297
|
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: testkit123
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -11,52 +11,32 @@ cert_chain:
|
|
|
11
11
|
- |
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
|
13
13
|
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjIwMjIxMTUyMzQ4Whc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|
36
|
-
|
|
28
|
+
BgkqhkiG9w0BAQsFAAOCAYEAfdkypqOi4heDFVtNrQXwCHBv312S6Ivo3ZUhtpbR
|
|
29
|
+
DAlYC0efVgGy2Xic/noETRT4/FMnTyKmQ9E3U/xCWSC1acZM51yB1vYA6boKt9xz
|
|
30
|
+
jNvpR7089iGJUvo7CUy+3LFe91fzZGGDiB3g2PgtOm1QnO8OPQqx7eqkKzsfZhrv
|
|
31
|
+
jsqQ+xmYGai4kc+lKOqhRot2cg8yhjr5x9CbOTKPC5cwq8h6bvKkD81ty/GQzSda
|
|
32
|
+
Y7veJQStbysuq2zUwx4TvATlFbOl4qA8PLT99wLPqUMrNl+JoWPuUrHnBr/Tp73q
|
|
33
|
+
HcBJ7t1jV+r747CBLN9Av0Fh0fsB2yxdMQnwbVdY6s3Ku+8cWvH8MUq/HpzRdX4i
|
|
34
|
+
oo9BUrJRFuzP3FNuq2We336yf1C+HnnH/mxSTwQhiP+A5aavkTnmm2GQzzOORN6I
|
|
35
|
+
DN5UNRowuQ2fXKFO7nmgUH33wBhFAs2KXZPPR6sWn2JxLUlMMngzSypdB7zQn7my
|
|
36
|
+
FmX/ZG5sgd+RpEYbxgC2cdNk
|
|
37
37
|
-----END CERTIFICATE-----
|
|
38
|
-
date:
|
|
38
|
+
date: 2023-02-02 00:00:00.000000000 Z
|
|
39
39
|
dependencies:
|
|
40
|
-
- !ruby/object:Gem::Dependency
|
|
41
|
-
name: rxfhelper
|
|
42
|
-
requirement: !ruby/object:Gem::Requirement
|
|
43
|
-
requirements:
|
|
44
|
-
- - "~>"
|
|
45
|
-
- !ruby/object:Gem::Version
|
|
46
|
-
version: '1.0'
|
|
47
|
-
- - ">="
|
|
48
|
-
- !ruby/object:Gem::Version
|
|
49
|
-
version: 1.0.5
|
|
50
|
-
type: :runtime
|
|
51
|
-
prerelease: false
|
|
52
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
53
|
-
requirements:
|
|
54
|
-
- - "~>"
|
|
55
|
-
- !ruby/object:Gem::Version
|
|
56
|
-
version: '1.0'
|
|
57
|
-
- - ">="
|
|
58
|
-
- !ruby/object:Gem::Version
|
|
59
|
-
version: 1.0.5
|
|
60
40
|
- !ruby/object:Gem::Dependency
|
|
61
41
|
name: simple-config
|
|
62
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,7 +46,7 @@ dependencies:
|
|
|
66
46
|
version: '0.7'
|
|
67
47
|
- - ">="
|
|
68
48
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: 0.7.
|
|
49
|
+
version: 0.7.3
|
|
70
50
|
type: :runtime
|
|
71
51
|
prerelease: false
|
|
72
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -76,7 +56,7 @@ dependencies:
|
|
|
76
56
|
version: '0.7'
|
|
77
57
|
- - ">="
|
|
78
58
|
- !ruby/object:Gem::Version
|
|
79
|
-
version: 0.7.
|
|
59
|
+
version: 0.7.3
|
|
80
60
|
- !ruby/object:Gem::Dependency
|
|
81
61
|
name: testdata_text
|
|
82
62
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -98,7 +78,7 @@ dependencies:
|
|
|
98
78
|
- !ruby/object:Gem::Version
|
|
99
79
|
version: 0.2.2
|
|
100
80
|
description:
|
|
101
|
-
email:
|
|
81
|
+
email: digital.robertson@gmail.com
|
|
102
82
|
executables: []
|
|
103
83
|
extensions: []
|
|
104
84
|
extra_rdoc_files: []
|
|
@@ -123,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
123
103
|
- !ruby/object:Gem::Version
|
|
124
104
|
version: '0'
|
|
125
105
|
requirements: []
|
|
126
|
-
|
|
127
|
-
rubygems_version: 2.7.10
|
|
106
|
+
rubygems_version: 3.4.4
|
|
128
107
|
signing_key:
|
|
129
108
|
specification_version: 4
|
|
130
109
|
summary: Generates a test suite of files (for use with the testdata gem) from a config
|
metadata.gz.sig
CHANGED
|
Binary file
|