-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TESTSUITE Add pytest compatible runner to run process-isolated check-…
…scripts
- Loading branch information
Showing
23 changed files
with
605 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
from OpenGL.GLUT import * | ||
from OpenGL.GL import * | ||
|
||
|
||
def main(): | ||
if glutInit: | ||
glutInit(' ') | ||
glutInitDisplayMode(GLUT_SINGLE) | ||
window = glutCreateWindow("hello") | ||
glutDisplayFunc(lambda *args: 1) | ||
# glutMainLoop() | ||
try: | ||
if fgDeinitialize: | ||
fgDeinitialize(False) | ||
except NameError as err: | ||
pass # Older PyOpenGL, you may see a seg-fault here... | ||
print('OK') | ||
else: | ||
print('SKIP') | ||
|
||
|
||
if __name__ == "__main__": | ||
from OpenGL.GLUT import * | ||
from OpenGL.GL import * | ||
glutInit( ' ' ) | ||
glutInitDisplayMode( GLUT_SINGLE ) | ||
window = glutCreateWindow("hello") | ||
glutDisplayFunc( lambda *args: 1 ) | ||
#glutMainLoop() | ||
try: | ||
if fgDeinitialize: fgDeinitialize(False) | ||
except NameError as err: | ||
pass # Older PyOpenGL, you may see a seg-fault here... | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,41 @@ | ||
"""This checking script from https://github.com/mcfletch/pyopengl/issues/6""" | ||
|
||
import OpenGL | ||
import OpenGL.platform.egl | ||
|
||
OpenGL.platform.PLATFORM = p = OpenGL.platform.egl.EGLPlatform() | ||
from OpenGL import EGL | ||
from OpenGL.EGL.VERSION import EGL_1_5 | ||
from OpenGL.EGL.EXT import platform_base | ||
from OpenGL.EGL.MESA import platform_gbm | ||
import ctypes, glob | ||
|
||
|
||
def main(): | ||
cards = sorted(glob.glob("/dev/dri/renderD*")) | ||
if not cards: | ||
print('SKIP') | ||
raise RuntimeError("Need a /dev/dri/renderD* device to do rendering") | ||
if len(cards) > 1: | ||
print("Note, using first card: %s"%(cards[0])) | ||
print("Note, using first card: %s" % (cards[0])) | ||
with open(cards[0], "w") as f: | ||
gbm = ctypes.CDLL("libgbm.so.1") # On Ubuntu, package libgbm1 | ||
gbm = ctypes.CDLL("libgbm.so.1") # On Ubuntu, package libgbm1 | ||
dev = gbm.gbm_create_device(f.fileno()) | ||
dpy = platform_base.eglGetPlatformDisplayEXT( | ||
platform_gbm.EGL_PLATFORM_GBM_MESA, | ||
ctypes.c_void_p(dev), | ||
ctypes.c_void_p(0) | ||
platform_gbm.EGL_PLATFORM_GBM_MESA, ctypes.c_void_p(dev), ctypes.c_void_p(0) | ||
) | ||
print(dpy) | ||
if EGL_1_5.eglGetPlatformDisplay: | ||
dpy = EGL_1_5.eglGetPlatformDisplay( | ||
platform_gbm.EGL_PLATFORM_GBM_MESA, | ||
ctypes.c_void_p(dev), | ||
ctypes.c_void_p(0) | ||
platform_gbm.EGL_PLATFORM_GBM_MESA, | ||
ctypes.c_void_p(dev), | ||
ctypes.c_void_p(0), | ||
) | ||
print(dpy) | ||
else: | ||
print("No EGL_1_5 implementation") | ||
print('OK') | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 16 additions & 5 deletions
21
tests/test_err_check_extension_check.py → tests/check_freeglut_deinit.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,36 @@ | ||
import OpenGL | ||
|
||
OpenGL.ERROR_CHECKING = False | ||
OpenGL.USE_ACCELERATE = False | ||
|
||
from OpenGL.GLUT import * | ||
|
||
def reshape(width, height): pass | ||
def display(): glutSwapBuffers() | ||
|
||
def reshape(width, height): | ||
pass | ||
|
||
|
||
def display(): | ||
glutSwapBuffers() | ||
|
||
|
||
def main(): | ||
glutInit([]) | ||
glutInitDisplayMode(GLUT_RGBA|GLUT_3_2_CORE_PROFILE) | ||
glutInitDisplayMode(GLUT_RGBA | GLUT_3_2_CORE_PROFILE) | ||
glutCreateWindow(b"test") | ||
glutReshapeFunc(reshape) | ||
glutDisplayFunc(display) | ||
|
||
from OpenGL.GL import glGenVertexArrays, glVertex3f | ||
|
||
assert bool(glGenVertexArrays) | ||
try: | ||
if fgDeinitialize: fgDeinitialize(False) | ||
if fgDeinitialize: | ||
fgDeinitialize(False) | ||
except NameError as err: | ||
pass # Older PyOpenGL, you may see a seg-fault here... | ||
pass # Older PyOpenGL, you may see a seg-fault here... | ||
print('OK') | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
#! /usr/bin/env python | ||
"""Attempt to import GLES libraries""" | ||
import os | ||
|
||
if not 'PYOPENGL_PLATFORM' in os.environ: | ||
os.environ['PYOPENGL_PLATFORM'] = 'egl' | ||
from OpenGL.GLES1 import * | ||
from OpenGL.GLES2 import * | ||
from OpenGL.GLES3 import * | ||
|
||
print('OK') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.