catch_discover_tests fails for Windows test executables run under Wine since v3.15.2
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 79/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- cmake, cpp
- Ambito
- build-system, testing
Direzione di ricerca
Inizia da extras/CatchAddTests.cmake, dove secondo l’issue il percorso dell’elenco viene passato all’eseguibile di test come argomento separato. Controlla come catch_discover_tests costruisce l’argomento --out e come lo analizza l’invocazione di Wine che non riesce. Aggiorna l’argomento affinché il percorso venga accettato, quindi verifica che la discovery funzioni per gli eseguibili di test Windows eseguiti con Wine.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Since 9ec44dd (the fix for #3162), CatchAddTests.cmake passes the listing temp file as a separate argument: --out "${listing_output_path}". The temp path comes from XDG_RUNTIME_DIR, TMPDIR, TMP or TEMP, so on a Linux host it starts with /.
When the test executable is a Windows binary run through CMAKE_CROSSCOMPILING_EMULATOR (Wine), Clara treats / as an option prefix on Windows (isOptPrefix in catch_clara.cpp). The path is then parsed as a new option rather than the value of --out, and discovery fails:
Error(s) in input:
Expected argument following --out
CMake Error at .../build/x64/_deps/catch2-src/extras/CatchAddTests.cmake:307 (message):
Error listing tests from executable
'.../build/x64/tests/Release/PatchFix.Tests.exe':
Passing the value in the same argument works: wine tests.exe --list-tests --reporter json --out=/tmp/x.json writes the listing, while --out /tmp/x.json fails with the error above.
Expected behavior
Discovery works for Windows executables run under Wine, as it did up to v3.15.1.
Reproduction steps
Reproduced with https://github.com/playday3008/PatchFix at commit 2e2763aae1e57ddb304333fc22a5f741bdc7c2a8, which pins Catch2 v3.15.0 in cmake/deps/catch2.cmake and registers its tests with catch_discover_tests(... DISCOVERY_MODE PRE_TEST). The commands below follow its Linux CI job runs; the toolchain needs LLVM, Ninja, Wine and msvc-wine installed to ~/.msvc.
git clone https://github.com/playday3008/PatchFix && cd PatchFix
git checkout 2e2763aae1e57ddb304333fc22a5f741bdc7c2a8
sed -i 's/v3.15.0/v3.16.1/' cmake/deps/catch2.cmake
cmake --preset wine-x64
cmake --build --preset wine-x64-release --target PatchFix.Tests
ctest --test-dir build/x64 -C Release --output-on-failure --no-tests=error
With v3.15.0 or v3.15.1, ctest passes. With v3.15.2, v3.15.3, v3.16.0 or v3.16.1, it fails with the error above.
Possible fix
Pass the path in one argument in CatchAddTests.cmake, for example "--out=${listing_output_path}", so parsing no longer depends on the first character of the path.
Platform information:
- OS: Linux host (Fedora), Windows x64 target run under Wine 11.0 (Staging)
- Compiler+version: clang-cl 22.1.8 with MSVC headers and libraries via msvc-wine
- Catch version: v3.15.2 through v3.16.1 fail; v3.15.1 works
Additional context
Same origin as #3241 (Emscripten), but a different cause; the stdout options proposed there would not fix this by default.
- Lingua principale
- C++
- Stelle
- 21.6k
- Fork
- 3.4k
- Merge medio
- 3g 12h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di catchorg/Catch2
-
catch_discover_tests passes all EXTRA_ARGS as one argumentForse già presa @CyberKun l’ha presa 11 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
catchorg/Catch2#3239 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Not seeing some error messages from fakeit in jetbrains riderForse già presa @Amanpal9 l’ha presa 21 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
catchorg/Catch2#3228 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
catch_discover_tests fails for Emscripten/WASM tests since v3.16.0Forse già presa @nafiurahman00 l’ha presa 8 giorni fa. ApertaExtras
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
catchorg/Catch2#3241 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 2 giorni
-
Commit `b710039` breaks tests with overloaded `operator==`Forse già presa @michaelbawuah l’ha presa 45 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 75/100
catchorg/Catch2#3221 · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di catchorg/Catch2
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cp-algorithms/cp-algorithms#1774 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
telefonicaid/fiware-orion#4836 ·
I maintainer di solito rispondono entro 1 giorno
-
nixd exits at startup when its parent process belongs to another userForse già presa @conao3 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nix-community/nixd#930 ·
I maintainer di solito rispondono entro 2 giorni
-
refactor topic-ui topic-weather
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Command-Install Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
microsoft/winget-cli#6718 ·
I maintainer di solito rispondono entro 2 giorni