[question] test_requires in conanfile.txt
I've mistakenly used [build_requires] for gbench framework until I tried to compare my implementation to boost and found #9951 issue. If I understand correctly force_host_context has been deprecated. And I don't know how to specify it inside .txt, if at all possible.
Should I use regular [requires] for test and benchmark frameworks like gtest and gbench? Or does it make sense to add [test_requires] section to conanfile.txt?
Hi @magras
Yes, for a simple conanfile.txt, a requirement to a test library, like gtest or catch, is completely equivalent to a regular requires, so it can go directly in the [requires] section (and it shouldn't go in the [tool_requires], because the behavior will be different).
We might eventually add a [test_requires] section, but it would be purely syntactic sugar, no functional difference. Will put this for discussion for 2.X
Thank you for your answer.
Will put this for discussion for 2.X
Then I'll leave this issue open for now.
Would a [test_requires] section be equivalent to a test_requires attribute in the conanfile.py ?
tool_requires has an attribute, but seemingly a test_requires attribute is also missing there too.
We finally did implement [test_requires] in conanfile.txt, it is already part of the released 2.0.
Closing this as resolved, feedback welcome.