mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-03 01:17:45 +03:00
test-keymap-util: always use kbd-model-map we ship
This test makes assumptions on the availability of some mappings contained in kbd-model-map and therefore strongly relies on the version shipped by upstream. IOW the test is likely to fail if it's installed on a system with a more comprehensive kbd-model-map. This patch makes the upstream kbd-model-map file available via a symlink in test/testdata/test-keymap-util dir and makes sure that this specific version is always used by test-keymap-util regardless of whether the test is installed and run on a different system or directly run (optionally via meson) from the project working dir.
This commit is contained in:
parent
0bada3f8b7
commit
be0cc2ce6c
@ -190,12 +190,17 @@ static void test_x11_convert_to_vconsole(void) {
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
_cleanup_free_ char *map = NULL;
|
||||
|
||||
test_setup_logging(LOG_DEBUG);
|
||||
|
||||
test_find_language_fallback();
|
||||
test_find_converted_keymap();
|
||||
test_find_legacy_keymap();
|
||||
|
||||
assert_se(get_testdata_dir("test-keymap-util/kbd-model-map", &map) >= 0);
|
||||
assert_se(setenv("SYSTEMD_KBD_MODEL_MAP", map, 1) == 0);
|
||||
|
||||
test_vconsole_convert_to_x11();
|
||||
test_x11_convert_to_vconsole();
|
||||
|
||||
|
@ -13,7 +13,6 @@ test_include_dir = include_directories('.')
|
||||
|
||||
path = run_command(sh, '-c', 'echo "$PATH"').stdout().strip()
|
||||
test_env = environment()
|
||||
test_env.set('SYSTEMD_KBD_MODEL_MAP', kbd_model_map)
|
||||
test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map)
|
||||
test_env.set('PATH', project_build_root + ':' + path)
|
||||
|
||||
|
@ -36,6 +36,9 @@ if install_tests
|
||||
install_subdir('testsuite-63.units',
|
||||
install_dir : testdata_dir)
|
||||
|
||||
install_data(kbd_model_map,
|
||||
install_dir : testdata_dir + '/test-keymap-util')
|
||||
|
||||
testsuite08_dir = testdata_dir + '/testsuite-08.units'
|
||||
install_data('testsuite-08.units/-.mount',
|
||||
install_dir : testsuite08_dir)
|
||||
|
1
test/test-keymap-util/kbd-model-map
Symbolic link
1
test/test-keymap-util/kbd-model-map
Symbolic link
@ -0,0 +1 @@
|
||||
../../src/locale/kbd-model-map
|
Loading…
Reference in New Issue
Block a user