aboutsummaryrefslogtreecommitdiff
path: root/lib/python/qmk/tests/test_cli_commands.py
diff options
context:
space:
mode:
authorNick Brassel <[email protected]>2024-11-24 20:32:30 +1100
committerGitHub <[email protected]>2024-11-24 20:32:30 +1100
commit7d8f193988495deb0e12ad79d5104d30c0724bf9 (patch)
treebff63d89048b699e393e8f65ec1c059f0d953d0c /lib/python/qmk/tests/test_cli_commands.py
parent859dab864a0738f577d1da8e7189748ed8109c44 (diff)
downloadqmk_firmware-7d8f193988495deb0e12ad79d5104d30c0724bf9.tar.gz
qmk_firmware-7d8f193988495deb0e12ad79d5104d30c0724bf9.zip
Allow codegen of `keymap.json` => `keymap.c` without requiring layers/layout etc. (#23451)
Diffstat (limited to 'lib/python/qmk/tests/test_cli_commands.py')
-rw-r--r--lib/python/qmk/tests/test_cli_commands.py24
1 files changed, 8 insertions, 16 deletions
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index b10fd8d19d..dd659fe0f2 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -152,17 +152,16 @@ def test_json2c():
* This file was generated by qmk json2c. You may or may not want to
* edit it directly.
*/
+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_1x1(KC_A)
};
-#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
-const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
-
-};
-#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
+#ifdef OTHER_KEYMAP_C
+# include OTHER_KEYMAP_C
+#endif // OTHER_KEYMAP_C
"""
@@ -190,28 +189,21 @@ def test_json2c_stdin():
* This file was generated by qmk json2c. You may or may not want to
* edit it directly.
*/
+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_1x1(KC_A)
};
-#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
-const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
-
-};
-#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
+#ifdef OTHER_KEYMAP_C
+# include OTHER_KEYMAP_C
+#endif // OTHER_KEYMAP_C
"""
-def test_json2c_wrong_json():
- result = check_subcommand('json2c', 'keyboards/handwired/pytest/info.json')
- check_returncode(result, [1])
- assert 'Invalid JSON keymap' in result.stdout
-
-
def test_json2c_no_json():
result = check_subcommand('json2c', 'keyboards/handwired/pytest/basic/keymaps/default/keymap.c')
check_returncode(result, [1])