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

Install the common test executables to libexec #458

Merged
merged 5 commits into from
Dec 12, 2022

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Dec 2, 2022

🎉 New feature

Part of #50 (comment)

Summary

This installs the COMMON_TEST_* executables to a subfolder of libexec following the pattern used by the standalone executables added in gazebosim/gz-transport#216. This will allow these tests to be used by external implementers of gz-physics plugins. The test_lib_loader library is changed to a static library as well since these executables link against it.

Remaining tasks:

  • Install resources folder used by some tests
  • Install worlds folder used by some tests
  • Provide cmake helper for adding tests to downstream projects using these executables

Test it

  • Build and install this branch
  • Run <prefix>/libexec/gz/physics6/COMMON_TEST_construct_empty_world <prefix>/lib/libgz-physics6-dartsim-plugin.<suffix>

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

This makes the cmake code more readable.

Signed-off-by: Steve Peters <[email protected]>
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Dec 2, 2022
@codecov
Copy link

codecov bot commented Dec 2, 2022

Codecov Report

Merging #458 (18f950c) into gz-physics6 (bf4cc20) will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff              @@
##           gz-physics6     #458   +/-   ##
============================================
  Coverage        75.82%   75.82%           
============================================
  Files              140      140           
  Lines             7066     7066           
============================================
  Hits              5358     5358           
  Misses            1708     1708           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@scpeters scpeters force-pushed the scpeters/install_common_tests branch from 049886a to 79b5727 Compare December 2, 2022 23:41
Also build the test_lib_loader as static library since the
tests link against it.

Signed-off-by: Steve Peters <[email protected]>
@scpeters scpeters force-pushed the scpeters/install_common_tests branch from 79b5727 to 45ddfac Compare December 8, 2022 22:06
@scpeters
Copy link
Member Author

scpeters commented Dec 8, 2022

I've updated TestLibLoader.hh to be header-only in 57ec5eb, hoping that this fixes our windows CI issues

@scpeters scpeters marked this pull request as ready for review December 9, 2022 00:44
@scpeters
Copy link
Member Author

scpeters commented Dec 9, 2022

this is ready for review

}
}

std::string gz::physics::TestLibLoader::libToTest = std::string("");
Copy link
Contributor

Choose a reason for hiding this comment

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

Defining a static variable in a header can be problematic. I recommend putting the variable in a private function and make it a singleton.

private: static std::string& TestLibLoader::LibToTest() 
{
  static std::string libToTest = "";
  return libToTest;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

how does 18f950c look?

@scpeters scpeters merged commit 095b064 into gz-physics6 Dec 12, 2022
@scpeters scpeters deleted the scpeters/install_common_tests branch December 12, 2022 23:16
scpeters added a commit to gazebo-release/gz-physics6-release that referenced this pull request Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants