From 1865e334265ce67ca4444c899596e3a75dce993c Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 14 Oct 2020 21:04:58 -0700 Subject: [PATCH 1/4] Lift duplication of command to a var --- bin/kaleidoscope-builder | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 8e0094ba..46b3bd71 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -259,26 +259,21 @@ check_bootloader_port_and_flash () { } flash_over_usb () { - if [ "${ARDUINO_VERBOSE}" != "-verbose" ]; then - ${AVRDUDE} \ + + FLASH_CMD=${AVRDUDE} \ -C "${AVRDUDE_CONF}" \ -p"${MCU}" \ -cavr109 \ -D \ -P "${DEVICE_PORT_BOOTLOADER}" \ -b57600 \ - "-Uflash:w:${HEX_FILE_PATH}:i" \ - 2>&1 |grep -v ^avrdude | grep -v '^$' |grep -v '^ ' | grep -vi programmer + "-Uflash:w:${HEX_FILE_PATH}:i" + + if [ "${ARDUINO_VERBOSE}" != "-verbose" ]; then + ${FLASH_CMD} 2>&1 |grep -v ^avrdude | grep -v '^$' |grep -v '^ ' | grep -vi programmer return "${PIPESTATUS[0]}" else - ${AVRDUDE} \ - -C "${AVRDUDE_CONF}" \ - -p"${MCU}" \ - -cavr109 \ - -D \ - -P "${DEVICE_PORT_BOOTLOADER}" \ - -b57600 \ - "-Uflash:w:${HEX_FILE_PATH}:i" + ${FLASH_CMD} return $? fi } From bbc84f6f33f2e86de54844a754d404c89e8ff870 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 14 Oct 2020 21:27:32 -0700 Subject: [PATCH 2/4] move build-gtest-gmock into the Makefile --- Makefile | 4 ++++ bin/kaleidoscope-builder | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 7682689b..ef2d92f4 100644 --- a/Makefile +++ b/Makefile @@ -70,3 +70,7 @@ $(info ) endif include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk + +build-gtest-gmock: + (cd testing/googletest && cmake .) + $(MAKE) -C testing/googletest diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 46b3bd71..665c7ced 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -592,11 +592,6 @@ EOF fi } -build_gtest_gmock() { - kaleidoscope_dir="$(dirname "$0")/.." - (cd "${kaleidoscope_dir}/testing/googletest" && cmake . && make) -} - run_tests() { (cd "${BOARD_HARDWARE_PATH}/keyboardio" && make prepare-virtual) build_gtest_gmock From 383a29d3e383a49cdd15daa2e08bb50e9d1b43a3 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 14 Oct 2020 21:53:01 -0700 Subject: [PATCH 3/4] move run-tests out to the Makefile --- Makefile | 8 ++++++++ bin/kaleidoscope-builder | 15 --------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index ef2d92f4..f6ca027d 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,14 @@ endif include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk + +prepare-virtual: + $(MAKE) -C $(BOARD_HARDWARE_PATH)/keyboardio prepare-virtual + +run-tests: prepare-virtual build-gtest-gmock + $(MAKE) -c tests + @: # blah + build-gtest-gmock: (cd testing/googletest && cmake .) $(MAKE) -C testing/googletest diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 665c7ced..412ab88d 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -592,19 +592,6 @@ EOF fi } -run_tests() { - (cd "${BOARD_HARDWARE_PATH}/keyboardio" && make prepare-virtual) - build_gtest_gmock - kaleidoscope_dir="$(dirname "$0")/.." - cd "${kaleidoscope_dir}/tests" - ${MAKE:-make} -} - -docker_tests() { - kaleidoscope_dir="$(dirname "$0")/.." - cd "${kaleidoscope_dir}" - bin/run-docker make -C tests all -} usage () { cat <<- EOF @@ -644,8 +631,6 @@ usage () { build-all Build all Sketches we can find. - run-tests | docker-tests - Builds and runs the test suite, on the host, and in docker, respectively. EOF } From afc8388cd1b08556c441b35ba4a98f436a44a37f Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 14 Oct 2020 21:59:52 -0700 Subject: [PATCH 4/4] Move a bunch of makefile targets from the generic sketch makefile --- Makefile | 26 ++++++++++++++++++++++++++ bin/kaleidoscope-builder | 4 ++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f6ca027d..fb299fa2 100644 --- a/Makefile +++ b/Makefile @@ -75,6 +75,13 @@ include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk prepare-virtual: $(MAKE) -C $(BOARD_HARDWARE_PATH)/keyboardio prepare-virtual + +simulator-tests: prepare-virtual + $(MAKE) -C tests all + +docker-simulator-tests: + BOARD_HARDWARE_PATH="$(BOARD_HARDWARE_PATH)" ./bin/run-docker "make simulator-tests" + run-tests: prepare-virtual build-gtest-gmock $(MAKE) -c tests @: # blah @@ -82,3 +89,22 @@ run-tests: prepare-virtual build-gtest-gmock build-gtest-gmock: (cd testing/googletest && cmake .) $(MAKE) -C testing/googletest + +adjust-git-timestamps: + bin/set-timestamps-from-git + +find-filename-conflicts: + @if [ -d "bin" ]; then \ + bin/find-filename-conflicts; \ + fi + +SMOKE_SKETCHES=$(shell if [ -d ./examples ]; then find ./examples -type f -name \*ino | xargs -n 1 dirname; fi) + +smoke-sketches: $(SMOKE_SKETCHES) + @echo "Smoke-tested all the sketches" + +.PHONY: force + + +$(SMOKE_SKETCHES): force + @BOARD_HARDWARE_PATH="$(BOARD_HARDWARE_PATH)" $(KALEIDOSCOPE_BUILDER_DIR)/kaleidoscope-builder $@ compile diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 412ab88d..f1b332c1 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -260,14 +260,14 @@ check_bootloader_port_and_flash () { flash_over_usb () { - FLASH_CMD=${AVRDUDE} \ + FLASH_CMD=$(${AVRDUDE} \ -C "${AVRDUDE_CONF}" \ -p"${MCU}" \ -cavr109 \ -D \ -P "${DEVICE_PORT_BOOTLOADER}" \ -b57600 \ - "-Uflash:w:${HEX_FILE_PATH}:i" + "-Uflash:w:${HEX_FILE_PATH}:i") if [ "${ARDUINO_VERBOSE}" != "-verbose" ]; then ${FLASH_CMD} 2>&1 |grep -v ^avrdude | grep -v '^$' |grep -v '^ ' | grep -vi programmer