Summary: | Document BDEPEND and its interaction with test dependencies | ||
---|---|---|---|
Product: | Documentation | Reporter: | Michael Orlitzky <mjo> |
Component: | Devmanual | Assignee: | Gentoo Devmanual Team <devmanual> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | aklhfex, flow, gentoo, mgorny |
Priority: | Normal | Keywords: | NeedPatch |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Michael Orlitzky
2019-09-09 14:32:34 UTC
(In reply to Michael Orlitzky from comment #0) > But even from that, it's not clear where test dependencies should go. Are > they run during the build (on the build host), or during install (on the > target host)? Test dependencies are not different from other build-time dependencies. If src_test() executes some executables from package X, then X should be in BDEPEND: BDEPEND="... test? ( X )" If src_test() builds its own executables (or src_compile() does it conditionally on "test" USE flag) and these executables require headers/libraries from package Y, then Y should be in DEPEND: DEPEND="... test? ( Y )" Real examples of tests-related packages which should be in DEPEND: dev-cpp/gtest dev-libs/check dev-qt/qttest (There may be some situations when tests-related package should be in both BDEPEND and DEPEND.) (In reply to Arfrever Frehtes Taifersar Arahesis from comment #1) > > If src_test() builds its own executables (or src_compile() does it > conditionally on "test" USE flag) and these executables require > headers/libraries from package Y, then Y should be in DEPEND: > > DEPEND="... test? ( Y )" > I think it would be highly beneficial to enumerate the common cases. For example: I'm building a binary, command-line tool. Its test suite consists of running the tool on some example input, and checking the output. What should {,R,B}DEPEND look like? In that situation, the "test executable" is the regular executable. If it's linked to zlib, shouldn't zlib be in BDEPEND too, since the tool that's linked to zlib will be run on the build host? Or does putting it only in DEPEND suffice? (In reply to Arfrever Frehtes Taifersar Arahesis from comment #1) > If src_test() builds its own executables (or src_compile() does it > conditionally on "test" USE flag) Intention of test suite is to early check if given package is expected to work after installation to target system (CHOST). During crosscompilation, these executables usually cannot be run on host system (CBUILD). If full correctness in ebuilds was intended, then something like this would be needed: RESTRICT="crosscompilation? ( test ) !test? ( test )" |