From f74b87e2de1d9405cb2922ea11b87a473671978c Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sun, 18 Oct 2020 23:44:38 -0700 Subject: [PATCH] first pass at something that will actually run simulator tests, at least in docker --- Makefile | 2 +- bin/run-docker | 9 ++++++++- tests/Makefile | 2 +- .../{sketch/sketch.ino => basic-keypress.ino} | 0 .../{sketch/sketch.ino => activation-order.ino} | 0 .../{sketch/sketch.ino => hid-v1.2-consumer-keys.ino} | 0 tests/issues/840/{sketch/sketch.ino => 840.ino} | 0 7 files changed, 10 insertions(+), 3 deletions(-) rename tests/examples/basic-keypress/{sketch/sketch.ino => basic-keypress.ino} (100%) rename tests/features/layers/activation-order/{sketch/sketch.ino => activation-order.ino} (100%) rename tests/hid/hid-v1.2-consumer-keys/{sketch/sketch.ino => hid-v1.2-consumer-keys.ino} (100%) rename tests/issues/840/{sketch/sketch.ino => 840.ino} (100%) diff --git a/Makefile b/Makefile index 8d003505..15cc6dfc 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ prepare-virtual: $(MAKE) -C $(BOARD_HARDWARE_PATH)/keyboardio prepare-virtual -simulator-tests: prepare-virtual +simulator-tests: install-arduino-cli configure-arduino-cli install-arduino-core-avr prepare-virtual $(MAKE) -C tests all docker-simulator-tests: diff --git a/bin/run-docker b/bin/run-docker index fef6b490..9beca0ea 100755 --- a/bin/run-docker +++ b/bin/run-docker @@ -28,9 +28,15 @@ XFER_DIR="$(pwd)/.docker_xfer" mkdir -p "${XFER_DIR}" tar -cf "${XFER_DIR}/kaleidoscope.tar" \ - --exclude bin/arduino-cli --exclude .docker_xfer --exclude .git --exclude _build --exclude testing/googletest/build \ + --exclude .arduino/data \ + --exclude bin/arduino-cli \ + --exclude .docker_xfer \ + --exclude .git \ + --exclude _build \ + --exclude testing/googletest/build \ . +echo "The bundle is coming from ${BOARD_HARDWARE_PATH}/keyboardio" (cd "${BOARD_HARDWARE_PATH}/keyboardio" && tar -cf "${XFER_DIR}/bundle.tar" \ --exclude .git --exclude avr/libraries/Kaleidoscope .) @@ -44,6 +50,7 @@ docker run --rm $DOCKER_RUN_INTERACTIVE_OPTS \ --mount type=volume,source=kaleidoscope-persist,destination=/kaleidoscope-persist,consistency=delegated \ --mount type=volume,source=kaleidoscope-googletest-build,destination=/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope/testing/googletest/build,consistency=delegated \ --mount type=volume,source=kaleidoscope-build,destination=/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope/_build,consistency=delegated \ + --env ARDUINO_DIRECTORIES_USER=/kaleidoscope \ kaleidoscope/docker "$*" diff --git a/tests/Makefile b/tests/Makefile index 41149a2e..bb1b1e1a 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -6,7 +6,7 @@ libcommon_a := ${top_dir}/_build/lib/libcommon.a TEST_PATH ?= tests/ -TESTS ?= $(shell find ${top_dir}/${TEST_PATH} -name 'sketch.ino' -exec dirname {} \;) +TESTS ?= $(shell find ${top_dir}/${TEST_PATH} -name '*.ino' -exec dirname {} \;) .PHONY: clean cmake-clean all googletest generate-testcases: diff --git a/tests/examples/basic-keypress/sketch/sketch.ino b/tests/examples/basic-keypress/basic-keypress.ino similarity index 100% rename from tests/examples/basic-keypress/sketch/sketch.ino rename to tests/examples/basic-keypress/basic-keypress.ino diff --git a/tests/features/layers/activation-order/sketch/sketch.ino b/tests/features/layers/activation-order/activation-order.ino similarity index 100% rename from tests/features/layers/activation-order/sketch/sketch.ino rename to tests/features/layers/activation-order/activation-order.ino diff --git a/tests/hid/hid-v1.2-consumer-keys/sketch/sketch.ino b/tests/hid/hid-v1.2-consumer-keys/hid-v1.2-consumer-keys.ino similarity index 100% rename from tests/hid/hid-v1.2-consumer-keys/sketch/sketch.ino rename to tests/hid/hid-v1.2-consumer-keys/hid-v1.2-consumer-keys.ino diff --git a/tests/issues/840/sketch/sketch.ino b/tests/issues/840/840.ino similarity index 100% rename from tests/issues/840/sketch/sketch.ino rename to tests/issues/840/840.ino