Browse Source

python: a better way to skip GL tests.

Because we want to test building GLX, EGL and WGL implementations.
appveyor-coverage
Vladimír Vondruš 7 years ago
parent
commit
9dc569945f
  1. 7
      package/ci/travis-desktop.sh
  2. 2
      src/python/magnum/test/__init__.py

7
package/ci/travis-desktop.sh

@ -18,8 +18,7 @@ cmake .. \
ninja install ninja install
cd ../.. cd ../..
# Magnum. Keep the WindowlessApplication disabled as otherwise it would # Magnum
# attempt to run GL tests. We don't want that.
git clone --depth 1 git://github.com/mosra/magnum.git git clone --depth 1 git://github.com/mosra/magnum.git
cd magnum cd magnum
mkdir build && cd build mkdir build && cd build
@ -42,7 +41,7 @@ cmake .. \
-DWITH_VK=OFF \ -DWITH_VK=OFF \
-DWITH_GLFWAPPLICATION=ON \ -DWITH_GLFWAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=OFF \ -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON \
-G Ninja -G Ninja
ninja install ninja install
cd ../.. cd ../..
@ -68,7 +67,7 @@ cd ../../../src/python/corrade
coverage run -m unittest -v && cp .coverage ../.coverage.corrade coverage run -m unittest -v && cp .coverage ../.coverage.corrade
cd ../magnum cd ../magnum
coverage run -m unittest -v && cp .coverage ../.coverage.magnum MAGNUM_SKIP_GL_TESTS=ON coverage run -m unittest -v && cp .coverage ../.coverage.magnum
# Test docstring validity # Test docstring validity
cd ../../../doc/python cd ../../../doc/python

2
src/python/magnum/test/__init__.py

@ -34,6 +34,8 @@ from magnum import *
from magnum import platform from magnum import platform
def setUpModule(): def setUpModule():
if os.environ.get('MAGNUM_SKIP_GL_TESTS') == 'ON':
raise unittest.SkipTest('GL tests skipped')
if not hasattr(platform, 'WindowlessApplication'): # pragma: no cover if not hasattr(platform, 'WindowlessApplication'): # pragma: no cover
raise unittest.SkipTest('no WindowlessApplication found') raise unittest.SkipTest('no WindowlessApplication found')

Loading…
Cancel
Save