Skip to content
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

Add cpputest/4.0 #4366

Merged
merged 51 commits into from
Feb 8, 2021
Merged

Conversation

claremacrae
Copy link
Contributor

Specify library name and version: cpputest/4.0

See #4365

  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@conan-center-bot

This comment has been minimized.

@claremacrae
Copy link
Contributor Author

This is work-in-progress. The test package builds, but there are many, many options in cpputest that need to be added here.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@claremacrae
Copy link
Contributor Author

Sorry for the number of build errors... I've changed my instructions to make sure that in future I build with CONAN_HOOK_ERROR_LEVEL=40

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

recipes/cpputest/all/conanfile.py Outdated Show resolved Hide resolved
recipes/cpputest/all/conanfile.py Outdated Show resolved Hide resolved
Comment on lines 84 to 85
self._cmake.definitions["COVERAGE"] = self.options.coverage
self._cmake.definitions["TESTS"] = self.options.tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think consumer from CCI need this to be tested or produce coverage results...

https://github.com/cpputest/cpputest/blob/d14505cc9191fcf17ccbd92af1c3409eb3969890/CMakeLists.txt#L73

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I think I've addressed this in a43fa98 - is that what you meant?

tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
tools.rmdir(os.path.join(self.package_folder, "lib", "CppUTest", "cmake"))

def package_info(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to explicitly set the pkg_config names

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure that I understand that, but I have improved code in this area in e8ee75a.

If that's not what you mean, please can I have a bit more info?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need file name ... the default is names

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def package_info(self):
Self.cpp_info.names["pkg_config"] = "whatever the .pc file is that's removed"

Via mobile ⚠️

conan_basic_setup()

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there are CMake names it's ideal if you test those here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Please could you clarify what I need to do?

(Like much of the code in this PR, I took this from the corresponding file in the szip project that's recommended as a good sample, in the How to provide a good recipe section in the docs on adding new recipes...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to the CCI club 🤝

I am suggestion adding the find_package and link to the cmake targets called out in the package info.

find_package(Backport REQUIRED CONFIG)
add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} Backport::Backport)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you ever so much - this was really helpful to learn about.

I think I have fixed it in e8ee75a.

claremacrae and others added 2 commits January 27, 2021 15:09
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@claremacrae
Copy link
Contributor Author

claremacrae commented Feb 4, 2021

Note for reviewers:

My remaining concerns are around the implementations of some of the options - I think that the CppUTest library has a bunch of logic in their CMake around the options that I am not reproducing in package_info() - so I think there is a danger that I might be modifying the building of the libraries correctly, but not the consuming of them.

I've asked for feedback on the Slack for this library, and will update here, if there's any reply - although it seems to be quite quiet.

I'm thinking there's two main choices:

  1. Remove all the options except fPIC and with_extensions, and wait to see if any users ask for control
  2. Leave all the options in (because it's possible some of them may just work correctly), and see if any users report any bugs with the consuming of any of the options.

I would appreciate knowing the preferences of reviewers between 1 and 2.

@claremacrae claremacrae marked this pull request as ready for review February 4, 2021 11:24
@claremacrae claremacrae changed the title cpputest/4.0 Add cpputest/4.0 Feb 4, 2021
@conan-center-bot

This comment has been minimized.

@uilianries
Copy link
Member

I vote 1

I prefer to keep it simple now and update when asked.Many packages that we have only offer part of options and people don't ask about new options.

@claremacrae
Copy link
Contributor Author

claremacrae commented Feb 4, 2021

I vote 1

Thanks... I've pushed that change.

I left in the empty configure() method, with just a pass statement, as I suspect that it will get re-populated in future, and I see that the order of methods is important.

Please do so if you would prefer it removed...

Update - now removed, thanks to feedback from @prince-chrismc

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@claremacrae
Copy link
Contributor Author

Just a quick update - all the tasks in my checklist - above are now either done, or rejected as no longer relevant....

I've made all the changes requested so far in code review - thanks - and so, as far as I know, this is now ready for a final review... :-) 🎉 🤞

Copy link
Contributor

@prince-chrismc prince-chrismc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

prince-chrismc
prince-chrismc previously approved these changes Feb 5, 2021
recipes/cpputest/all/conanfile.py Outdated Show resolved Hide resolved
recipes/cpputest/all/conanfile.py Outdated Show resolved Hide resolved
Co-authored-by: Uilian Ries <uilianries@gmail.com>
@conan-center-bot
Copy link
Collaborator

All green in build 33 (9108346e5cc91624a9954ee21c76fe8e4c2ec74c)! 😊

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants