-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Description
Describe the bug
When compiling in a project with no tests, but a (empty) tests file exists, the compile fails with the following error:
[ 50%] Linking CXX executable test
CMake Error at /usr/lib/cmake/Catch2/CatchAddTests.cmake:150 (string):
string sub-command JSON expected an index less than 0 got '0'.
Call Stack (most recent call first):
/usr/lib/cmake/Catch2/CatchAddTests.cmake:228 (catch_discover_tests_impl)
Expected behavior
The project should compile correctly.
Reproduction steps
Steps to reproduce the bug.
- Create base project directory (
base_dir) - Add CMakeLists.txt (CMakeLists.txt)
- Create tests directory inside base (
base_dir/tests) - Create an empty test file inside base (
base_dir/tests/tests.cpp) - Create build directory inside base (
base_dir/build) cdinto build directory- Run
cmake .. - Run
make-> an error occurs
Platform information:
- OS: Ubuntu 24.04.1 LTS arm64
- Compiler+version: clang 18.1.3 (1ubuntu1)
- Catch version: v3.8.0
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels