Allow codegen of keymap.json
=> keymap.c
without requiring layers/layout etc. (#23451)
This commit is contained in:
parent
859dab864a
commit
7d8f193988
22 changed files with 105 additions and 120 deletions
|
@ -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])
|
||||
|
|
|
@ -20,17 +20,16 @@ def test_generate_c_pytest_basic():
|
|||
* 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(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
|
||||
"""
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue