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

Expand testing #4

Closed
8 tasks done
Miista opened this issue Jan 11, 2024 · 0 comments · Fixed by #5
Closed
8 tasks done

Expand testing #4

Miista opened this issue Jan 11, 2024 · 0 comments · Fixed by #5
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Miista
Copy link
Owner

Miista commented Jan 11, 2024

We need tests for shimming a:

  • instance method
  • Specific instance methods (should verify that we only shim methods for that specific instance)
  • Static method
  • Getter
  • Setter
  • ref type constructor
  • value type constructor (is this possible)
  • abstract type (method + constructor?)

At the same time we could update the tests to a more modern test framework

The "hierarchy" of tests is as follows:

Please see alternate hierarchy below.

Note: Assume that all members are public.

  1. Static methods
  2. Static properties
    2.1 Getters
    2.2 Setters
  3. Methods on reference type
    3.1 Methods on any instance
    3.2 Methods on specific instance
    3.3 Methods on abstract reference type
  4. Methods on value types
    4.1 Methods on any instance
    4.2 Methods on specific instance This is not supported! It's only here for completeness sake.
  5. Constructors
    5.1 Reference types
    5.2 Value types

There is the following alternate hierarchy (which I might be more partial to):

Isolation

These tests exercise the entire library via PoseContext.Isolate.

Shimming

Note: These tests should be renamed to "Isolation".
These are the full-blown tests which test the entire stack.

We want to test the following:

  1. Methods
    1.1 Static types
    1.2 Reference types
    1.2.1 Any instance
    1.2.2 Specific instance
    1.3 Value types
    1.3.1 Any instance
    1.3.2 Specific instance of value type This is not supported! It's only here for completeness sake.
    1.4 Abstract methods
    1.5 Sealed types (both reference and value types)
  2. Getters
    2.1 Static types
    2.2 Reference types
    2.2.1 Any instance
    2.2.2 Specific instance
    2.3 Value types
    2.3.1 Any instance
    2.3.2 Specific instance (Is this supported?)
    2.4 Sealed types (both reference and value types)
  3. Setters
    3.1 Static types
    3.2 Reference types
    3.2.1 Any instance
    3.2.2 Specific instance
    3.3 Value types
    3.3.1 Any instance
    3.3.2 Specific instance (Is this supported?)
    3.4 Sealed types (both reference and value types)
  4. Constructors
    4.1 Static types Not currently possible
    4.2 Reference types
    4.3 Value types It seems this isn't supported
    4.4 Sealed types (both reference and value types)

Method rewriting

These tests should only be concerned with rewriting methods.
We wants to test for:

IL generation (via stubs)

These tests are concerned with generating IL for stubs (which will later be used to inject the shims).

We want to test that we can generate stubs for:

  • Direct calls
  • Virtual calls
    • Including for a constrained type (What does this mean?)
  • Object initialization (constructor invocations)
  • Direct load (What does this mean?)
  • Virtual load (What does this mean?)

Other

These tests I have not been able to put into any specific category. They are therefore lumped together here.

We want to test the following:

  • That we can correctly determine whether a method is in System.Private.CoreLib (both positive and negative verification)
  • That we can verify whether a method is an override (both positive and negative verification)
@Miista Miista mentioned this issue Jan 12, 2024
@Miista Miista added the enhancement New feature or request label Jan 12, 2024
@Miista Miista self-assigned this Jan 12, 2024
Miista pushed a commit that referenced this issue Jan 12, 2024
Miista pushed a commit that referenced this issue Jan 12, 2024
Miista pushed a commit that referenced this issue Jan 12, 2024
Miista pushed a commit that referenced this issue Jan 12, 2024
#3 Remove explicit support for net6.0
Miista pushed a commit that referenced this issue Jan 12, 2024
Miista pushed a commit that referenced this issue Jan 12, 2024
…meworks

The following line makes it so that tests are run sequentially.
This seems to be necessary.
If I don't have it, tests seem to fail randomly.

I suspect it's related to the IL being rewritten.
Should probably look further into it.
Miista pushed a commit that referenced this issue Jan 13, 2024
Miista pushed a commit that referenced this issue Jan 13, 2024
Miista pushed a commit that referenced this issue Jan 13, 2024
@Miista Miista linked a pull request Jan 13, 2024 that will close this issue
@Miista Miista changed the title Add more tests Add thorough testing Jan 14, 2024
@Miista Miista changed the title Add thorough testing Expand testing Jan 14, 2024
@Miista Miista added this to the v2.0 milestone Jan 17, 2024
@Miista Miista closed this as completed in #5 Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant