modsvaskr 0.1.0 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/modsvaskr/in_game_tests_runner.rb +14 -3
- data/lib/modsvaskr/tests_runner.rb +15 -11
- data/lib/modsvaskr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 891a0a4201c62018b26798acd86da140eb757f5633665d29ab2aadbb39fdb8e3
|
4
|
+
data.tar.gz: e03c3b7816308b0a153d890f09f86cfadc892c0da1537770fedf4ecbdea5aca7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34f1d6bf79e7301e8bfb12d8ab2dcb6372f62589bd4c6a7f508e4636d337dc2c72e90db41c06ce2a3a65f49f8ae308eb0b11910fd206906aa92c817ba6529932
|
7
|
+
data.tar.gz: 2035854e4ac51da63b9a6fc7006289b88a307acd92aa8213613dcb10306d787b49dcc40ec087740aaf932a1b56668820fbe3e595887d0df014eaba85b96da201
|
@@ -3,6 +3,7 @@ require 'elder_scrolls_plugin'
|
|
3
3
|
require 'fileutils'
|
4
4
|
require 'json'
|
5
5
|
require 'time'
|
6
|
+
require 'timeout'
|
6
7
|
require 'modsvaskr/tests_suite'
|
7
8
|
|
8
9
|
module Modsvaskr
|
@@ -66,8 +67,14 @@ module Modsvaskr
|
|
66
67
|
}
|
67
68
|
)
|
68
69
|
)
|
69
|
-
# Clear the AutoTest test statuses
|
70
|
-
|
70
|
+
# Clear the AutoTest test statuses that we are going to run
|
71
|
+
statuses_file = "#{@game.path}/Data/SKSE/Plugins/StorageUtilData/AutoTest_#{tests_suite}_Statuses.json"
|
72
|
+
if File.exist?(statuses_file)
|
73
|
+
File.write(
|
74
|
+
statuses_file,
|
75
|
+
JSON.pretty_generate('string' => JSON.parse(File.read(statuses_file))['string'].delete_if { |test_name, _test_status| tests.include?(test_name) })
|
76
|
+
)
|
77
|
+
end
|
71
78
|
end
|
72
79
|
auto_test_config_file = "#{@game.path}/Data/SKSE/Plugins/StorageUtilData/AutoTest_Config.json"
|
73
80
|
# Write the JSON file that contains the configuration of the AutoTest tests runner
|
@@ -204,11 +211,15 @@ module Modsvaskr
|
|
204
211
|
end
|
205
212
|
end
|
206
213
|
# We will start again. Leave some time to interrupt if we want.
|
214
|
+
unless @config.no_prompt
|
215
|
+
# First, flush stdin of any pending character
|
216
|
+
$stdin.getc while !select([$stdin], nil, nil, 2).nil?
|
217
|
+
end
|
207
218
|
out "We are going to start again in #{@game.timeout_interrupt_tests_secs} seconds. Press Enter now to interrupt it."
|
208
219
|
key_pressed =
|
209
220
|
begin
|
210
221
|
Timeout.timeout(@game.timeout_interrupt_tests_secs) { $stdin.gets }
|
211
|
-
rescue
|
222
|
+
rescue Timeout::Error
|
212
223
|
nil
|
213
224
|
end
|
214
225
|
if key_pressed
|
@@ -131,14 +131,15 @@ module Modsvaskr
|
|
131
131
|
in_game_tests.each do |tests_suite, selected_tests|
|
132
132
|
in_game_tests_to_subscribe = @tests_suites[tests_suite].in_game_tests_for(selected_tests)
|
133
133
|
in_game_tests_to_subscribe.each do |in_game_tests_suite, selected_in_game_tests|
|
134
|
+
selected_in_game_tests_downcase = selected_in_game_tests.map(&:downcase)
|
134
135
|
in_game_tests_subscriptions[in_game_tests_suite] = [] unless in_game_tests_subscriptions.key?(in_game_tests_suite)
|
135
136
|
in_game_tests_subscriptions[in_game_tests_suite] << {
|
136
137
|
tests_suite: tests_suite,
|
137
|
-
in_game_tests:
|
138
|
+
in_game_tests: selected_in_game_tests_downcase,
|
138
139
|
selected_tests: selected_tests
|
139
140
|
}
|
140
141
|
merged_in_game_tests[in_game_tests_suite] = [] unless merged_in_game_tests.key?(in_game_tests_suite)
|
141
|
-
merged_in_game_tests[in_game_tests_suite] = (merged_in_game_tests[in_game_tests_suite] +
|
142
|
+
merged_in_game_tests[in_game_tests_suite] = (merged_in_game_tests[in_game_tests_suite] + selected_in_game_tests_downcase).uniq
|
142
143
|
end
|
143
144
|
end
|
144
145
|
in_game_tests_runner = InGameTestsRunner.new(@config, @game)
|
@@ -146,15 +147,18 @@ module Modsvaskr
|
|
146
147
|
# This is a callback called for each in-game test status change.
|
147
148
|
# Update the tests results based on what has been run in-game.
|
148
149
|
# Find all tests suites that are subscribed to those in-game tests.
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
tests_suite
|
155
|
-
|
156
|
-
|
157
|
-
|
150
|
+
# Be careful that updates can be given for in-game tests suites we were not expecting
|
151
|
+
if in_game_tests_subscriptions.key?(in_game_tests_suite)
|
152
|
+
in_game_tests_subscriptions[in_game_tests_suite].each do |tests_suite_subscription|
|
153
|
+
selected_in_game_tests_statuses = in_game_tests_statuses.slice(*tests_suite_subscription[:in_game_tests])
|
154
|
+
unless selected_in_game_tests_statuses.empty?
|
155
|
+
tests_suite = @tests_suites[tests_suite_subscription[:tests_suite]]
|
156
|
+
tests_suite.set_statuses(
|
157
|
+
tests_suite.
|
158
|
+
parse_auto_tests_statuses_for(tests_suite_subscription[:selected_tests], { in_game_tests_suite => selected_in_game_tests_statuses }).
|
159
|
+
select { |(test_name, _test_status)| tests_suite_subscription[:selected_tests].include?(test_name) }
|
160
|
+
)
|
161
|
+
end
|
158
162
|
end
|
159
163
|
end
|
160
164
|
end
|
data/lib/modsvaskr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modsvaskr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muriel Salvan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses_menu
|