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

Valgrind support added for unittests #12064

Merged
merged 2 commits into from
Dec 17, 2019

Conversation

AnttiKauppila
Copy link

Added an option to select Valgrind to be used for unittests from command line

Summary of changes

Added an option to select Valgrind to be used for unittests from command line
can be used by calling mbed test --unittest --valgrind

Impact of changes

Migration actions required

Documentation

Tool specific help is part of this PR, mbed-cli must be updated also to add same option hint.


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

@ARMmbed/mbed-os-wan @ARMmbed/mbed-os-ipcore

@AnttiKauppila
Copy link
Author

ARMmbed/mbed-cli#940

@mbed-ci
Copy link

mbed-ci commented Dec 10, 2019

Test run: FAILED

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

Failed test jobs:

  • jenkins-ci/mbed-os-ci_unittests

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 11, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Dec 11, 2019

Test run: SUCCESS

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

@0xc0170 0xc0170 added release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 needs: review and removed needs: CI labels Dec 11, 2019
@0xc0170 0xc0170 requested a review from jamesbeyond December 11, 2019 09:45
@AnttiKauppila
Copy link
Author

@jamesbeyond Please review

@jamesbeyond
Copy link
Contributor

jamesbeyond commented Dec 12, 2019

Hi @AnttiKauppila, this is looking good! And I got 2 questions to ask:

  1. is this feature for Linux only? also is this will throw a proper message if Valgrind is not installed?
  2. currently in the CI Valgrind is running separately: https://github.com/ARMmbed/mbed-os-ci/blob/master/vars/unittests.groovy#L215 , if the improvement is in place, can we use this unittest option to replace that

maybe @VeliMattiLahtela need to aware of the 2nd question aswell

@michalpasztamobica
Copy link
Contributor

@jamesbeyond , regarding question (1), I have good experience running unittests and Valgrind on Linux Subsystem For Windows.

@AnttiKauppila
Copy link
Author

AnttiKauppila commented Dec 12, 2019

@jamesbeyond

  1. This is for all systems having "valgrind".
  2. Yes, and we should. Just add --valgrind after https://github.com/ARMmbed/mbed-os-ci/blob/master/vars/unittests.groovy#L210
    • Also this has a neat feature of putting valgrind errors into a specific .log file which can then be linked easily in case of any errors!

Antti Kauppila added 2 commits December 12, 2019 15:30
Added an option to select Valgrind to be used for unittests from command line
@AnttiKauppila
Copy link
Author

@jamesbeyond Added the handling in case valgrind is missing

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.

LGTM

@kjbracey
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 17, 2019

Test run: SUCCESS

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

@adbridge adbridge merged commit 9209b98 into ARMmbed:master Dec 17, 2019
@AnttiKauppila AnttiKauppila deleted the valgrind_for_unittest branch December 18, 2019 06:21
@petroborys
Copy link
Contributor

Hi, @AnttiKauppila, how can I use “mbed test” argument --valgrind?

mbed test --unittest --valgrind returned ERROR: Unknown Error: sequence item 3: expected str instance, bool found

@jamesbeyond

  1. This is for all systems having "valgrind".

  2. Yes, and we should. Just add --valgrind after https://github.com/ARMmbed/mbed-os-ci/blob/master/vars/unittests.groovy#L210

    • Also this has a neat feature of putting valgrind errors into a specific .log file which can then be linked easily in case of any errors!

The link in p.2 is disabled. Unable to find any information about mbed test and valgrind. Thanks!

@kivaisan
Copy link
Contributor

@petroborys mbed-cli has a bug with python 3.x. Fix is available but it is not released yet: ARMmbed/mbed-cli#965

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-1 First pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants