mw/com: Add methods integration tests#485
Draft
bemerybmw wants to merge 18 commits into
Draft
Conversation
We prefer to have copies of the configuration checked in for each test rather than using a tool to generate them. This makes it easier to validate that the configuration files are as expected, makes it easier for a user to use the config file as an example for how to create one themselves and also prevents the test being altered without realising if the generation tool is ever updated.
Sometimes we want to perform some clean up before aborting via FailTest. Since destructors won't be called when calling std::_Exit, we allow registering a callable which will be called before exiting. This callable can be registered by creating an ExitFunctionGuard which will call the registered callable on destruction of the guard or when exiting via FailTest.
MakeError takes a string_view which was previously binding to a local string. When the error was logged, the string was already destroyed. We no longer pass a dynamic string to MakeError to avoid lifetime issues.
This function can be used if we need to store a ProcessSynchronizer in a data structure which requires it to be moveable (such as a std::vector)
FailTestIf resulted in a runtime failure if calling it with a score::result::error when the condition is true since the result does not contain an error in that case but the function argument is still evaluated even though the condition is true. Passing an error is a common use case so we simply remove this and use FailTest with an if statement.
This directory contains a datatype interface containing all 4 combinations of InArgs and Return values. It also provides helper classes which encapsulate some of the boilerplate code when using this datatype such as registering method handlers, calling methods etc.
Report failures using FailTest instead of propagating the errors up through function return types which makes signatures and calling more complex and can result in tests not failing when they should if the error code is not handled correctly by the parent layer.
- Don't use MethodConsumer. Since this is a basic test which we want to serve also as an example for users, we don't want to extract methods related functionality out of the class. Additionally, to simplify the code and to make it clearer when MethodConsumer can be used, it's no longer templated with the Proxy type so cannot be used with the type defined within this test. - Fail the test using FailTest instead of propagating the errors up through function return types which makes signatures and calling more complex and can result in tests not failing when they should if the error code is not handled correctly by the parent layer.
Fail the test using FailTest instead of propagating the errors up through function return types which makes signatures and calling more complex and can result in tests not failing when they should if the error code is not handled correctly by the parent layer.
The signature_variations is the exact same as the mixed_criticality tests, except the latter runs the test for all combinations of asil levels of consumers and providers. Therefore, we remove signature_variations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends-on: #479