diff --git a/Makefile b/Makefile index 7682689b..fb299fa2 100644 --- a/Makefile +++ b/Makefile @@ -70,3 +70,41 @@ $(info ) endif 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 + +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 8e0094ba..f1b332c1 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 } @@ -597,24 +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 - 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 @@ -654,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 }