refactor(tests): Move to native_posix_64 target.

* Allows removing multilib from docker images
* Run properly in aarch64 host docker
  containers for testing on Rasberry Pi.
* Small sticky-keys fix to initialize w/ correct
  constant for max uin32_t value.
This commit is contained in:
Peter Johanson 2022-03-24 11:38:14 +00:00 committed by Pete Johanson
parent 35db784b5d
commit 953f5212a8
179 changed files with 62 additions and 3 deletions

View file

@ -0,0 +1,11 @@
CONFIG_KSCAN=n
CONFIG_ZMK_KSCAN_MOCK_DRIVER=y
CONFIG_ZMK_KSCAN_GPIO_DRIVER=n
CONFIG_GPIO=n
# Enable to have the native posix build expose USBIP device(s)
# CONFIG_ZMK_USB=y
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

View file

@ -0,0 +1,18 @@
#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";
label = "KSCAN_MOCK";
rows = <2>;
columns = <2>;
exit-after;
};
};

View file

@ -13,7 +13,7 @@ if [ $path = "all" ]; then
path="tests" path="tests"
fi fi
testcases=$(find $path -name native_posix.keymap -exec dirname \{\} \;) testcases=$(find $path -name native_posix_64.keymap -exec dirname \{\} \;)
num_cases=$(echo "$testcases" | wc -l) num_cases=$(echo "$testcases" | wc -l)
if [ $num_cases -gt 1 ]; then if [ $num_cases -gt 1 ]; then
echo "" > ./build/tests/pass-fail.log echo "" > ./build/tests/pass-fail.log
@ -26,7 +26,7 @@ fi
testcase="$path" testcase="$path"
echo "Running $testcase:" echo "Running $testcase:"
west build -d build/$testcase -b native_posix -- -DZMK_CONFIG="$(pwd)/$testcase" > /dev/null 2>&1 west build -d build/$testcase -b native_posix_64 -- -DZMK_CONFIG="$(pwd)/$testcase" > /dev/null 2>&1
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
echo "FAILED: $testcase did not build" | tee -a ./build/tests/pass-fail.log echo "FAILED: $testcase did not build" | tee -a ./build/tests/pass-fail.log
exit 1 exit 1

View file

@ -26,7 +26,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#define ZMK_BHV_STICKY_KEY_MAX_HELD 10 #define ZMK_BHV_STICKY_KEY_MAX_HELD 10
#define ZMK_BHV_STICKY_KEY_POSITION_FREE ULONG_MAX #define ZMK_BHV_STICKY_KEY_POSITION_FREE UINT32_MAX
struct behavior_sticky_key_config { struct behavior_sticky_key_config {
uint32_t release_after_ms; uint32_t release_after_ms;

View file

@ -0,0 +1,17 @@
#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,10000)
ZMK_MOCK_RELEASE(0,0,10)
ZMK_MOCK_PRESS(0,1,30)
ZMK_MOCK_RELEASE(0,1,30)
ZMK_MOCK_PRESS(0,0,10)
ZMK_MOCK_RELEASE(0,0,30)
ZMK_MOCK_PRESS(0,1,30)
ZMK_MOCK_RELEASE(0,1,1000)
>;
};

Some files were not shown because too many files have changed in this diff Show more