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

test: fix stats depth variable scope #4933

Merged
merged 1 commit into from
Sep 4, 2017

Conversation

0xc0170
Copy link
Contributor

@0xc0170 0xc0170 commented Aug 18, 2017

As this variable is not in scope, should not be referenced.
Fixes #4392 No, you can't do "fixes PR#" only "fixes issue#" makes sense
Fixes #4930

I am not certain this is a proper fix. The variable is not in the scope in execute() . Should it be passed somehow there, or just ignored ? This fixes it as we are not using undefined variable. The question is how it should be passed to execute function or should not and this is correct?
@theotherjimmy update: I passed stats depth correctly.

Tested with singletest.py. With this patch, it builds. Without, build does not even start, it crashes silently - FAIL build.

@MarceloSalazar @theotherjimmy You might know better, replace this patch or push to my branch.

@MarceloSalazar
Copy link

The line is needed to be able to get different levels of stats when compiling tests (default is 2).

Should it be passed somehow there, or just ignored ?
The question is how it should be passed to execute function or should not and this is correct?

IMO it should continue to be passed. I'd suggest checking whether the variable exists. If doesn't, then assign a value (e.g. 2 is the default level of depth for memap stats).

@theotherjimmy may have another suggestion.

@0xc0170
Copy link
Contributor Author

0xc0170 commented Aug 21, 2017

IMO it should continue to be passed. I'd suggest checking whether the variable exists. If doesn't, then assign a value (e.g. 2 is the default level of depth for memap stats).

That is how is it with this patch, it is not passed, thus using the default value.

I am not familiar with the changes for memmap, thus not certain how it can be passed to execute_thread_slice. I had a look how to but could not see the path there.
As I see we got 2 options:

  • this patch (using default value), as this has not been yet spotted outside of mbed cli (mbed 2 script broke that does not use memap at all)
  • pass that parameter around to make it visible for execute_thread_slice (I'll need your help to make this happen, please either write to this branch or superceed this patch by another PR).

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

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

I don't think that this is the right way to go about this. Instead of allowing stats_depth to take its default, we should find where it should have been passed in and pass it appropriately.

@theotherjimmy
Copy link
Contributor

@theotherjimmy note to self: help with this.

@0xc0170
Copy link
Contributor Author

0xc0170 commented Aug 31, 2017

@theotherjimmy note to self: help with this.

👍 You can push to my branch or just send a new PR. It would be nice to have this fixed. I'll talk to you today

@0xc0170
Copy link
Contributor Author

0xc0170 commented Sep 1, 2017

Thanks @theotherjimmy

@theotherjimmy
Copy link
Contributor

I tested with singletest.py, and it seems to work.

@0xc0170
Copy link
Contributor Author

0xc0170 commented Sep 4, 2017

Tested locally, working for me as well

@0xc0170 0xc0170 merged commit c291973 into ARMmbed:master Sep 4, 2017
@jeromecoutant
Copy link
Collaborator

👍

@0xc0170 0xc0170 deleted the fix_stats_depth branch September 6, 2017 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MBED2 tests won't run after merge of #4392
5 participants