Skip to content

Valgrind support added for unittests#12064

Merged
adbridge merged 2 commits into
ARMmbed:masterfrom
AnttiKauppila:valgrind_for_unittest
Dec 17, 2019
Merged

Valgrind support added for unittests#12064
adbridge merged 2 commits into
ARMmbed:masterfrom
AnttiKauppila:valgrind_for_unittest

Conversation

@AnttiKauppila

Copy link
Copy Markdown

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
Copy Markdown
Author

ARMmbed/mbed-cli#940

@mbed-ci

mbed-ci commented Dec 10, 2019

Copy link
Copy Markdown

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

0xc0170 commented Dec 11, 2019

Copy link
Copy Markdown
Contributor

CI restarted

@mbed-ci

mbed-ci commented Dec 11, 2019

Copy link
Copy Markdown

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
Copy Markdown
Author

@jamesbeyond Please review

@jamesbeyond

jamesbeyond commented Dec 12, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@AnttiKauppila

AnttiKauppila commented Dec 12, 2019

Copy link
Copy Markdown
Author

@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
Copy Markdown
Author

@jamesbeyond Added the handling in case valgrind is missing

@jamesbeyond jamesbeyond left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@kjbracey

Copy link
Copy Markdown
Contributor

CI started

@mbed-ci

mbed-ci commented Dec 17, 2019

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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