<s> import unittest <EOL> import os , sys <EOL> from ctypes import * <EOL> from ctypes . util import find_library <EOL> from ctypes . test import is_resource_enabled <EOL> if sys . platform == "<STR_LIT:win32>" : <EOL> lib_gl = find_library ( "<STR_LIT>" ) <EOL> lib_glu = find_library ( "<STR_LIT>" ) <EOL> lib_glut = find_library ( "<STR_LIT>" ) <EOL> lib_gle = None <EOL> elif sys . platform == "<STR_LIT>" : <EOL> lib_gl = lib_glu = find_library ( "<STR_LIT>" ) <EOL> lib_glut = find_library ( "<STR_LIT>" ) <EOL> lib_gle = None <EOL> else : <EOL> lib_gl = find_library ( "<STR_LIT>" ) <EOL> lib_glu = find_library ( "<STR_LIT>" ) <EOL> lib_glut = find_library ( "<STR_LIT>" ) <EOL> lib_gle = find_library ( "<STR_LIT>" ) <EOL> if is_resource_enabled ( "<STR_LIT>" ) : <EOL> if lib_gl or lib_glu or lib_glut or lib_gle : <EOL> print "<STR_LIT>" <EOL> for item in ( ( "<STR_LIT>" , lib_gl ) , <EOL> ( "<STR_LIT>" , lib_glu ) , <EOL> ( "<STR_LIT>" , lib_glut ) , <EOL> ( "<STR_LIT>" , lib_gle ) ) : <EOL> print "<STR_LIT:\t>" , item <EOL> class Test_OpenGL_libs : <EOL> def setup_class ( cls ) : <EOL> cls . gl = cls . glu = cls . gle = cls . glut = None <EOL> if lib_gl : <EOL> cls . gl = CDLL ( lib_gl , mode = RTLD_GLOBAL ) <EOL> if lib_glu : <EOL> cls . glu = CDLL ( lib_glu , RTLD_GLOBAL ) <EOL> if lib_glut : <EOL> try : <EOL> cls . glut = CDLL ( lib_glut ) <EOL> except OSError : <EOL> pass <EOL> if lib_gle : <EOL> try : <EOL> cls . gle = CDLL ( lib_gle ) <EOL> except OSError : <EOL> pass <EOL> if lib_gl : <EOL> def test_gl ( self ) : <EOL> if self . gl : <EOL> self . gl . glClearIndex <EOL> if lib_glu : <EOL> def test_glu ( self ) : <EOL> if self . glu : <EOL> self . glu . gluBeginCurve <EOL> if lib_glut : <EOL> def test_glut ( self ) : <EOL> if self . glut : <EOL> self . glut . glutWireTetrahedron <EOL> if lib_gle : <EOL> def test_gle ( self ) : <EOL> if self . gle : <EOL> self . gle . gleGetJoinStyle <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
