question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Parsing error because Catch2 v3 deprecates descriptions in `TEST_CASE`

See original GitHub issue

Checklist

  • The issue is about this extension and NOT about a fork.
  • Check the known issues list.
  • The latest version of the extension was used.

Describe the bug

Catch2 v3 deprecates descriptions in TEST_CASE, which breaks parsing of the --list-tests: https://github.com/catchorg/Catch2/releases/tag/v3.0.0-preview2 https://github.com/matepek/vscode-catch2-test-adapter/blob/master/src/framework/Catch2Runnable.ts#L120

Old output:

$ ./build/bin/libmil-test.exe --list-tests --verbosity high
All available test cases:
  equality_comparable
    ..\libs\libmil\src\asd\axt\mil\config\config.test.cpp(5)  
    (NO DESCRIPTION)     
      [test][test2]
  reproducible
    ..\libs\libmil\src\asd\axt\mil\config\serialization.test.cpp(7)
    (NO DESCRIPTION)     
2 test cases

New output:

$ ./build/bin/libmil-test.exe --list-tests --verbosity high
All available test cases:
  equality_comparable
    ..\libs\libmil\src\asd\axt\mil\config\config.test.cpp(5)       
      [test][test2]
  reproducible
    ..\libs\libmil\src\asd\axt\mil\config\serialization.test.cpp(7)
2 test cases

To Reproduce

  1. Install Catch2 v3
  2. Build tests
  3. Reload tests in the Text Explorer
  4. See error about the width

Desktop

  • Extension Version: 3.2.0
  • VS Code Version: 1.46.0-insiders
  • Catch2 Version: v3
  • OS Type and Version: Windows 10

Logs

[2020-05-15 13:15:52.602] [ERROR] Wrong test list output format 7 [
  'Matching test cases:',
  '  equality_comparable',
  '    ..\\libs\\libmil\\src\\asd\\axt\\mil\\config\\config.test.cpp(5)',
  '      [test][test2]',
  '  reproducible',
  '    ..\\libs\\libmil\\src\\asd\\axt\\mil\\config\\serialization.test.cpp(7)',
  '2 matching test cases',
  '',
  ''
];
[2020-05-15 13:15:52.602] [ERROR] Could not find catch2 file info [
  'Matching test cases:',
  '  equality_comparable',
  '    ..\\libs\\libmil\\src\\asd\\axt\\mil\\config\\config.test.cpp(5)',
  '      [test][test2]',
  '  reproducible',
  '    ..\\libs\\libmil\\src\\asd\\axt\\mil\\config\\serialization.test.cpp(7)',
  '2 matching test cases',
  '',
  ''
]
[2020-05-15 13:15:52.602] [WARN] Couldn't load executable [TypeError: Cannot read property 'substr' of undefined

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
horenmarcommented, May 15, 2020

Yup. For v3, just do

add_executable(name testfile1.cpp testfile2.cpp ...)
target_link_libraries(name Catch2::Catch2WithMain)

the include paths, main and so on will take care of itself.

2reactions
matepekcommented, May 15, 2020

congrats for the new version @horenmar . Thanks for the PR @Minimonium. I think I will try implement with the xml.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Catch2 v3 no longer works with CLion's Catch2 integration
It's now broken when using the latest from Catch2's devel branch. This is likely because Catch2's version string was being parsed by CLion...
Read more >
List of unit testing frameworks - Wikipedia
This article is a list of tables of code-driven unit testing frameworks for various programming languages. Some, but not all, of these are...
Read more >
spotbugs Documentation - Read the Docs
SpotBugs is a program to find bugs in Java programs. It looks for instances of “bug patterns” — code instances that are likely...
Read more >
Fix Catch2 compiling for INTEGRITY - Qt Code Review
Fix Catch2 compiling for INTEGRITY - Exclude Green Hills compiler from ... Make that: https://codereview.qt-project.org/c/qt/qtbase/+/370638 since it got ...
Read more >
EasyBuild v4.6.2 documentation (release 20221021.0)
various bug fixes, including: switch to Rust 1.60.0 build dependency for bamtofastq, since build fails with Rust 1.52.1 (#15636); avoid that pygmo v2.18.0 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found