Skip to content

Commit a14648c

Browse files
authored
[embind] Give embind tests meaningful names. NFC (#22719)
1 parent 97700f1 commit a14648c

File tree

3 files changed

+19
-24
lines changed

3 files changed

+19
-24
lines changed
File renamed without changes.
File renamed without changes.

test/test_core.py

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7363,9 +7363,9 @@ def test2():
73637363
'': (['-lembind', '-sDYNAMIC_EXECUTION=0'],),
73647364
'flag': (['--bind'],),
73657365
})
7366-
def test_embind(self, args):
7366+
def test_embind_val_basics(self, args):
73677367
self.maybe_closure()
7368-
create_file('test_embind.cpp', r'''
7368+
create_file('test.cpp', r'''
73697369
#include <stdio.h>
73707370
#include <emscripten/val.h>
73717371
@@ -7381,10 +7381,10 @@ def test_embind(self, args):
73817381
return 0;
73827382
}
73837383
''')
7384-
self.do_runf('test_embind.cpp', 'abs(-10): 10\nabs(-11): 11', emcc_args=args)
7384+
self.do_runf('test.cpp', 'abs(-10): 10\nabs(-11): 11', emcc_args=args)
73857385

73867386
@node_pthreads
7387-
def test_embind_2(self):
7387+
def test_embind_basics(self):
73887388
self.maybe_closure()
73897389
self.emcc_args += [
73907390
'-lembind', '--post-js', 'post.js',
@@ -7396,7 +7396,7 @@ def test_embind_2(self):
73967396
out('lerp ' + Module['lerp'](100, 200, 66) + '.');
73977397
}
73987398
''')
7399-
create_file('test_embind_2.cpp', r'''
7399+
create_file('test.cpp', r'''
74007400
#include <stdio.h>
74017401
#include <emscripten.h>
74027402
#include <emscripten/bind.h>
@@ -7414,9 +7414,9 @@ def test_embind_2(self):
74147414
return 0;
74157415
}
74167416
''')
7417-
self.do_runf('test_embind_2.cpp', 'lerp 166')
7417+
self.do_runf('test.cpp', 'lerp 166')
74187418

7419-
def test_embind_3(self):
7419+
def test_embind_unbound_types(self):
74207420
self.emcc_args += ['-lembind', '--post-js', 'post.js']
74217421
create_file('post.js', '''
74227422
function ready() {
@@ -7427,7 +7427,7 @@ def test_embind_3(self):
74277427
}
74287428
}
74297429
''')
7430-
create_file('test_embind_3.cpp', r'''
7430+
create_file('test.cpp', r'''
74317431
#include <emscripten.h>
74327432
#include <emscripten/bind.h>
74337433
using namespace emscripten;
@@ -7442,16 +7442,16 @@ def test_embind_3(self):
74427442
return 0;
74437443
}
74447444
''')
7445-
self.do_runf('test_embind_3.cpp', 'UnboundTypeError: Cannot call compute due to unbound types: Pi')
7445+
self.do_runf('test.cpp', 'UnboundTypeError: Cannot call compute due to unbound types: Pi')
74467446

7447-
def test_embind_4(self):
7447+
def test_embind_memory_view(self):
74487448
self.emcc_args += ['-lembind', '--post-js', 'post.js']
74497449
create_file('post.js', '''
74507450
function printFirstElement() {
74517451
out(Module['getBufferView']()[0]);
74527452
}
74537453
''')
7454-
create_file('test_embind_4.cpp', r'''
7454+
create_file('test.cpp', r'''
74557455
#include <emscripten.h>
74567456
#include <emscripten/bind.h>
74577457
#include <emscripten/val.h>
@@ -7474,35 +7474,30 @@ def test_embind_4(self):
74747474
return 0;
74757475
}
74767476
''')
7477-
self.do_runf('test_embind_4.cpp', '107')
7477+
self.do_runf('test.cpp', '107')
74787478

7479-
def test_embind_5(self):
7480-
self.do_core_test('test_embind_5.cpp', emcc_args=['-lembind'])
7479+
def test_embind_inheritance(self):
7480+
self.do_core_test('test_embind_inheritance.cpp', emcc_args=['-lembind'])
74817481

74827482
def test_embind_custom_marshal(self):
74837483
self.emcc_args += ['-lembind', '--pre-js', test_file('embind/test_custom_marshal.js')]
74847484
self.do_run_in_out_file_test('embind/test_custom_marshal.cpp', assert_identical=True)
74857485

74867486
def test_embind_float_constants(self):
7487-
self.emcc_args += ['-lembind']
7488-
self.do_run_in_out_file_test('embind/test_float_constants.cpp')
7487+
self.do_run_in_out_file_test('embind/test_float_constants.cpp', emcc_args=['-lembind'])
74897488

74907489
def test_embind_negative_constants(self):
7491-
self.emcc_args += ['-lembind']
7492-
self.do_run_in_out_file_test('embind/test_negative_constants.cpp')
7490+
self.do_run_in_out_file_test('embind/test_negative_constants.cpp', emcc_args=['-lembind'])
74937491

74947492
@also_with_wasm_bigint
74957493
def test_embind_unsigned(self):
7496-
self.emcc_args += ['-lembind']
7497-
self.do_run_in_out_file_test('embind/test_unsigned.cpp')
7494+
self.do_run_in_out_file_test('embind/test_unsigned.cpp', emcc_args=['-lembind'])
74987495

74997496
def test_embind_val(self):
7500-
self.emcc_args += ['-lembind']
7501-
self.do_run_in_out_file_test('embind/test_val.cpp')
7497+
self.do_run_in_out_file_test('embind/test_val.cpp', emcc_args=['-lembind'])
75027498

75037499
def test_embind_val_read_pointer(self):
7504-
self.emcc_args += ['-lembind']
7505-
self.do_runf('embind/test_val_read_pointer.cpp')
7500+
self.do_runf('embind/test_val_read_pointer.cpp', emcc_args=['-lembind'])
75067501

75077502
def test_embind_val_assignment(self):
75087503
err = self.expect_fail([EMCC, test_file('embind/test_val_assignment.cpp'), '-lembind', '-c'])

0 commit comments

Comments
 (0)