|
1 | 1 | # atoum/config-extension [](https://travis-ci.org/atoum/config-extension)
|
2 | 2 |
|
3 |
| - |
| 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 | +``` |
4 | 16 |
|
5 | 17 | ## Install it
|
6 | 18 |
|
7 | 19 | Install extension using [composer](https://getcomposer.org):
|
8 | 20 |
|
9 |
| -```json |
10 |
| -{ |
11 |
| - "require-dev": { |
12 |
| - "atoum/config-extension": "~1.0" |
13 |
| - }, |
14 |
| -} |
15 |
| - |
| 21 | +``` |
| 22 | +composer require --dev atoum/config-extension |
16 | 23 | ```
|
17 | 24 |
|
18 | 25 | Enable the extension using atoum configuration file:
|
@@ -51,5 +58,187 @@ atoum:
|
51 | 58 | reports:
|
52 | 59 | - default
|
53 | 60 | - report.coverage.clover
|
| 61 | +``` |
| 62 | +
|
| 63 | +## Configuration reference |
| 64 | +
|
| 65 | +### atoum.loop |
54 | 66 |
|
| 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 |
55 | 74 | ```
|
| 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 | + |
0 commit comments