-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test other generators: run several tests in test_*/conanfile.py #8389
Conversation
I detected other pull requests that are modifying fmt/all recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
As you can see in the table outputs, in the
cc/ @czoido @SSE4 @franramirez688 any suggestions about the project structure? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
what is the witchcraft which makes C3I run test_cmakedeps ? most of the contributors most likely just run |
@ericLemanissier , in C3i we run Of course, we will:
In this PR I'm interested in knowing if this is the best approach to test different generators, or we can figure out something better. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
We'll need to write some docs for this :) |
Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
project(test_package CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed because the same CMakeLists.txt
file is used from the test_cmakedeps/conanfile.py
and there we are not adding the cmake
generator.
IMO, it is important to reuse as much as possible the same project files.
Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
All green in build 29 ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing, a new step towards Conan 2.0
@prince-chrismc , can you review here again? Thanks! |
…nanfile.py * [poc] Test other generators: run several tests in test_*/conanfile.py * use new pattern to access info from dependencies * use rel path * fix import (1.43.1) * Update recipes/fmt/all/test_package/CMakeLists.txt Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * VS output path for CMakeDeps uses configuration type * make it a string * force output directory * force it for the configuration name \o/ * following team feedback, this should be the way to go * use cmake_layout explicitly * we can delegate the path to the source to the layout * Update recipes/fmt/all/test_cmakedeps/conanfile.py Co-authored-by: Uilian Ries <uilianries@gmail.com> * touch * touch * revert change * revert back, explained in PR review * Update recipes/fmt/all/test_cmakedeps/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * touch Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Co-authored-by: Uilian Ries <uilianries@gmail.com>
We are introducing several changes with Conan v2 in mind, the biggest effort and challenge will be to modify recipes to work with new features backported from Conan v2 while we ensure they keep working with current Conan version.
One of the things we need to be really sure that works is the logic behind the generators and
cpp_info
. The best way to do it is to actually run a test_package for them. For sure we can run everything in the sametest_package/conanfile.py
, but IMHO it would be much clear to have each generator being tested in its owntest_*
folder. We don't need to go crazy with it, neither add it to every single recipe, but it might be really useful for those that define some convolutedcpp_info.name/filename
and/orset_property
together with components.This is just a test and a proposal. The main point is that project files should be the same: same
CMakeLists.txt
, same.h/.cpp
files. Onlyconanfile.py
is different. Here I propose to keep this files in thetest_package
folder as it is the official one, while the other/s folder/s will just use sources from it.Let's hear the CI and the people. Wdyt?
Note.- This feature was already there, but not documented.