@@ -1839,19 +1839,19 @@ def test_glbook(self):
1839
1839
'Chapter_13/ParticleSystem/CH13_ParticleSystem.o' ,
1840
1840
], configure = None )
1841
1841
1842
- def book_path (* pathelems ):
1843
- return test_file ('third_party/glbook' , * pathelems )
1842
+ def book_path (path ):
1843
+ return test_file ('third_party/glbook' , path )
1844
1844
1845
1845
for program in programs :
1846
1846
print (program )
1847
1847
basename = os .path .basename (program )
1848
1848
args = ['-lGL' , '-lEGL' , '-lX11' ]
1849
1849
if basename == 'CH10_MultiTexture.o' :
1850
- shutil .copyfile (book_path ('Chapter_10' , ' MultiTexture' , ' basemap.tga' ), 'basemap.tga' )
1851
- shutil .copyfile (book_path ('Chapter_10' , ' MultiTexture' , ' lightmap.tga' ), 'lightmap.tga' )
1850
+ shutil .copyfile (book_path ('Chapter_10/ MultiTexture/ basemap.tga' ), 'basemap.tga' )
1851
+ shutil .copyfile (book_path ('Chapter_10/ MultiTexture/ lightmap.tga' ), 'lightmap.tga' )
1852
1852
args += ['--preload-file' , 'basemap.tga' , '--preload-file' , 'lightmap.tga' ]
1853
1853
elif basename == 'CH13_ParticleSystem.o' :
1854
- shutil .copyfile (book_path ('Chapter_13' , ' ParticleSystem' , ' smoke.tga' ), 'smoke.tga' )
1854
+ shutil .copyfile (book_path ('Chapter_13/ ParticleSystem/ smoke.tga' ), 'smoke.tga' )
1855
1855
args += ['--preload-file' , 'smoke.tga' , '-O2' ] # test optimizations and closure here as well for more coverage
1856
1856
1857
1857
self .btest (program ,
@@ -1865,23 +1865,22 @@ def book_path(*pathelems):
1865
1865
'full_es3' : (['-sFULL_ES3' ],)
1866
1866
})
1867
1867
def test_gles2_emulation (self , args ):
1868
- print (args )
1869
1868
shutil .copyfile (test_file ('third_party/glbook/Chapter_10/MultiTexture/basemap.tga' ), 'basemap.tga' )
1870
1869
shutil .copyfile (test_file ('third_party/glbook/Chapter_10/MultiTexture/lightmap.tga' ), 'lightmap.tga' )
1871
1870
shutil .copyfile (test_file ('third_party/glbook/Chapter_13/ParticleSystem/smoke.tga' ), 'smoke.tga' )
1872
1871
1873
1872
for source , reference in [
1874
- (Path ( 'third_party/glbook/Chapter_2' , ' Hello_Triangle' , ' Hello_Triangle_orig.c'), test_file ( 'third_party/glbook/CH02_HelloTriangle.png' ) ),
1875
- # (Path( 'third_party/glbook/Chapter_8', ' Simple_VertexShader', ' Simple_VertexShader_orig.c'), test_file( 'third_party/glbook/CH08_SimpleVertexShader.png') ), # XXX needs INT extension in WebGL
1876
- (Path ( 'third_party/glbook/Chapter_9' , ' TextureWrap' , ' TextureWrap_orig.c'), test_file ( 'third_party/glbook/CH09_TextureWrap.png' ) ),
1877
- # (Path( 'third_party/glbook/Chapter_9', ' Simple_TextureCubemap', ' Simple_TextureCubemap_orig.c'), test_file( 'third_party/glbook/CH09_TextureCubemap.png') ), # XXX needs INT extension in WebGL
1878
- (Path ( 'third_party/glbook/Chapter_9' , ' Simple_Texture2D' , ' Simple_Texture2D_orig.c'), test_file ( 'third_party/glbook/CH09_SimpleTexture2D.png' ) ),
1879
- (Path ( 'third_party/glbook/Chapter_10' , ' MultiTexture' , ' MultiTexture_orig.c'), test_file ( 'third_party/glbook/CH10_MultiTexture.png' ) ),
1880
- (Path ( 'third_party/glbook/Chapter_13' , ' ParticleSystem' , ' ParticleSystem_orig.c'), test_file ( 'third_party/glbook/CH13_ParticleSystem.png' ) ),
1873
+ ('third_party/glbook/Chapter_2/ Hello_Triangle/ Hello_Triangle_orig.c' , 'third_party/glbook/CH02_HelloTriangle.png' ),
1874
+ # ('third_party/glbook/Chapter_8/ Simple_VertexShader/ Simple_VertexShader_orig.c', 'third_party/glbook/CH08_SimpleVertexShader.png'), # XXX needs INT extension in WebGL
1875
+ ('third_party/glbook/Chapter_9/ TextureWrap/ TextureWrap_orig.c' , 'third_party/glbook/CH09_TextureWrap.png' ),
1876
+ # ('third_party/glbook/Chapter_9/ Simple_TextureCubemap/ Simple_TextureCubemap_orig.c', 'third_party/glbook/CH09_TextureCubemap.png'), # XXX needs INT extension in WebGL
1877
+ ('third_party/glbook/Chapter_9/ Simple_Texture2D/ Simple_Texture2D_orig.c' , 'third_party/glbook/CH09_SimpleTexture2D.png' ),
1878
+ ('third_party/glbook/Chapter_10/ MultiTexture/ MultiTexture_orig.c' , 'third_party/glbook/CH10_MultiTexture.png' ),
1879
+ ('third_party/glbook/Chapter_13/ ParticleSystem/ ParticleSystem_orig.c' , 'third_party/glbook/CH13_ParticleSystem.png' ),
1881
1880
]:
1882
1881
print (source )
1883
1882
self .btest (source ,
1884
- reference = reference ,
1883
+ reference = test_file ( reference ) ,
1885
1884
args = ['-I' + test_file ('third_party/glbook/Common' ),
1886
1885
test_file ('third_party/glbook/Common/esUtil.c' ),
1887
1886
test_file ('third_party/glbook/Common/esShader.c' ),
0 commit comments