Skip to content

Commit

Permalink
test(core): update per review comments
Browse files Browse the repository at this point in the history
Fixes: #10183

Co-authored-by: Marc Durdin <[email protected]>
  • Loading branch information
srl295 and mcdurdin committed May 24, 2024
1 parent f3a80f5 commit e48f6c3
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions core/tests/unit/ldml/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ endif

# Build ldml test executable

keyboard_build_path = join_paths(meson.current_build_dir(),'keyboards')
keyboard_build_path = meson.current_build_dir() / 'keyboards'

if cpp_compiler.get_id() == 'emscripten'
tests_flags = ['--embed-file', join_paths(meson.current_build_dir(),'keyboards','@')]
tests_flags += ['--embed-file', join_paths(meson.current_build_dir(),'invalid-keyboards','@')]
tests_flags += ['--embed-file', join_paths(meson.current_build_dir(),'nodeversions.json') + '@nodeversions.json']
tests_flags += ['--embed-file', join_paths(meson.current_build_dir(),'package.json') + '@package.json']
tests_flags += ['--embed-file', join_paths(meson.current_build_dir(),'Blocks.txt') + '@Blocks.txt']
tests_flags = ['--embed-file', meson.current_build_dir() / 'keyboards' / '@']
tests_flags += ['--embed-file', meson.current_build_dir() / 'invalid-keyboards' / '@']
tests_flags += ['--embed-file', meson.current_build_dir() / 'nodeversions.json' + '@nodeversions.json']
tests_flags += ['--embed-file', meson.current_build_dir() / 'package.json' + '@package.json']
tests_flags += ['--embed-file', meson.current_build_dir() / 'Blocks.txt' + '@Blocks.txt']
test_path = '/'
test_unicode_path = '/'
invalid_test_path = '/'
Expand All @@ -53,9 +53,9 @@ if cpp_compiler.get_id() == 'emscripten'
'-sEXPORTED_RUNTIME_METHODS=[\'UTF8ToString\']']
else
tests_flags = []
test_path = join_paths(meson.current_build_dir(),'keyboards')
test_unicode_path = join_paths(meson.current_build_dir())
invalid_test_path = join_paths(meson.current_build_dir(),'invalid-keyboards')
test_path = meson.current_build_dir() / 'keyboards'
test_unicode_path = meson.current_build_dir()
invalid_test_path = meson.current_build_dir() / 'invalid-keyboards'
endif

# copy package.json into build dir for test use
Expand All @@ -71,7 +71,7 @@ configure_file(
)

configure_file(
command: [node, join_paths(meson.current_source_dir(), 'write_node_versions.js'),'@OUTPUT@'],
command: [node, meson.current_source_dir() / 'write_node_versions.js','@OUTPUT@'],
output: 'nodeversions.json',
)

Expand Down Expand Up @@ -120,18 +120,18 @@ if cpp_compiler.get_id() == 'emscripten'
normalization_tests_flags += ['-lnodefs.js', '-sEXPORTED_RUNTIME_METHODS=[\'UTF8ToString\']']
endif

tc = executable('test_context_normalization',
test_context_normalization = executable('test_context_normalization',
['test_context_normalization.cpp', common_test_files],
cpp_args: defns + warns,
include_directories: [inc, libsrc, '../../../../developer/src/ext/json'],
link_args: links + normalization_tests_flags,
dependencies: [icu_uc, icu_i18n],
objects: lib.extract_all_objects(recursive: false))
test('test_context_normalization', tc, suite: 'ldml')
test('test_context_normalization', test_context_normalization, suite: 'ldml')

# Build and run additional test_unicode test

u = executable('test_unicode', 'test_unicode.cpp',
test_unicode = executable('test_unicode', 'test_unicode.cpp',
['test_unicode.cpp', common_test_files],
cpp_args: defns + warns,
include_directories: [inc, libsrc, '../../../../developer/src/ext/json'],
Expand All @@ -141,27 +141,27 @@ u = executable('test_unicode', 'test_unicode.cpp',

)

test('test_unicode', u, suite: 'ldml',
test('test_unicode', test_unicode, suite: 'ldml',
args: [
join_paths(test_unicode_path, 'nodeversions.json'),
join_paths(test_unicode_path, 'package.json'),
join_paths(test_unicode_path, 'Blocks.txt'),
test_unicode_path / 'nodeversions.json',
test_unicode_path / 'package.json',
test_unicode_path / 'Blocks.txt',
],
)

# Run tests on all keyboards (`tests` defined in keyboards/meson.build)

foreach kbd : tests
kbd_src = join_paths(test_path, kbd) + '.xml'
kbd_obj = join_paths(test_path, kbd) + '.kmx'
kbd_src = test_path / kbd + '.xml'
kbd_obj = test_path / kbd + '.kmx'
test(kbd, ldml, args: [kbd_src, kbd_obj], suite: 'ldml-keyboards')
endforeach

# Run tests on all invalid keyboards (`invalid_tests` defined in invalid-keyboards/meson.build)

foreach kbd : invalid_tests
kbd_src = join_paths(invalid_test_path, kbd) + '.xml'
kbd_obj = join_paths(invalid_test_path, kbd) + '.kmx'
kbd_src = invalid_test_path / kbd + '.xml'
kbd_obj = invalid_test_path / kbd + '.kmx'
test(kbd, ldml, args: [kbd_src, kbd_obj], suite: 'ldml-invalid-keyboards')
# todo: consider if we should use `should_fail: true`?
endforeach

0 comments on commit e48f6c3

Please sign in to comment.