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

Unit Testing: Parsing of test cases fails for TEST_CASE() formatted with spaces (VSC-1544) #1371

Closed
1 task done
tmrech opened this issue Dec 17, 2024 · 6 comments · Fixed by #1377
Closed
1 task done
Assignees
Labels
bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue)

Comments

@tmrech
Copy link

tmrech commented Dec 17, 2024

OS

Linux

Operating System version

Ubuntu Ubuntu 20.04.6 LTS (WSL)

Visual Studio Code version

1.96.0

ESP-IDF version

5.3.1

Python version

3.8.10

Doctor command output

report.txt

Extension

No response

Description

When using the TESTING tab in VSCode, testcases are only parsed correctly if the unity macro TEST_CASE("testname", "group") is formatted without space before testname. If a space is inserted like this TEST_CASE( "testname", "group" ), the testcase won't show up in the TESTING tab.

This is consistent with the regular expression given in docs_espressif/en/additionalfeatures/unit-testing.rst but causes issues when auto-formating is activated. As the test project will build correctly with this formatting the regex should be changed?

Correct behaviour:
grafik

Faulty behaviour:
grafik

Debug Message

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@tmrech tmrech added the bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue) label Dec 17, 2024
@github-actions github-actions bot changed the title Unit Testing: Paring of test cases fails for TEST_CASE() formatted with spaces Unit Testing: Paring of test cases fails for TEST_CASE() formatted with spaces (VSC-1544) Dec 17, 2024
@tmrech tmrech changed the title Unit Testing: Paring of test cases fails for TEST_CASE() formatted with spaces (VSC-1544) Unit Testing: Parsing of test cases fails for TEST_CASE() formatted with spaces (VSC-1544) Dec 17, 2024
@brianignacio5
Copy link
Collaborator

We can fix the regex to include this case too. I'm just wondering which auto-formatter are you using and why it formats this way ?

@brianignacio5 brianignacio5 self-assigned this Dec 18, 2024
@tmrech
Copy link
Author

tmrech commented Dec 18, 2024

That is great news, thanks.

We can fix the regex to include this case too. I'm just wondering which auto-formatter are you using and why it formats this way ?

I'm using clang-format with some custom clang-format style options. I think the relevant option in .clang-format is SpacesInParentheses: true

@brianignacio5
Copy link
Collaborator

Could you please try this vsix installer to see if the issue is fixed ?

@tmrech
Copy link
Author

tmrech commented Dec 25, 2024

I'm off my computer until early January. I will Check it out when I'm back.

@tmrech
Copy link
Author

tmrech commented Jan 8, 2025

The vsix installer fixes the issue. Thanks!

Copy link

Thanks for using our extension! 🚀

Your feedback matters! Could you take a moment to rate it on the marketplace? A positive rating helps other developers discover our tools and motivates us to keep improving.

⭐ Rate ESP-IDF Extension: https://marketplace.visualstudio.com/items?itemName=espressif.esp-idf-extension&ssr=false#review-details

Your support means a lot to our development team!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants