feat(windows): Rename kbd file fix meson build for key list test

This commit is contained in:
Ross 2021-11-15 12:16:10 +10:00
parent 4d1eee983c
commit 6f6600a501
4 changed files with 20 additions and 7 deletions

View file

@ -32,16 +32,15 @@ km_kbp_keyboard_key kb_key_expected_list[] = {{49,16384},{50,16384},{66,16416},{
* The purpose of this test is to verify that `km_kbp_keyboard_get_key_list`
* returns list of all the keys used for a keyboard that core as loaded.
*
* @param source_path Path to kmx keyboard file
* @param source_file Path to kmx keyboard file
*/
void test_key_list(const km::kbp::path &source_path){
void test_key_list(const km::kbp::path &source_file){
km_kbp_keyboard * test_kb = nullptr;
km_kbp_state * test_state = nullptr;
km_kbp_keyboard_key * kb_key_list;
km::kbp::path const source_keybard = "049 - groups ctrlalt.kmx";
km::kbp::path full_path = km::kbp::path::join(source_path, source_keybard);
km::kbp::path full_path = source_file;
try_status(km_kbp_keyboard_load(full_path.native().c_str(), &test_kb));

View file

@ -1,4 +1,4 @@
c Description: Tests multiple groups. Purpose here is to interleave output and backspaces from kmx processor to consumer
c Description: Tests multiple groups. This keyboard is used to test km_kbp_keyboard_get_key_list API call
c keys: [K_1][K_2]
c expected: abc
c context:

Binary file not shown.

View file

@ -202,13 +202,27 @@ else
endforeach
endif
# test for key rule keys
# test for km_kbp_keyboard_get_key_list
key_e = executable('key_list', 'kmx_key_list.cpp',
cpp_args: defns,include_directories: [inc, libsrc],
link_args: links,
dependencies: [rust_mock_processor],
objects: lib.extract_all_objects())
test('key_list', key_e, args: [test_path] )
test_kbd = 'kmx_key_list'
if kmcomp.found()
kbd_src = files(test_kbd + '.kmn')
kbd_obj = join_paths(meson.current_source_dir(), test_kbd) + '.kmx'
kbd_log = custom_target(test_kbd + '.kmx'.underscorify(),
output: test_kbd + '.log',
input: kbd_src,
command: kmcomp_cmd + ['-s', '-d', '@INPUT@', kbd_obj, '@OUTPUT@']
)
test('key_list', key_e, depends: kbd_log, args: [kbd_obj] )
else
kbd_obj = join_paths(meson.current_source_dir(), test_kbd) + '.kmx'
test('key_list', key_e, args: [kbd_obj] )
endif