From e48f6c39e10bf69e8cf27e872d00aa1546003d57 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 23 May 2024 22:19:36 -0500 Subject: [PATCH] test(core): update per review comments Fixes: #10183 Co-authored-by: Marc Durdin --- core/tests/unit/ldml/meson.build | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/core/tests/unit/ldml/meson.build b/core/tests/unit/ldml/meson.build index 7379341fdf2..f67178dbe97 100644 --- a/core/tests/unit/ldml/meson.build +++ b/core/tests/unit/ldml/meson.build @@ -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 = '/' @@ -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 @@ -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', ) @@ -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'], @@ -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