mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-12-02 16:05:09 +00:00
Merge remote-tracking branch 'origin/develop' into xap
This commit is contained in:
commit
a10856d9d8
@ -1,5 +0,0 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
LAYOUT_ortho_1x1(KC_A)
|
||||
};
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"keyboard": "handwired/pytest/has_template",
|
||||
"keymap": "default_json",
|
||||
"layout": "LAYOUT_ortho_1x1",
|
||||
"layers": [["KC_A"]],
|
||||
"author": "qmk",
|
||||
"notes": "This file is a keymap.json file for handwired/pytest/has_template",
|
||||
"version": 1
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "audio.h"
|
||||
|
||||
/* THIS FILE WAS GENERATED AND IS EXPERIMENTAL!
|
||||
*
|
||||
* This file was generated by qmk-compile-json. You may or may not want to
|
||||
* edit it directly.
|
||||
*/
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT(KC_ENTER)
|
||||
};
|
||||
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) {
|
||||
if (clockwise) {
|
||||
tap_code(KC_UP);
|
||||
} else {
|
||||
tap_code(KC_DOWN);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
@ -1,2 +0,0 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"documentation": "This file is a keymap.json file for handwired/pytest/has_template"
|
||||
}
|
@ -142,9 +142,34 @@ def test_list_keymaps_no_keyboard_found():
|
||||
|
||||
|
||||
def test_json2c():
|
||||
result = check_subcommand('json2c', 'keyboards/handwired/pytest/has_template/keymaps/default_json/keymap.json')
|
||||
result = check_subcommand('json2c', 'keyboards/handwired/pytest/basic/keymaps/default_json/keymap.json')
|
||||
check_returncode(result)
|
||||
assert result.stdout == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT_ortho_1x1(KC_A)};\n\n\n'
|
||||
assert result.stdout == """#include QMK_KEYBOARD_H
|
||||
#if __has_include("keymap.h")
|
||||
# include "keymap.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* THIS FILE WAS GENERATED!
|
||||
*
|
||||
* 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] = {
|
||||
\t[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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def test_json2c_macros():
|
||||
@ -156,9 +181,34 @@ def test_json2c_macros():
|
||||
|
||||
|
||||
def test_json2c_stdin():
|
||||
result = check_subcommand_stdin('keyboards/handwired/pytest/has_template/keymaps/default_json/keymap.json', 'json2c', '-')
|
||||
result = check_subcommand_stdin('keyboards/handwired/pytest/basic/keymaps/default_json/keymap.json', 'json2c', '-')
|
||||
check_returncode(result)
|
||||
assert result.stdout == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT_ortho_1x1(KC_A)};\n\n\n'
|
||||
assert result.stdout == """#include QMK_KEYBOARD_H
|
||||
#if __has_include("keymap.h")
|
||||
# include "keymap.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* THIS FILE WAS GENERATED!
|
||||
*
|
||||
* 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] = {
|
||||
\t[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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def test_json2c_wrong_json():
|
||||
@ -223,27 +273,15 @@ def test_info_matrix_render():
|
||||
|
||||
|
||||
def test_c2json():
|
||||
result = check_subcommand("c2json", "-kb", "handwired/pytest/has_template", "-km", "default", "keyboards/handwired/pytest/has_template/keymaps/default/keymap.c")
|
||||
result = check_subcommand("c2json", "-kb", "handwired/pytest/basic", "-km", "default", "keyboards/handwired/pytest/basic/keymaps/default/keymap.c")
|
||||
check_returncode(result)
|
||||
assert result.stdout.strip() == '{"keyboard": "handwired/pytest/has_template", "documentation": "This file is a keymap.json file for handwired/pytest/has_template", "keymap": "default", "layout": "LAYOUT_ortho_1x1", "layers": [["KC_A"]]}'
|
||||
|
||||
|
||||
def test_c2json_nocpp():
|
||||
result = check_subcommand("c2json", "--no-cpp", "-kb", "handwired/pytest/has_template", "-km", "default", "keyboards/handwired/pytest/has_template/keymaps/nocpp/keymap.c")
|
||||
check_returncode(result)
|
||||
assert result.stdout.strip() == '{"keyboard": "handwired/pytest/has_template", "documentation": "This file is a keymap.json file for handwired/pytest/has_template", "keymap": "default", "layout": "LAYOUT", "layers": [["KC_ENTER"]]}'
|
||||
assert result.stdout.strip() == '{"keyboard": "handwired/pytest/basic", "keymap": "default", "layout": "LAYOUT_ortho_1x1", "layers": [["KC_A"]]}'
|
||||
|
||||
|
||||
def test_c2json_stdin():
|
||||
result = check_subcommand_stdin("keyboards/handwired/pytest/has_template/keymaps/default/keymap.c", "c2json", "-kb", "handwired/pytest/has_template", "-km", "default", "-")
|
||||
result = check_subcommand_stdin("keyboards/handwired/pytest/basic/keymaps/default/keymap.c", "c2json", "-kb", "handwired/pytest/basic", "-km", "default", "-")
|
||||
check_returncode(result)
|
||||
assert result.stdout.strip() == '{"keyboard": "handwired/pytest/has_template", "documentation": "This file is a keymap.json file for handwired/pytest/has_template", "keymap": "default", "layout": "LAYOUT_ortho_1x1", "layers": [["KC_A"]]}'
|
||||
|
||||
|
||||
def test_c2json_nocpp_stdin():
|
||||
result = check_subcommand_stdin("keyboards/handwired/pytest/has_template/keymaps/nocpp/keymap.c", "c2json", "--no-cpp", "-kb", "handwired/pytest/has_template", "-km", "default", "-")
|
||||
check_returncode(result)
|
||||
assert result.stdout.strip() == '{"keyboard": "handwired/pytest/has_template", "documentation": "This file is a keymap.json file for handwired/pytest/has_template", "keymap": "default", "layout": "LAYOUT", "layers": [["KC_ENTER"]]}'
|
||||
assert result.stdout.strip() == '{"keyboard": "handwired/pytest/basic", "keymap": "default", "layout": "LAYOUT_ortho_1x1", "layers": [["KC_A"]]}'
|
||||
|
||||
|
||||
def test_clean():
|
||||
|
@ -11,30 +11,43 @@ def test_template_json_pytest_basic():
|
||||
assert templ == {'keyboard': 'handwired/pytest/basic'}
|
||||
|
||||
|
||||
def test_template_c_pytest_has_template():
|
||||
templ = qmk.keymap.template_c('handwired/pytest/has_template')
|
||||
assert templ == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};\n'
|
||||
|
||||
|
||||
def test_template_json_pytest_has_template():
|
||||
templ = qmk.keymap.template_json('handwired/pytest/has_template')
|
||||
assert templ == {'keyboard': 'handwired/pytest/has_template', "documentation": "This file is a keymap.json file for handwired/pytest/has_template"}
|
||||
|
||||
|
||||
def test_generate_c_pytest_has_template():
|
||||
def test_generate_c_pytest_basic():
|
||||
keymap_json = {
|
||||
'keyboard': 'handwired/pytest/has_template',
|
||||
'keyboard': 'handwired/pytest/basic',
|
||||
'layout': 'LAYOUT',
|
||||
'layers': [['KC_A']],
|
||||
'macros': None,
|
||||
}
|
||||
templ = qmk.keymap.generate_c(keymap_json)
|
||||
assert templ == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT(KC_A)};\n'
|
||||
assert templ == """#include QMK_KEYBOARD_H
|
||||
#if __has_include("keymap.h")
|
||||
# include "keymap.h"
|
||||
#endif
|
||||
|
||||
|
||||
def test_generate_json_pytest_has_template():
|
||||
templ = qmk.keymap.generate_json('default', 'handwired/pytest/has_template', 'LAYOUT', [['KC_A']])
|
||||
assert templ == {"keyboard": "handwired/pytest/has_template", "documentation": "This file is a keymap.json file for handwired/pytest/has_template", "keymap": "default", "layout": "LAYOUT", "layers": [["KC_A"]]}
|
||||
/* THIS FILE WAS GENERATED!
|
||||
*
|
||||
* 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] = {
|
||||
\t[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)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def test_generate_json_pytest_basic():
|
||||
templ = qmk.keymap.generate_json('default', 'handwired/pytest/basic', 'LAYOUT', [['KC_A']])
|
||||
assert templ == {"keyboard": "handwired/pytest/basic", "keymap": "default", "layout": "LAYOUT", "layers": [["KC_A"]]}
|
||||
|
||||
|
||||
def test_parse_keymap_c():
|
||||
|
Loading…
Reference in New Issue
Block a user