#NEWLINE# def testGlTracerGeneration( self ) : #NEWLINE# #INDENT# l = Library . Library ( 'GL' , 'libgles_cm_orig.dll' ) #NEWLINE# l . merge ( Parser . parseSource ( open ( 'data/gl-cpp.h' ) . read ( ) ) ) #NEWLINE# l . merge ( Parser . parseSource ( open ( 'data/egl-cpp.h' ) . read ( ) ) ) #NEWLINE# defFile = open ( 'data/opengles11u.def' ) . read ( ) #NEWLINE# for ( function , ordinal ) in Parser . parseDefFile ( defFile ) : #NEWLINE# #INDENT# if ( function in l . functions ) : #NEWLINE# #INDENT# l . functions [ function ] . ordinal = ordinal #NEWLINE# #UNINDENT# #UNINDENT# customSource = '\n    GLenum xglGetError(void)\n    {\n      wtf();\n    }\n    ' #NEWLINE# l . merge ( Parser . parseSource ( customSource ) ) #NEWLINE# T = Library . Type #NEWLINE# l . typeMap [ T ( 'GLenum' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'GLint' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'GLintptr' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'GLuint' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'GLboolean' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'GLbitfield' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'GLsizei' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'GLsizeiptr' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'GLfixed' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'GLclampx' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'GLubyte' ) ] = 'byte' #NEWLINE# l . typeMap [ T ( 'GLshort' ) ] = 'short' #NEWLINE# l . typeMap [ T ( 'GLclampf' ) ] = 'float' #NEWLINE# l . typeMap [ T ( 'GLfloat' ) ] = 'float' #NEWLINE# l . typeMap [ T ( 'void' ) ] = 'void' #NEWLINE# l . typeMap [ T ( 'EGLboolean' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'EGLint' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'EGLDisplay' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'EGLSurface' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'EGLContext' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'EGLConfig' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'EGLBoolean' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'NativeDisplayType' ) ] = 'int' #NEWLINE# l . typeMap [ T ( 'NativeWindowType' ) ] = 'pointer' #NEWLINE# l . typeMap [ T ( 'NativePixmapType' ) ] = 'pointer' #NEWLINE# l . functions [ 'eglTerminate' ] . isTerminator = True #NEWLINE# g = TracerGenerator ( self . config , self . platform , [ l ] ) #NEWLINE# g . generate ( open ( 'generator_test_output.txt' , 'w' ) )