Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 735570 | Differences between
and this patch

Collapse All | Expand All

(-)a/ebuild-writing/functions/src_test/text.xml (-49 / +52 lines)
Lines 62-67 src_test() { Link Here
62
</body>
62
</body>
63
</section>
63
</section>
64
64
65
<section>
66
<title>Supporting test suites in packages</title>
67
<body>
68
<p>
69
If the packaged software is equipped with a test suite, it is sensible
70
to make the package aware of it. This allows the package manager to
71
run the software's unit tests. Packages with a test suite must
72
announce the "test" USE flag.
73
</p>
74
<codesample lang="ebuild">
75
IUSE="test"
76
</codesample>
77
<p>
78
The next important aspect to consider are test-only dependencies,
79
i.e. dependencies that are only required to run the test
80
suite. Test-only dependencies should be specified in a DEPEND behind a
81
USE flag. Please refer to the section on <uri
82
link="::general-concepts/dependencies/#Test Dependencies"/> for more
83
information.
84
</p>
85
<p>
86
Often the default <c>src_test</c> is fine. Sometimes it is necessary
87
to remove certain tests from the list if they cannot be used with a
88
portage environment. Reasons for such a failure could include:
89
</p>
90
<ul>
91
  <li>
92
    Needing to work with files which are disallowed by the sandbox.
93
  </li>
94
  <li>Requiring user input (<c>src_test</c> must not be interactive).</li>
95
  <li>Requiring root privileges.</li>
96
</ul>
97
<p>
98
Usually, removing the relevant test from the <c>Makefile</c>
99
using <c>sed</c> or skipping a particular <c>make</c> target is
100
sufficient.
101
</p>
102
<p>
103
Try to ensure that tests work properly for your ebuild. A good test
104
suite is extremely helpful for arch maintainers.
105
Sometimes it is necessary to skip tests entirely. This can be done by
106
setting <c>RESTRICT="test"</c> in the ebuild.
107
</p>
108
<note>
109
If upstream provides a test suite that doesn't work, consider talking
110
to them about getting it fixed. A broken test suite requires developers
111
to investigate each test failure in order to determine whether it is
112
genuine or indicates a broken test.
113
</note>
114
</body>
115
</section>
116
65
<section>
117
<section>
66
<title>Tests that require network or service access</title>
118
<title>Tests that require network or service access</title>
67
<body>
119
<body>
Lines 207-259 src_test() { Link Here
207
</body>
259
</body>
208
</section>
260
</section>
209
261
210
<section>
211
<title>Common <c>src_test</c> Tasks</title>
212
<body>
213
<p>
214
Often the default <c>src_test</c> is fine. Sometimes it is necessary
215
to remove certain tests from the list if they cannot be used with a
216
portage environment. Reasons for such a failure could include:
217
</p>
218
219
<ul>
220
  <li>
221
    Needing to work with files which are disallowed by the sandbox.
222
  </li>
223
  <li>Requiring user input (src_test must not be interactive).</li>
224
  <li>Requiring root privileges.</li>
225
</ul>
226
227
<p>
228
Usually, removing the relevant test from the <c>Makefile</c>
229
using <c>sed</c> or skipping a particular <c>make</c> target is
230
sufficient.
231
</p>
232
233
<p>
234
Try to ensure that tests work properly for your ebuild. A good test
235
suite is extremely helpful for arch maintainers.
236
</p>
237
238
</body>
239
</section>
240
241
<section>
242
<title>Skipping Tests</title>
243
<body>
244
<p>
245
Sometimes it is necessary to skip tests entirely. This can be done by
246
setting <c>RESTRICT="test"</c> in the ebuild.
247
</p>
248
249
<note>
250
If upstream provides a test suite that doesn't work, consider talking
251
to them about getting it fixed. A broken test suite requires developers
252
to investigate each test failure in order to determine whether it is
253
genuine or indicates a broken test.
254
</note>
255
</body>
256
</section>
257
258
</chapter>
262
</chapter>
259
</guide>
263
</guide>
260
- 

Return to bug 735570