testing: tests for mypyc failed when gtest was installed on my system
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 20.6k
- Forks
- 3.3k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
Bug Report
Within my fork of the mypy repo, the test mypyc/test/test_external.py failed while attempting to build libgtest.a with compilation errors like the following:
In file included from ../src/gtest-all.cc:42:
../src/gtest.cc:330:43: error: use of undeclared identifier 'GetArgvs'
static bool GTestIsInitialized() { return GetArgvs().size() > 0; }
^
To Reproduce
Run the tests as documented.
Expected Behavior
Ideally, compilation of the Google Test library should succeed, whether or not another version of Google Test is installed.
Actual Behavior
Compilation fails because the system-installed version of the header files are picked up. This is due to this line https://github.com/python/mypy/blob/05d9fb15dcec8bde4e7184ca387e7d8acea68792/mypyc/external/googletest/make/Makefile#L22 which adds the parent directory to the list of system includes. Running the compiler command with the -v option shows that the -I directives are then ignored, because they're seen as duplicates of the system paths.
Your Environment
My development environment is:
MacOS 10.15.7
Apple clang version 12
The latest commit in my clone of mypy is 05d9fb
brew install a recent version of Google Test.
Python interpreter version: 3.9
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.
Línea de trabajo
Comienza por mypyc/test/test_external.py y por mypyc/external/googletest/make/Makefile en la línea 22. Reproduce la prueba con un Google Test instalado en el sistema, inspecciona el comando del compilador y las rutas de inclusión, y confirma que la biblioteca de Google Test se compila correctamente cuando esos encabezados están instalados.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cpp, python
- Área
- build-system, testing-qa
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 35/100