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

unittest: fix coverage filtering #12263

Merged

Conversation

maciejbocianski
Copy link
Contributor

@maciejbocianski maciejbocianski commented Jan 15, 2020

Summary of changes

Changes coverage filter pattern from ^pattern* to *pattern* to better match source files

Below coverage reports generated by command mbed test --unittest -r Socket --coverage html

unittests matched with -r Socket:

The following tests passed:
        MODULETESTS-features-netsocket-IfaceDnsSocket
        features-netsocket-CellularNonIPSocket
        features-netsocket-DTLSSocket
        features-netsocket-DTLSSocketWrapper
        features-netsocket-InternetSocket
        features-netsocket-SocketAddress
        features-netsocket-TCPSocket
        features-netsocket-TLSSocket
        features-netsocket-TLSSocketWrapper
        features-netsocket-UDPSocket

without fix
obraz

with fix
obraz

Impact of changes

Migration actions required

Documentation


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[X] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@jamesbeyond
@michalpasztamobica
@lorjala


change coverage filter pattern from ^pattern* to *pattern*
Copy link
Contributor

@michalpasztamobica michalpasztamobica left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 15, 2020

CI started

@michalpasztamobica
Copy link
Contributor

@AnttiKauppila , FYI: now we can get moduletests-only coverage by using mbed test --unittest --coverage -r moduletests

@mbed-ci
Copy link

mbed-ci commented Jan 15, 2020

Test run: SUCCESS

Summary: 1 of 1 test jobs passed
Build number : 1
Build artifacts

@ciarmcom
Copy link
Member

@maciejbocianski, thank you for your changes.
@jamesbeyond @lorjala @michalpasztamobica @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@jamesbeyond jamesbeyond left a comment

Choose a reason for hiding this comment

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

Looks good!

@0xc0170 0xc0170 added release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 and removed needs: CI needs: review labels Jan 15, 2020
@0xc0170 0xc0170 merged commit b96d3ad into ARMmbed:master Jan 15, 2020
@maciejbocianski
Copy link
Contributor Author

@AnttiKauppila , FYI: now we can get moduletests-only coverage by using mbed test --unittest --coverage -r moduletests

@AnttiKauppila @michalpasztamobica @jamesbeyond
It won't work this way. -r pattern is used to filter both test names and source files for coverage report. Coverage filtering will work only when filter pattern will match both test name and tested feature source file name.

@michalpasztamobica
Copy link
Contributor

@maciejbocianski , that explains why Seppo called his tests moduletest.cpp. I guess we need to rename ours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants