Skip to content

Conversation

@nilsvu
Copy link
Member

@nilsvu nilsvu commented Aug 5, 2023

Proposed changes

Allows to run most tests outside a Charm++ environment.

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

Copy link
Member

@nilsdeppe nilsdeppe left a 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(
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, done

@nilsvu nilsvu force-pushed the mock_global_cache branch from 69c3e1b to c335252 Compare August 7, 2023 18:31
nilsdeppe
nilsdeppe previously approved these changes Aug 7, 2023
@nilsdeppe nilsdeppe enabled auto-merge August 7, 2023 18:33
Comment on lines 817 to 824
if constexpr (not GlobalCache<Metavariables>::is_mocked) {
cache.thisProxy.template mutate<GlobalCacheTag, Function>(
std::make_tuple<Args...>(std::forward<Args>(args)...));
}
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

nilsvu added 2 commits August 9, 2023 16:26
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.
@knelli2 knelli2 added the auto-merge GitHub's auto-merge has been enabled for this PR. label Aug 10, 2023
@nilsdeppe nilsdeppe merged commit 54ca244 into sxs-collaboration:develop Aug 10, 2023
@nilsvu nilsvu deleted the mock_global_cache branch August 10, 2023 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge GitHub's auto-merge has been enabled for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants