grntest 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +6 -0
- data/lib/grntest/tester.rb +25 -2
- data/lib/grntest/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: ca196b4236185746df0d683e0b9632c4fd1dbaeffa5ed63c4331f73784ccd010
|
4
|
+
data.tar.gz: 3fe5db66385b146d1ea2fa1470141b8e0c884fc9481ac469d4111464e1d340d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 207e53bfebdb3366977a9f56546b8d7e83568ce4e459e09c877d377f3b874e219bf0c987db42fb113d0f03ea2501d91376cce1fa0566d157ca1bdbd42570724b
|
7
|
+
data.tar.gz: e46deb249c95770f16782918482c391a475e926936a12670c98fb86e7b5941c7b7596fda39b427ae69541e56dd0b4eef0a178482b28a2f3148687282a58f951f
|
data/doc/text/news.md
CHANGED
data/lib/grntest/tester.rb
CHANGED
@@ -199,7 +199,8 @@ module Grntest
|
|
199
199
|
end
|
200
200
|
|
201
201
|
parser.on("--n-workers=N", Integer,
|
202
|
-
"Use N workers to run tests"
|
202
|
+
"Use N workers to run tests",
|
203
|
+
"(#{tester.n_workers})") do |n|
|
203
204
|
tester.n_workers = n
|
204
205
|
end
|
205
206
|
|
@@ -382,7 +383,7 @@ module Grntest
|
|
382
383
|
@base_directory = Pathname(".")
|
383
384
|
@database_path = nil
|
384
385
|
@reporter = nil
|
385
|
-
@n_workers =
|
386
|
+
@n_workers = guess_n_cores
|
386
387
|
@output = $stdout
|
387
388
|
@keep_database = false
|
388
389
|
@use_color = nil
|
@@ -544,6 +545,28 @@ module Grntest
|
|
544
545
|
runner.run(test_suites)
|
545
546
|
end
|
546
547
|
|
548
|
+
def guess_n_cores
|
549
|
+
begin
|
550
|
+
if command_exist?("nproc")
|
551
|
+
# Linux
|
552
|
+
Integer(`nproc`.strip, 10)
|
553
|
+
elsif command_exist?("sysctl")
|
554
|
+
# macOS
|
555
|
+
Integer(`sysctl -n hw.logicalcpu`.strip, 10)
|
556
|
+
else
|
557
|
+
# Windows
|
558
|
+
value = ENV["NUMBER_OF_PROCESSORS"]
|
559
|
+
if value
|
560
|
+
Integer(value, 10)
|
561
|
+
else
|
562
|
+
1
|
563
|
+
end
|
564
|
+
end
|
565
|
+
rescue ArgumentError
|
566
|
+
1
|
567
|
+
end
|
568
|
+
end
|
569
|
+
|
547
570
|
def detect_suitable_diff
|
548
571
|
if command_exist?("cut-diff")
|
549
572
|
@diff = "cut-diff"
|
data/lib/grntest/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grntest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-08-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: diff-lcs
|