@@ -176,14 +176,15 @@ def decorated(self, *args, **kwargs):
176
176
def also_with_threads (f ):
177
177
assert callable (f )
178
178
179
- @wraps (f )
180
- def decorated (self , * args , ** kwargs ):
181
- f (self , * args , ** kwargs )
182
- print ('(threads)' )
183
- self .emcc_args += ['-pthread' ]
179
+ def metafunc (self , threads , * args , ** kwargs ):
180
+ if threads :
181
+ self .emcc_args += ['-pthread' ]
184
182
f (self , * args , ** kwargs )
185
183
186
- return decorated
184
+ metafunc ._parameterize = {'' : (False ,),
185
+ 'threads' : (True ,)}
186
+
187
+ return metafunc
187
188
188
189
189
190
def skipExecIf (cond , message ):
@@ -1605,25 +1606,20 @@ def test_glfw_minimal(self):
1605
1606
def test_glfw_time (self ):
1606
1607
self .btest_exit ('test_glfw_time.c' , args = ['-sUSE_GLFW=3' , '-lglfw' , '-lGL' ])
1607
1608
1608
- def _test_egl_base (self , * args ):
1609
- self .btest_exit ('test_egl.c' , args = ['-O2' , '-lEGL' , '-lGL' , '-sGL_ENABLE_GET_PROC_ADDRESS' ] + list (args ))
1610
-
1611
- @requires_graphics_hardware
1612
- def test_egl (self ):
1613
- self ._test_egl_base ()
1614
-
1609
+ @parameterized ({
1610
+ '' : ([],),
1611
+ 'proxy_to_pthread' : (['-pthread' , '-sPROXY_TO_PTHREAD' , '-sOFFSCREEN_FRAMEBUFFER' ],),
1612
+ })
1615
1613
@requires_graphics_hardware
1616
- def test_egl_with_proxy_to_pthread (self ):
1617
- self ._test_egl_base ('-pthread' , '-sPROXY_TO_PTHREAD' , '-sOFFSCREEN_FRAMEBUFFER' )
1618
-
1619
- def _test_egl_width_height_base (self , * args ):
1620
- self .btest_exit ('test_egl_width_height.c' , args = ['-O2' , '-lEGL' , '-lGL' ] + list (args ))
1621
-
1622
- def test_egl_width_height (self ):
1623
- self ._test_egl_width_height_base ()
1614
+ def test_egl (self , args ):
1615
+ self .btest_exit ('test_egl.c' , args = ['-O2' , '-lEGL' , '-lGL' , '-sGL_ENABLE_GET_PROC_ADDRESS' ] + args )
1624
1616
1625
- def test_egl_width_height_with_proxy_to_pthread (self ):
1626
- self ._test_egl_width_height_base ('-pthread' , '-sPROXY_TO_PTHREAD' )
1617
+ @parameterized ({
1618
+ '' : ([],),
1619
+ 'proxy_to_pthread' : (['-pthread' , '-sPROXY_TO_PTHREAD' ],),
1620
+ })
1621
+ def test_egl_width_height (self , args ):
1622
+ self .btest_exit ('test_egl_width_height.c' , args = ['-O2' , '-lEGL' , '-lGL' ] + args )
1627
1623
1628
1624
@requires_graphics_hardware
1629
1625
def test_egl_createcontext_error (self ):
0 commit comments