Skip to content
Snippets Groups Projects

[Fortran] Unittests with FortUTF

Merged Jonas Jucker requested to merge fortran_tests into master

Merge request reports

Pipeline #39630 passed

Pipeline passed for 7f422bd6 on fortran_tests

Approval is optional

Merged by Jonas JuckerJonas Jucker 1 year ago (Jul 11, 2023 6:55am UTC)

Merge details

  • Changes merged into master with 8993d623 (commits were squashed).
  • Deleted the source branch.

Pipeline #39649 passed

Pipeline passed for 8993d623 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 1 SET(PROJECT_NAME fortran_support)
  • I wonder what it will take to come up with a minimal reproducer of a problem identified with one of the tests (e.g. in order to submit it to a compiler vendor). There is a single executable for all tests if I am not mistaken. If one of the tests fails, the whole executable fails and the output of make test won't tell me much. I will have to dig deeper just to identify the failed test. Am I correct? I might be too conservative but I prefer having a separate executable for each individual test.

    To be honest, I am not convinced that FortUTF is the way to go. Why don't we just extend the helpers.f90 with ASSERT_EQUAL and friends and just use it as a library in separate executables? All those GLOBs and REGEX MATCHALLs look fishy to me, to be honest.

    • Author Maintainer

      You can run the test-exe from FortUTF. It dumps you the tests that fail, see https://pad.gwdg.de/WLGZz0LKSJmvqUrEbNkCug?view#FortUTF

      That's the way FortUTF is designed!

      About your general critisism: We documented our decision quite well here https://pad.gwdg.de/WLGZz0LKSJmvqUrEbNkCug?# and here https://gitlab.dkrz.de/icon/icon-c/-/issues/67

      Your feedback is very welcome but a bit late.

      Of course we could come up with our own solution, but do YOU have time to do that? I don't! Also I personally liked some features of FortUTF like the test-collection and the relatively easy CMake-integration. And would our solution really be much better then FortUTF? I doubt.

      But as you see in the tests, not much infrastructure is needed by FortUTF. Basically only the asserts need to be adapted to another framework. And this portability was also a plus to choose fortutf. I.e. pfunit comes along with its own fortra-decorator and preprocessor, this makes a transition much harder.

    • You can run the test-exe from FortUTF. It dumps you the tests that fail, see https://pad.gwdg.de/WLGZz0LKSJmvqUrEbNkCug?view#FortUTF

      So, an extra digging step if something goes wrong.

      That's the way FortUTF is designed!

      Yes, it's the design that I question. Or, at least, the applicability of the tool that is designed that way. I'm not saying that it's a show-stopper but just a drawback that I expect to be compensated with the benefits of the tool.

      About your general critisism: We documented our decision quite well here https://pad.gwdg.de/WLGZz0LKSJmvqUrEbNkCug?# and here https://gitlab.dkrz.de/icon/icon-c/-/issues/67

      Thank you for the links, I will go over them one more time. Hopefully, I'll find the answer there.

      Your feedback is very welcome but a bit late.

      Does it make it invalid?

      Of course we could come up with our own solution, but do YOU have time to do that? I don't!

      It's always about the cost/benefit ratio. The question is whether you have time to support the dependency that you want to introduce. Fix bugs, create PRs, make sure they get merged, etc. If not, you implicitly put this on other people who, most probably, will find it much easier for the code that is under the community's control.

      Also I personally liked some features of FortUTF like the test-collection and the relatively easy CMake-integration.

      And right away we have to circumvent the PROJECT_NAME issue.

      And would our solution really be much better then FortUTF? I doubt.

      I am sorry but at least the CMake part does not really look like a high bar to clear.

      But as you see in the tests, not much infrastructure is needed by FortUTF. Basically only the asserts need to be adapted to another framework. And this portability was also a plus to choose fortutf. I.e. pfunit comes along with its own fortra-decorator and preprocessor, this makes a transition much harder.

      I trust that FortUTF is the best tool for our needs out there. However, the best does not mean good but just that all the others are worse. Again, I'm not saying that you should discard all your work and close this MR, I'm just making you aware of certain potential issues that I have in mind.

    • Author Maintainer

      Why not using ctest --output-on-failure instead of make test?

      This makes an extra step obsolete.

      Your feedback is valid of course. I appreciate that you take your time and really dig to the bottom of things. Your ideas help to improve things a lot.

      We discussed the maintenance as well. Conclusion was, that FortUTF is still simple, so I think I could fix small things in this repo. For other frameworks this isn't the case.

      I can't judge the CMake-scripting, still a bloody beginner in this domain.

      The option for Fortran unittesting aren't great, I agree.

      I think we have to make some experiences and see how things evolve. Maybe FortUTF turn into a nightmare, then we need to evaluate again.

    • Please register or sign in to reply
  • Jonas Jucker added 1 commit

    added 1 commit

    • 52169e2c - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Jonas Jucker added 1 commit

    added 1 commit

    • 01704bde - rename FortUTF to fortran, remove extra src-folder for tests

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading