JSON failed parsing json string
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- cmake, cpp
- Área
- build-system, testing
Línea de trabajo
Empieza en lib/cmake/Catch2/CatchAddTests.cmake, especialmente en el análisis de JSON alrededor de las líneas 138 y 235 y en el cambio del commit 7d7b2f89f24cbd277f6eb6912705e5e13c68a3c7. Reproduce el descubrimiento de pruebas con la salida de Catch indicada en CMake 3.22.1 o 3.25.1 e inspecciona listing_output antes del análisis. Se considera terminado cuando catch_discover_tests se completa sin el error de análisis de JSON en las plataformas indicadas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
I am recently getting the following error with latest devel release (ceed2684):
CMake Error at /path/to/Catch2/lib/cmake/Catch2/CatchAddTests.cmake:138 (string):
string sub-command JSON failed parsing json string: * Line 1, Column 6
Missing ',' or ']' in array declaration
.
Call Stack (most recent call first):
/path/to/Catch2/lib/cmake/Catch2/CatchAddTests.cmake:235 (catch_discover_tests_impl)
Line 138 of CatchAddTests.cmake is:
string(JSON version GET "${listing_output}" "version")
adding a CMake message just before the line for the value listing_output yields:
{
"version": 1,
"metadata": {
"name": "ut_saccades_frameworkd",
"rng-seed": 994172703,
"catch2-version": "3.8.1"
},
"listings": {
"tests": [
{
Expected behavior
I've isolated the commit which causes the error:
7d7b2f89f24cbd277f6eb6912705e5e13c68a3c7
Support adding test tags as CTest labels in catch_discover_tests
which does indeed add those lines to CatchAddTests.cmake.:
- # Parse output
- foreach(line ${output})
- set(test "${line}")
+ # Parse JSON output for list of tests/class names/tags
+ string(JSON version GET "${listing_output}" "version")
+ if (NOT version STREQUAL "1")
+ message(FATAL_ERROR "Unsupported catch output version: '${version}'")
+ endif()
+
+ # Speed-up reparsing by cutting away unneeded parts of JSON.
+ string(JSON test_listing GET "${listing_output}" "listings" "tests")
+ string(JSON num_tests LENGTH "${test_listing}")
+ # CMake's foreach-RANGE is inclusive, so we have to subtract 1
+ math(EXPR num_tests "${num_tests} - 1")
Reproduction steps
Haven't done this yet but will try to reproduce with small example if necessary.
Platform information:
- Windows 11:
- Visual Studio Community 17.4.3
- CMake: 3.25.1
- Ubuntu 22.04:
- gcc: 11.4
- CMake: 3.22.1
- Catch: ceed2684
Additional context
.
- Lenguaje dominante
- C++
- Estrellas
- 21.6k
- Forks
- 3.4k
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de catchorg/Catch2
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 2 días
-
catch_discover_tests passes all EXTRA_ARGS as one argumentPosiblemente ocupada @CyberKun la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
catchorg/Catch2#3239 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Not seeing some error messages from fakeit in jetbrains riderPosiblemente ocupada @Amanpal9 la tomó hace 21 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
catchorg/Catch2#3228 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
catch_discover_tests fails for Emscripten/WASM tests since v3.16.0Posiblemente ocupada @nafiurahman00 la tomó hace 8 días. AbiertoExtras
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
catchorg/Catch2#3241 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 2 días
Todos los issues de catchorg/Catch2
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cp-algorithms/cp-algorithms#1774 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
telefonicaid/fiware-orion#4836 ·
Los mantenedores suelen responder en 1 día
-
nixd exits at startup when its parent process belongs to another userPosiblemente ocupada @conao3 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nix-community/nixd#930 ·
Los mantenedores suelen responder en 2 días
-
refactor topic-ui topic-weather
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Command-Install Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
microsoft/winget-cli#6718 ·
Los mantenedores suelen responder en 2 días