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

Fix fetch method causing test-drive tests to be included in CTest list #18

Merged
merged 2 commits into from
Jun 4, 2022

Conversation

topherocity
Copy link
Contributor

Good evening folks,

Thanks for all the work you are doing to reviving Fortran into a more modern language!

I'm attempting to add some unit testing to a rather old Fortran code base using CMake, and followed the steps shown in this repository for integrating test-drive into my project. However, I noticed rather quickly that the tests from test-drive were making it into my own project testing and failing:

$ make all test
...
25% tests passed, 3 tests failed out of 4

Total Test time (real) =   0.01 sec

The following tests FAILED:
          2 - test-drive/all-tests (Not Run)
          3 - test-drive/check (Not Run)
          4 - test-drive/select (Not Run)

I don't think this happens on the cmake and pkgconf methods in Findtest-drive.cmake, because both of those are installed paths with no mention of tests.

This pull request fixes this by defining a TEST_DRIVE_BUILD_TESTING option that will not be defined if test-drive is linked to after FetchContent.

@codecov
Copy link

codecov bot commented May 27, 2022

Codecov Report

Merging #18 (58143b3) into main (a1ab785) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #18   +/-   ##
=======================================
  Coverage   71.51%   71.51%           
=======================================
  Files           2        2           
  Lines         481      481           
  Branches      296      296           
=======================================
  Hits          344      344           
  Misses         23       23           
  Partials      114      114           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1ab785...58143b3. Read the comment docs.

Copy link
Member

@awvwgk awvwgk left a comment

Choose a reason for hiding this comment

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

Thanks for sharing. Added a minor change to also include BUILD_TESTING

@awvwgk awvwgk merged commit 68e22b8 into fortran-lang:main Jun 4, 2022
@certik
Copy link
Member

certik commented Jun 5, 2022

@topherocity Thanks for the PR! If you have more improvements, definitely let us know.

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.

3 participants