-
Notifications
You must be signed in to change notification settings - Fork 69
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
MockVM #99
Comments
Here is a list of mock libraries in Rust: https://asomers.github.io/mock_shootout/ With some attempts, here are some of my opinions:
|
* Bump version to v0.6 * Update changelog
We have gradually added some tests to We would at some point refactor For example, currently, when a GC is triggered for a
In the test in which we expect a GC to be triggered, we check if the test panics
and in the test in which we expect no GC to be triggered, we simply see if the test passes without panic
The panic behavior of The simplest approach is to use function pointers. |
I have another example. I want my |
This PR introduces `MockVM`, a type that implements `VMBinding` and allows users to control the behavior of each method for testing. This PR also moves all the tests in the current `DummyVM` to `MockVM`, and removes the current `DummyVM`. This PR closes #99. Note that the current `MockVM` implementation does not allow changing constants or associated types in `VMBinding` -- I would suggest we create another issue to track this problem. Changes: * Introduce `MockVM`, and write all the current `DummyVM` tests with `MockVM`. * Remove `DummyVM`, and remove `./examples` which uses `DummyVM`. * Change CI scripts to run tests with `MockVM`. * Remove `pub` visibility for some modules. Those modules were exposed so we can test them from `DummyVM`. As now `MockVM` is a part of the main crate, we can test private items. We no longer need `pub` for those modules.
For testing, we include a
DummyVM
in the mmtk-core repo. We should rename it toMockVM
to properly reflect its usage. And we should allow proper mocking for testing.The text was updated successfully, but these errors were encountered: