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 Fortran interface tests #89

Merged
merged 14 commits into from
Aug 30, 2023
Merged

Add Fortran interface tests #89

merged 14 commits into from
Aug 30, 2023

Conversation

benegee
Copy link
Collaborator

@benegee benegee commented Aug 28, 2023

Resolves #82

CMakeLists.txt Outdated Show resolved Hide resolved
Co-authored-by: Michael Schlottke-Lakemper <michael@sloede.com>
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Patch coverage has no change and project coverage change: +2.38% 🎉

Comparison is base (c75552d) 95.81% compared to head (c1f5b43) 98.20%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #89      +/-   ##
==========================================
+ Coverage   95.81%   98.20%   +2.38%     
==========================================
  Files          12       12              
  Lines         502      500       -2     
==========================================
+ Hits          481      491      +10     
+ Misses         21        9      -12     
Flag Coverage Δ
unittests 98.20% <ø> (+2.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/api.c 100.00% <ø> (+4.39%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benegee
Copy link
Collaborator Author

benegee commented Aug 29, 2023

Finally!

Coverage is looking good as well. New "issues":

void trixi_initialize(const char * project_directory, const char * depot_path) {
    // Prevent double initialization and initialization after finalization
    if (is_initialized) {
        print_and_die("trixi_initialize invoked multiple times", LOC);
    }
    if (is_finalized) {
        print_and_die("trixi_initialize invoked after trixi_finalize", LOC);
    }

The second safeguard is never reached, because is_finalized can only be set in finalize, and finalize can only run if is_initialized is set.

  1. As expected, the Fortran interface definition is not captured.

  2. Multi-Line statements in Fortran (with &) are not correctly handled.

  3. test/fortran is checked for coverage (which is not really useful),
    test/c is not (maybe due to gtest magic creating executables out of nowhere?)

@benegee benegee requested a review from sloede August 29, 2023 15:57
@benegee benegee linked an issue Aug 29, 2023 that may be closed by this pull request
@sloede
Copy link
Member

sloede commented Aug 29, 2023

The second safeguard is never reached

Good point! Can you please remove the second check?

As expected, the Fortran interface definition is not captured.

Too bad, but nothing we can do here, I guess, but to remain vigilant ourselves.

test/fortran is checked for coverage (which is not really useful),
test/c is not (maybe due to gtest magic creating executables out of nowhere?)

Can you exclude test from coverage reporting?

@benegee benegee enabled auto-merge (squash) August 30, 2023 05:38
@benegee
Copy link
Collaborator Author

benegee commented Aug 30, 2023

All done! Excluding feels a little like cheating, but coverage increased!

Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

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

Great work 🥳

@benegee benegee merged commit b4f6dec into main Aug 30, 2023
9 checks passed
@benegee benegee deleted the bg/fortran-tests branch August 30, 2023 06:51
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.

Fortran Tests Improve coverage
2 participants