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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6671c17849f4aafbc27163d7c5a387b877fbc330b867dd5b8970366d936ace93
4
- data.tar.gz: 3b9262457bbb69d422c1a33ab85572a81a4afd34f86554a3abecc0e96530629d
3
+ metadata.gz: ca196b4236185746df0d683e0b9632c4fd1dbaeffa5ed63c4331f73784ccd010
4
+ data.tar.gz: 3fe5db66385b146d1ea2fa1470141b8e0c884fc9481ac469d4111464e1d340d5
5
5
  SHA512:
6
- metadata.gz: 6993e535ae22bfa319ab2b0b60b6a499075056663f2765cb2e9aa10a3a81270afa58022c81183a56ac6fff4cea5ac4fd5f3089cce700c2970fdd00d0bb4b3e8a
7
- data.tar.gz: f18839c07ad5e48ac14168c209e26148b6aad7c3281b1aa36e527906920ca0ffc651d3e1b7aa575ef03e5aeb3be23e074c518857812f7d6706032eef1bd9dc81
6
+ metadata.gz: 207e53bfebdb3366977a9f56546b8d7e83568ce4e459e09c877d377f3b874e219bf0c987db42fb113d0f03ea2501d91376cce1fa0566d157ca1bdbd42570724b
7
+ data.tar.gz: e46deb249c95770f16782918482c391a475e926936a12670c98fb86e7b5941c7b7596fda39b427ae69541e56dd0b4eef0a178482b28a2f3148687282a58f951f
data/doc/text/news.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 1.6.1: 2023-08-11
4
+
5
+ ### Improvements
6
+
7
+ * `--n-workers`: Use the max number of cores by default.
8
+
3
9
  ## 1.6.0: 2023-07-21
4
10
 
5
11
  ### Improvements
@@ -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") do |n|
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 = 1
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"
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module Grntest
17
- VERSION = "1.6.0"
17
+ VERSION = "1.6.1"
18
18
  end
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.0
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-07-21 00:00:00.000000000 Z
12
+ date: 2023-08-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diff-lcs