computablee / DotMP

A collection of powerful abstractions for parallel programming in .NET with an OpenMP-like API.
https://computablee.github.io/DotMP/
GNU Lesser General Public License v2.1
29 stars 8 forks source link

Better testing, exception handling, documentation, remove dead code #89

Closed computablee closed 11 months ago

computablee commented 11 months ago

Which issue are you addressing?

This PR further addresses #45 and closes #48.

How have you addressed the issue?

A new field has been added to ForkedRegion which allows the codebase to easily check if a method is called from within a worksharing region. This is used in several places to throw exceptions. Out-of-date documentation related to exceptions has been updated, and several old exceptions have been removed. Currently, I leave only the constructors for exceptions with messages, as I want this to be the norm for DotMP going forward (not throwing an exception without a message).

How have you tested your patch?

I have added a large array of new tests ending in *_should_except which tests a bunch of different cases that DotMP should throw exceptions and ensures that it does. These tests have the side effect of drastically increasing code coverage, pushing us closer to 100%. I don't see 100% being viable due to bugs in coverlet, but I want better tests anyway, not a number on a badge.

codecov[bot] commented 11 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (943349c) 95.45% compared to head (5056704) 99.17%. Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #89 +/- ## ========================================== + Coverage 95.45% 99.17% +3.72% ========================================== Files 12 12 Lines 1099 1096 -3 Branches 101 102 +1 ========================================== + Hits 1049 1087 +38 + Misses 34 3 -31 + Partials 16 6 -10 ``` | [Files](https://app.codecov.io/gh/computablee/DotMP/pull/89?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Phillip+Allen+Lane) | Coverage Δ | | |---|---|---| | [DotMP/Exceptions.cs](https://app.codecov.io/gh/computablee/DotMP/pull/89?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Phillip+Allen+Lane#diff-RG90TVAvRXhjZXB0aW9ucy5jcw==) | `100.00% <ø> (+100.00%)` | :arrow_up: | | [DotMP/ForkedRegion.cs](https://app.codecov.io/gh/computablee/DotMP/pull/89?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Phillip+Allen+Lane#diff-RG90TVAvRm9ya2VkUmVnaW9uLmNz) | `100.00% <100.00%> (ø)` | | | [DotMP/Parallel.cs](https://app.codecov.io/gh/computablee/DotMP/pull/89?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Phillip+Allen+Lane#diff-RG90TVAvUGFyYWxsZWwuY3M=) | `98.10% <100.00%> (+6.15%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.