Skip to content

Commit

Permalink
[embind] Give embind tests meaningful names. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 committed Oct 11, 2024
1 parent ff27062 commit c109ee1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
File renamed without changes.
File renamed without changes.
28 changes: 14 additions & 14 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7363,9 +7363,9 @@ def test2():
'': (['-lembind', '-sDYNAMIC_EXECUTION=0'],),
'flag': (['--bind'],),
})
def test_embind(self, args):
def test_embind_val(self, args):
self.maybe_closure()
create_file('test_embind.cpp', r'''
create_file('test.cpp', r'''
#include <stdio.h>
#include <emscripten/val.h>
Expand All @@ -7381,10 +7381,10 @@ def test_embind(self, args):
return 0;
}
''')
self.do_runf('test_embind.cpp', 'abs(-10): 10\nabs(-11): 11', emcc_args=args)
self.do_runf('test_.cpp', 'abs(-10): 10\nabs(-11): 11', emcc_args=args)

@node_pthreads
def test_embind_2(self):
def test_embind_basics(self):
self.maybe_closure()
self.emcc_args += [
'-lembind', '--post-js', 'post.js',
Expand All @@ -7396,7 +7396,7 @@ def test_embind_2(self):
out('lerp ' + Module['lerp'](100, 200, 66) + '.');
}
''')
create_file('test_embind_2.cpp', r'''
create_file('test.cpp', r'''
#include <stdio.h>
#include <emscripten.h>
#include <emscripten/bind.h>
Expand All @@ -7414,9 +7414,9 @@ def test_embind_2(self):
return 0;
}
''')
self.do_runf('test_embind_2.cpp', 'lerp 166')
self.do_runf('test.cpp', 'lerp 166')

def test_embind_3(self):
def test_embind_unbound_types(self):
self.emcc_args += ['-lembind', '--post-js', 'post.js']
create_file('post.js', '''
function ready() {
Expand All @@ -7427,7 +7427,7 @@ def test_embind_3(self):
}
}
''')
create_file('test_embind_3.cpp', r'''
create_file('test.cpp', r'''
#include <emscripten.h>
#include <emscripten/bind.h>
using namespace emscripten;
Expand All @@ -7442,16 +7442,16 @@ def test_embind_3(self):
return 0;
}
''')
self.do_runf('test_embind_3.cpp', 'UnboundTypeError: Cannot call compute due to unbound types: Pi')
self.do_runf('test.cpp', 'UnboundTypeError: Cannot call compute due to unbound types: Pi')

def test_embind_4(self):
def test_embind_memory_view(self):
self.emcc_args += ['-lembind', '--post-js', 'post.js']
create_file('post.js', '''
function printFirstElement() {
out(Module['getBufferView']()[0]);
}
''')
create_file('test_embind_4.cpp', r'''
create_file('test.cpp', r'''
#include <emscripten.h>
#include <emscripten/bind.h>
#include <emscripten/val.h>
Expand All @@ -7474,10 +7474,10 @@ def test_embind_4(self):
return 0;
}
''')
self.do_runf('test_embind_4.cpp', '107')
self.do_runf('test.cpp', '107')

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

def test_embind_custom_marshal(self):
self.emcc_args += ['-lembind', '--pre-js', test_file('embind/test_custom_marshal.js')]
Expand Down

0 comments on commit c109ee1

Please sign in to comment.