ocg 1.1.0 → 1.1.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: 407fbf8ade0a64e99df181ec0dde4cb4f5a56f351c00349de8f6988a7734c925
4
- data.tar.gz: ba84a5d347fea273ce75b7a5430d7af07419490e6fc0168e015c1f5cb28053d7
3
+ metadata.gz: e83ab5f4d11bb896232eec11899760bad56e796defdd58cdb85c924bdd76b1f7
4
+ data.tar.gz: 589806f0286556ef6f821e6f75041bf4b08732f09d6428f7fb1c36f8f47234c0
5
5
  SHA512:
6
- metadata.gz: e5027cffb24ee8fb5ea204a589cdd1dcebb21f123381f1b42c1c883968f1486901e8ac14b4b183dc4dac11237dcbbd9eb442e0ee4d823ff9ad7b73cc6a8f1805
7
- data.tar.gz: 23aec63119a3b2e37bedb47478e4ae4db5efe179624725baee7505a76d3f1cf503b41252ecc258e6e4c1e2a1c69fd777c301e7e573ba0d81763beb3dc0325b5e
6
+ metadata.gz: cc0a06788380a7c01e893456f9878ac753c557f4b378ea5b77399010fd3e132056cc39fce6a9b18f647e04c0f621b6b43bd3686ddf8bd623badf59008b8eed8c
7
+ data.tar.gz: bac8c658e3682d2ddf4d18ed7aaa7a175c23065fc63f4871d582150f9f4c48964c749b4b6b1531a923929a361443a6b66100ff37234e80159b164d875a2774ce
data/README.md CHANGED
@@ -1,9 +1,8 @@
1
1
  # Option combination generator
2
2
 
3
- [![Travis test status](https://travis-ci.org/andrew-aladev/ocg.svg?branch=master)](https://travis-ci.org/andrew-aladev/ocg)
4
- [![AppVeyor test status](https://ci.appveyor.com/api/projects/status/github/andrew-aladev/ocg?branch=master&svg=true)](https://ci.appveyor.com/project/andrew-aladev/ocg/branch/master)
5
- [![Cirrus test status](https://api.cirrus-ci.com/github/andrew-aladev/ocg.svg?branch=master)](https://cirrus-ci.com/github/andrew-aladev/ocg)
6
- [![Circle test status](https://circleci.com/gh/andrew-aladev/ocg/tree/master.svg?style=shield)](https://circleci.com/gh/andrew-aladev/ocg/tree/master)
3
+ | Travis | AppVeyor | Cirrus | Circle |
4
+ | :---: | :---: | :---: | :---: |
5
+ | [![Travis test status](https://travis-ci.com/andrew-aladev/ocg.svg?branch=master)](https://travis-ci.com/andrew-aladev/ocg) | [![AppVeyor test status](https://ci.appveyor.com/api/projects/status/github/andrew-aladev/ocg?branch=master&svg=true)](https://ci.appveyor.com/project/andrew-aladev/ocg/branch/master) | [![Cirrus test status](https://api.cirrus-ci.com/github/andrew-aladev/ocg.svg?branch=master)](https://cirrus-ci.com/github/andrew-aladev/ocg) | [![Circle test status](https://circleci.com/gh/andrew-aladev/ocg/tree/master.svg?style=shield)](https://circleci.com/gh/andrew-aladev/ocg/tree/master) |
7
6
 
8
7
  ## Installation
9
8
 
@@ -40,9 +39,7 @@ generator = OCG.new(
40
39
  :h => 7..8
41
40
  )
42
41
 
43
- until generator.finished?
44
- puts generator.next
45
- end
42
+ puts generator.next until generator.finished?
46
43
  ```
47
44
 
48
45
  It will populate all option combinations.
@@ -91,6 +88,7 @@ You can combine generators using `and`, `mix` and `or`.
91
88
  Many software uses multiple options and have complex relations between them.
92
89
  We want to test this software.
93
90
  We need to provide optimal option combination to maximize test coverage.
91
+ The amount of combinations can be more than billion, it is not possible to store them (fuzzing testing).
94
92
 
95
93
  Let's look at [zstd compressor options](http://facebook.github.io/zstd/zstd_manual.html#Chapter5).
96
94
 
@@ -104,7 +102,7 @@ general_generator = OCG.new(
104
102
  )
105
103
  .or(
106
104
  :windowLog => 0..10,
107
- :hashLog => 0..10,
105
+ :hashLog => 0..10,
108
106
  ...
109
107
  )
110
108
  ```
@@ -118,8 +116,8 @@ ldm_generator = OCG.new(
118
116
  )
119
117
  .or(
120
118
  :enableLongDistanceMatching => [true],
121
- :ldmHashLog => 0..10,
122
- :ldmMinMatch => 0..10,
119
+ :ldmHashLog => 0..10,
120
+ :ldmMinMatch => 0..10,
123
121
  ...
124
122
  )
125
123
  ```
@@ -132,29 +130,30 @@ main_generator = general_generator.and ldm_generator
132
130
  ```
133
131
 
134
132
  `contentSizeFlag`, `checksumFlag`, `dictIDFlag` options are additional options.
135
- These options don't correlate between each other or with main options.
136
- We want just to mix their values with main options.
133
+ These options may correlate between each other but don't correlate with main options.
137
134
 
138
135
  ```ruby
139
136
  almost_complete_generator = main_generator.mix(
140
- :contentSizeFlag => [true, false]
141
- )
142
- .mix(
143
- :checksumFlag => [true, false]
144
- )
145
- .mix(
146
- :dictIDFlag => [true, false]
137
+ :contentSizeFlag => [true, false],
138
+ :checksumFlag => [true, false],
139
+ :dictIDFlag => [true, false]
147
140
  )
148
141
  ```
149
142
 
150
143
  `nbWorkers`, `jobSize` and `overlapLog` options are thread related options.
144
+ When `nbWorkers` equals `0`, `jobSize` and `overlapLog` should not be used.
151
145
  These options correlate between each other but don't correlate with main options.
152
146
 
153
147
  ```ruby
154
148
  complete_generator = almost_complete_generator.mix(
155
- :nbWorkers => 0..2,
156
- :jobSize => 1..10,
157
- :overlapLog => 0..9
149
+ OCG.new(
150
+ :nbWorkers => [0]
151
+ )
152
+ .or(
153
+ :nbWorkers => 1..2,
154
+ :jobSize => 1..10,
155
+ :overlapLog => 0..9
156
+ )
158
157
  )
159
158
  ```
160
159
 
@@ -9,7 +9,7 @@ class OCG
9
9
  def initialize(*args)
10
10
  super
11
11
 
12
- @main_generator = \
12
+ @main_generator =
13
13
  if @right_generator.length > @left_generator.length
14
14
  @right_generator
15
15
  else
@@ -2,5 +2,5 @@
2
2
  # Copyright (c) 2019 AUTHORS, MIT License.
3
3
 
4
4
  class OCG
5
- VERSION = "1.1.0".freeze
5
+ VERSION = "1.1.1".freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Aladjev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-27 00:00:00.000000000 Z
11
+ date: 2019-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest