Skip to content

Commit d248896

Browse files
authored
Merge pull request #7 from agallou/improve_readme
Improve README
2 parents 06a20a6 + 784fc16 commit d248896

File tree

1 file changed

+197
-8
lines changed

1 file changed

+197
-8
lines changed

README.md

Lines changed: 197 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
# atoum/config-extension [![Build Status](https://travis-ci.org/atoum/config-extension.svg?branch=master)](https://travis-ci.org/atoum/config-extension)
22

3-
![atoum](http://atoum.org/images/logo/atoum.png)
3+
This extension will allow you to configure atoum using a YAML file and/or environnement variables.
4+
5+
## Example
6+
7+
When using this extension, you can put a `.atoum.yml` on the root of your repository to configure atoum. Here is an exemple on how to tell atoum to look for unit tests in the `tests/units/classes` folder.
8+
9+
```yaml
10+
# .atoum.yml
11+
12+
atoum:
13+
directories:
14+
- ./tests/units/classes
15+
```
416
517
## Install it
618
719
Install extension using [composer](https://getcomposer.org):
820
9-
```json
10-
{
11-
"require-dev": {
12-
"atoum/config-extension": "~1.0"
13-
},
14-
}
15-
21+
```
22+
composer require --dev atoum/config-extension
1623
```
1724

1825
Enable the extension using atoum configuration file:
@@ -51,5 +58,187 @@ atoum:
5158
reports:
5259
- default
5360
- report.coverage.clover
61+
```
62+
63+
## Configuration reference
64+
65+
### atoum.loop
5466
67+
`boolean` : enable/disable atoum's [loop mode](http://docs.atoum.org/en/latest/mode-loop.html). Defaults on `ATOUM_LOOP` environnement variable.
68+
69+
Exemple:
70+
71+
```
72+
atoum:
73+
loop: true
5574
```
75+
76+
### atoum.debug
77+
78+
`boolean` : enable/disable atoum's [debug mode](http://docs.atoum.org/en/latest/mode-debug.html). Defaults on `ATOUM_DEBUG` environnement variable.
79+
80+
Exemple:
81+
82+
```
83+
atoum:
84+
debug: true
85+
```
86+
87+
### atoum.verbosity
88+
89+
`integer` : value between 1 and 3 determining atoum's verbosity level'. Defaults on `ATOUM_VERBOSITY` environnement variable.
90+
91+
Exemple:
92+
93+
```
94+
atoum:
95+
verbosity: 2
96+
```
97+
98+
### atoum.directories
99+
100+
`array` : List of directories where atoum will look for unit tests. Defaults on `ATOUM_DIRECTORIES` environnement variable (a coma separated list of directories).
101+
102+
```yaml
103+
atoum:
104+
directories:
105+
- ./tests/units/classes
106+
```
107+
108+
### atoum.reports
109+
110+
`array` : List of reports. Defaults on `ATOUM_REPORTS` environnement variable (a coma separated list of reports).
111+
112+
Example:
113+
114+
```yaml
115+
atoum:
116+
reports:
117+
- default
118+
- report.coverage.clover
119+
```
120+
121+
Possible values :
122+
123+
#### default
124+
125+
adds atoum's default reporter (when the reports key is defined, atoum's default reporter is no longer used).
126+
127+
#### report.coverage.clover
128+
129+
Adds a clover [coverage reporter](http://docs.atoum.org/en/latest/configuration_bootstraping.html#code-coverage).
130+
131+
Path to were the report will be written could be configured using the [coverage.clover.filename](#coveragecloverfilename) parameter.
132+
133+
#### report.xunit
134+
135+
Adds an [xUnit reporter](http://docs.atoum.org/en/latest/configuration_bootstraping.html#using-standard-reports).
136+
137+
Path to were the report will be written could be configured using the [xunit.filename](#xunitfilename) parameter.
138+
139+
#### report.tap
140+
141+
Adds a [TAP reporter](http://docs.atoum.org/en/latest/configuration_bootstraping.html#using-standard-reports).
142+
143+
#### report.vim
144+
145+
Adds a [vim reporter](http://docs.atoum.org/en/latest/configuration_bootstraping.html#using-standard-reports).
146+
147+
##### report.nyancat
148+
149+
Adds a reporter that displays a nyancat.
150+
151+
#### report.santa
152+
153+
Adds a [santa reporter](http://docs.atoum.org/en/latest/configuration_bootstraping.html#having-fun-with-atoum).
154+
155+
156+
### atoum.fields
157+
158+
Fields allows you to customize reports.
159+
You can add fields for each report.
160+
161+
You need to add the report name as key, then add an array of fields.
162+
163+
This example adds the logo field to the default report :
164+
165+
```yaml
166+
atoum:
167+
reports:
168+
- default
169+
170+
fields:
171+
default:
172+
- field.logo
173+
```
174+
175+
#### field.logo
176+
177+
Displays atoum's logo at the begining of the report.
178+
Only works on cli reports.
179+
180+
#### field.logo.result
181+
182+
Displays atoum's logo at the end of the report.
183+
Only works on cli reports.
184+
185+
#### field.coverage.html
186+
187+
Generate an HTML coverage reports.
188+
Needs the php extension `xdebug` to be installed.
189+
190+
The project name in generated report and folder where the report will be generated could by configured with the [project.name](#projectname) and [coverage.html.directory](#coveragehtmldirectory) and parameters.
191+
192+
193+
### parameters
194+
195+
You can customize the way reports or fields are generated using the `parameters` section on the `.atoum.yml` file.
196+
197+
Here is an example that changes the path where the xunit report is generated:
198+
199+
```yaml
200+
atoum:
201+
reports:
202+
- report.xml
203+
parameters:
204+
xunit.filename: "mylogs/file.xml"
205+
```
206+
207+
#### xunit.filename
208+
209+
Default value : `xunit.xml`.
210+
211+
Path were the xUnit report will be written in the [report.xunit](#reportxunit) report.
212+
213+
The directory where the file is generated must exists, it will not be created by atoum.
214+
215+
#### coverage.html.directory
216+
217+
Default value : `./coverage`.
218+
219+
Path to the folder where the HTML coverage files will be written. See [field.coverage.html](#fieldcoveragehtml) field.
220+
221+
#### project.name
222+
223+
Default value : `atoum`.
224+
225+
Will be used when generating the [field.coverage.html](#fieldcoveragehtml) field.
226+
227+
228+
#### coverage.clover.filename
229+
230+
Default value : `clover.xml`.
231+
232+
Path where the clover report will be written in the [report.clover](#reportclover) report.
233+
234+
235+
## Links
236+
237+
* [atoum](http://atoum.org)
238+
* [atoum's documentation](http://docs.atoum.org)
239+
240+
## License
241+
242+
config-extension is released under the BSD-3-Clause License. See the bundled LICENSE file for details.
243+
244+
![atoum](http://atoum.org/images/logo/atoum.png)

0 commit comments

Comments
 (0)