mirror of https://github.com/zmkfirmware/zmk.git
refactor(tests): Move to native_sim for tests.
This commit is contained in:
parent
1e1d537831
commit
45aef02581
|
|
@ -1,7 +0,0 @@
|
|||
CONFIG_GPIO=n
|
||||
CONFIG_ZMK_BLE=n
|
||||
CONFIG_LOG=y
|
||||
CONFIG_LOG_BACKEND_SHOW_COLOR=n
|
||||
CONFIG_ZMK_LOG_LEVEL_DBG=y
|
||||
CONFIG_DEBUG=y
|
||||
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan;
|
||||
};
|
||||
|
||||
kscan: kscan {
|
||||
compatible = "zmk,kscan-mock";
|
||||
|
||||
rows = <2>;
|
||||
columns = <2>;
|
||||
exit-after;
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zephyr,console = &uart0;
|
||||
zmk,kscan = &kscan;
|
||||
};
|
||||
|
||||
kscan: native_posix_64_kscan_mock {
|
||||
compatible = "zmk,kscan-mock";
|
||||
|
||||
rows = <2>;
|
||||
columns = <2>;
|
||||
exit-after;
|
||||
};
|
||||
|
||||
uart0: uart {
|
||||
status = "okay";
|
||||
compatible = "zephyr,native-posix-uart";
|
||||
/* Dummy current-speed entry to comply with serial
|
||||
* DTS binding
|
||||
*/
|
||||
current-speed = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
&sdl_dc {
|
||||
width = <128>;
|
||||
height = <32>;
|
||||
};
|
||||
|
|
@ -25,7 +25,7 @@ fi
|
|||
ZMK_BUILD_DIR=${ZMK_BUILD_DIR:-${ZMK_SRC_DIR:-.}/build}
|
||||
mkdir -p ${ZMK_BUILD_DIR}/tests
|
||||
|
||||
testcases=$(find $path -name native_posix_64.keymap -exec dirname \{\} \;)
|
||||
testcases=$(find $path -name native_sim.keymap -exec dirname \{\} \;)
|
||||
num_cases=$(echo "$testcases" | wc -l)
|
||||
if [ $num_cases -gt 1 ] || [ "$testcases" != "$path" ]; then
|
||||
echo "" >${ZMK_BUILD_DIR}/tests/pass-fail.log
|
||||
|
|
@ -39,7 +39,7 @@ testcase=$(realpath $path | sed -n -e "s|.*/tests/||p")
|
|||
echo "Running $testcase:"
|
||||
|
||||
build_cmd="west build ${ZMK_SRC_DIR:+-s $ZMK_SRC_DIR} -d ${ZMK_BUILD_DIR}/tests/$testcase \
|
||||
-b native_posix_64 -p -- -DCONFIG_ASSERT=y -DZMK_CONFIG="$(realpath $path)" \
|
||||
-b native_sim/native/64 -p -- -DCONFIG_ASSERT=y -DZMK_CONFIG="$(realpath $path)" \
|
||||
${ZMK_EXTRA_MODULES:+-DZMK_EXTRA_MODULES="$(realpath ${ZMK_EXTRA_MODULES})"}"
|
||||
|
||||
if [ -z ${ZMK_TESTS_VERBOSE} ]; then
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
#include "../behavior_keymap.dtsi"
|
||||
|
||||
&kscan {
|
||||
events = <
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_RELEASE(0,0,10)
|
||||
ZMK_MOCK_PRESS(0,1,10)
|
||||
ZMK_MOCK_RELEASE(0,1,10)
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_RELEASE(0,0,10)
|
||||
ZMK_MOCK_PRESS(0,1,10)
|
||||
ZMK_MOCK_RELEASE(0,1,10)
|
||||
>;
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue