Fixup python tests.

This commit is contained in:
Nick Brassel 2024-08-12 23:26:09 +10:00
parent bdee456a0d
commit f92d6ec070
No known key found for this signature in database
3 changed files with 21 additions and 24 deletions

View File

@ -35,9 +35,9 @@ __ENCODER_MAP_GOES_HERE__
__MACRO_OUTPUT_GOES_HERE__
#ifdef OTHER_KEYMAP_C
#if __has_include_next(OTHER_KEYMAP_C)
#include_next OTHER_KEYMAP_C
#endif // __has_include_next(OTHER_KEYMAP_C)
# if __has_include_next(OTHER_KEYMAP_C)
# include_next OTHER_KEYMAP_C
# endif // __has_include_next(OTHER_KEYMAP_C)
#endif // OTHER_KEYMAP_C
"""

View File

@ -155,17 +155,18 @@ 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
# if __has_include_next(OTHER_KEYMAP_C)
# include_next OTHER_KEYMAP_C
# endif // __has_include_next(OTHER_KEYMAP_C)
#endif // OTHER_KEYMAP_C
"""
@ -193,28 +194,23 @@ 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
# if __has_include_next(OTHER_KEYMAP_C)
# include_next OTHER_KEYMAP_C
# endif // __has_include_next(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])

View File

@ -20,17 +20,18 @@ 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
# if __has_include_next(OTHER_KEYMAP_C)
# include_next OTHER_KEYMAP_C
# endif // __has_include_next(OTHER_KEYMAP_C)
#endif // OTHER_KEYMAP_C
"""