-
Notifications
You must be signed in to change notification settings - Fork 213
Mock global cache #5319
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
Mock global cache #5319
Conversation
nilsdeppe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one small suggestion, squash & rebase if you decide to make the change
| ${CHARM_LIB_ckmain} | ||
| ${CHARM_LIB_conv-static} | ||
| ) | ||
| target_compile_definitions( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a good idea to add a brief comment here what one of the intended uses for this definition is. basically just the long part of the commit message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, done
69c3e1b to
c335252
Compare
| if constexpr (not GlobalCache<Metavariables>::is_mocked) { | ||
| cache.thisProxy.template mutate<GlobalCacheTag, Function>( | ||
| std::make_tuple<Args...>(std::forward<Args>(args)...)); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if the main proxy somehow has been set but the cache is mocked, this won't do anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add an error to avoid silently hitting this for some reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Charm registration only works with a Main module, so enable it only when the Main module is available. This allows the Charm registration code to compile in unit tests that use the mocking framework and don't link a Charm Main module.
Mock the global cache in unit tests that don't run in a Charm++ environment.
c335252 to
bd6baf2
Compare
Proposed changes
Allows to run most tests outside a Charm++ environment.
Upgrade instructions
Code review checklist
make docto generate the documentation locally intoBUILD_DIR/docs/html.Then open
index.html.code review guide.
bugfixornew featureif appropriate.Further comments