Basic Gtest demo project to reproduce bug in test explorer in vs2026
CMakeLists.txt that create the project and set some basic options CMakesettings.json to handle win Release/Debug and Linux Release/Debug
small library with only 2 functions
2 files to test 2 functions from library. It use fetchcontent to get Gtest.
A dockerfile and its docker-compose.yml to create a linux container with some build tools.
Create the container from ubuntuvs
cd ubuntuvs
docker compose --profile ubuntuvs up -dThen open visual studio and create connection to this container
name : localhost
port : 5000
user : aaa
password : aaa
open the solution as cmake project in visual 2026 open the test explorer windows select one of the linux target generate everything run the unit tests
Démarrage de la découverte de tests
========== Fin de la découverte de tests : 2 tests trouvés en 635,7 ms ==========
Démarrage de la série de tests
Connexion impossible au système distant : Connexion impossible au système distant, ou perte de la connexion.
Connexion impossible au système distant : -1440107451;localhost (username=aaa, port=5000, authentication=Password)
========== Série de tests achevée : 0 tests (0 réussi(s), 0 non réussi(s), 0 ignoré(s)) exécutés en 177 ms ==========
open same solution use same container compile and run the linux tests
========== Test discovery finished: 2 Tests found in 2,1 s ==========
Génération de projets de test
========== Starting test run ==========
========== Test run finished: 2 Tests (2 Passed, 0 Failed, 0 Skipped) run in 383 ms ==========
| Visual Studio | Target | test explorer | run test executable |
|---|---|---|---|
| 2022 | win release | ✅ | ✅ |
| 2022 | win debug | ✅ | ✅ |
| 2022 | linux release | ✅ | ✅ |
| 2022 | linux debug | ✅ | ✅ |
| 2026 | win release | ✅ | ✅ |
| 2026 | win debug | ✅ | ✅ |
| 2026 | linux release | ❌ | ✅ |
| 2026 | linux debug | ❌ | ✅ |
We test our solution with vs2026 and test always failed. So the discrepency is probably since first release of vs2026. We thought it was caused by our CI with docker using new compiler/cmake vcpkg with private registry, multiple layers of docker images. We finally recreate this project without any dependency from our stack and our issue is reproduced.

