From 9dc569945f92a14c708f2a1e16e9a9d96063e000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 3 Sep 2019 18:29:30 +0200 Subject: [PATCH] python: a better way to skip GL tests. Because we want to test building GLX, EGL and WGL implementations. --- package/ci/travis-desktop.sh | 7 +++---- src/python/magnum/test/__init__.py | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package/ci/travis-desktop.sh b/package/ci/travis-desktop.sh index 74c7c4f..781963d 100755 --- a/package/ci/travis-desktop.sh +++ b/package/ci/travis-desktop.sh @@ -18,8 +18,7 @@ cmake .. \ ninja install cd ../.. -# Magnum. Keep the WindowlessApplication disabled as otherwise it would -# attempt to run GL tests. We don't want that. +# Magnum git clone --depth 1 git://github.com/mosra/magnum.git cd magnum mkdir build && cd build @@ -42,7 +41,7 @@ cmake .. \ -DWITH_VK=OFF \ -DWITH_GLFWAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ - -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=OFF \ + -DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON \ -G Ninja ninja install cd ../.. @@ -68,7 +67,7 @@ cd ../../../src/python/corrade coverage run -m unittest -v && cp .coverage ../.coverage.corrade 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 cd ../../../doc/python diff --git a/src/python/magnum/test/__init__.py b/src/python/magnum/test/__init__.py index 2128587..b0f85af 100644 --- a/src/python/magnum/test/__init__.py +++ b/src/python/magnum/test/__init__.py @@ -34,6 +34,8 @@ from magnum import * from magnum import platform 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 raise unittest.SkipTest('no WindowlessApplication found')