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

setup and teardown are not called before and after every Test #4687

Closed
1 task
Speidey opened this issue Jul 10, 2023 · 2 comments
Closed
1 task

setup and teardown are not called before and after every Test #4687

Speidey opened this issue Jul 10, 2023 · 2 comments

Comments

@Speidey
Copy link

Speidey commented Jul 10, 2023

  • PlatformIO Core.
    If you’ve found a bug, please provide an information below.

Configuration

Operating system: WIn10

PlatformIO Version (platformio --version): 6.1.9

Description of problem

When following the Unit testing tutorial here: https://piolabs.com/blog/insights/unit-testing-part-1.html
I ran into the problem, that setUp and tearDown are not called when not calling them in the main function. My understanding from the tutorial was, that this should not be the case but these functions should be called automatically before and after each RUN_TEST.

I asked in the community forum and was send here by ivankravets of the PlatformIO Team.

Steps to Reproduce

  1. Follow https://piolabs.com/blog/insights/unit-testing-part-1.html
  2. get to the part where cbuffer_init(&buff); is extracted into setUp

Actual Results

failed test

Expected Results

succesfull testing

@valeros
Copy link
Member

valeros commented Jul 10, 2023

Hi @Speidey ! How did you test that the setUp and tearDown functions are not called? I just tried a basic example with printf and it seems to work just fine:
image

@ivankravets
Copy link
Member

Please reopen if you still need help

@ivankravets ivankravets removed this from the 6.1.10 milestone Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants