Skip to content

Commit 5043d63

Browse files
authored
Fix test_embind_2's use of pthreads (#20646)
The test was parameterized as having a pthreads and non-pthreads mode, but the decorator was on the entire test, making it all run as pthreads, which meant the non-pthreads case was not really tested. It seems simplest to just refocus the test as a single test, and use pthreads there for coverage. I don't think we are losing anything of value that way, and it's simpler than adding logic to support both modes in one test.
1 parent 2893d21 commit 5043d63

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/test_core.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7664,14 +7664,14 @@ def test_embind(self, args):
76647664
''')
76657665
self.do_runf('test_embind.cpp', 'abs(-10): 10\nabs(-11): 11', emcc_args=args)
76667666

7667-
@parameterized({
7668-
'': ([],),
7669-
'pthreads': (['-pthread', '-sPROXY_TO_PTHREAD', '-sEXIT_RUNTIME'],),
7670-
})
76717667
@node_pthreads
7672-
def test_embind_2(self, args):
7668+
def test_embind_2(self):
76737669
self.maybe_closure()
7674-
self.emcc_args += ['-lembind', '--post-js', 'post.js'] + args
7670+
self.emcc_args += [
7671+
'-lembind', '--post-js', 'post.js',
7672+
# for extra coverage, test using pthreads
7673+
'-pthread', '-sPROXY_TO_PTHREAD', '-sEXIT_RUNTIME'
7674+
]
76757675
create_file('post.js', '''
76767676
function printLerp() {
76777677
out('lerp ' + Module['lerp'](100, 200, 66) + '.');

0 commit comments

Comments
 (0)