From 3535d91dd74924b4aad37bf96063cada4e920fc7 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 16 Nov 2020 23:59:04 -0800 Subject: [PATCH] maybe this fixes tests --- Makefile | 4 ++-- testing/makefiles/testcase.mk | 2 +- tests/Makefile | 19 ++++++++----------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index c1996bc0..d7185367 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ include $(mkfile_dir)/etc/makefiles/arduino-cli.mk # since this messes with downstream makefiles ifneq ($(TEST_PATH),) - TEST_PATH_ARG="TEST_PATH='$(TEST_PATH)'" +TEST_PATH_ARG="TEST_PATH='$(TEST_PATH)'" endif @@ -42,7 +42,7 @@ simulator-tests: configure-arduino-cli prepare-virtual $(MAKE) -C tests all docker-simulator-tests: - ${TEST_PATH_ARG} ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "make simulator-tests" + ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "make simulator-tests $(TEST_PATH_ARG)" docker-bash: ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "bash" diff --git a/testing/makefiles/testcase.mk b/testing/makefiles/testcase.mk index 5e8a426f..52c2404a 100644 --- a/testing/makefiles/testcase.mk +++ b/testing/makefiles/testcase.mk @@ -51,7 +51,7 @@ ${BIN_DIR}/${BIN_FILE}: ${TEST_OBJS} # We force sketch recompiliation because otherwise, make won't pick up changes to...anything on the arduino side compile-sketch: @echo "link" - install -d "${BIN_DIR}" "${LIB_DIR}" + @install -d "${BIN_DIR}" "${LIB_DIR}" env LIBONLY=yes \ LOCAL_CFLAGS="'-I$(shell pwd)'" \ OUTPUT_PATH="${LIB_DIR}" \ diff --git a/tests/Makefile b/tests/Makefile index 0501454f..3196ae2c 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,7 +1,5 @@ top_dir := $(abspath $(dir $(lastword ${MAKEFILE_LIST}))..) -$(info Top dir is $(top_dir)) - build_dir := ${top_dir}/_build LIB_DIR := ${build_dir}/lib @@ -16,18 +14,17 @@ TESTS ?= $(shell find ${top_dir}/${TEST_PATH} -name '*.ino' -exec dirname {} \; .PHONY: clean cmake-clean all googletest -$(info TEst dir is $(TESTS)) - -all: ${TESTS} - @for test in ${TESTS}; do \ - ${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C ${test} top_dir=${top_dir} testcase=${test} run; \ - done || exit 1 generate-testcases: @for test in ${TESTS}; do \ - ${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C ${test} top_dir=${top_dir} testcase=${test} generate-testcase; \ + ${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $${test} top_dir=${top_dir} testcase=$${test} generate-testcase; \ done +all: ${TESTS} + @for test in ${TESTS}; do \ + ${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $${test} top_dir=${top_dir} testcase=$${test} run; \ + done || exit 1 + cmake-clean: rm -rf "${top_dir}/testing/googletest/build/*" @@ -45,13 +42,13 @@ ${top_dir}/testing/googletest/build/Makefile: install -d ${top_dir}/testing/googletest/build && cd ${top_dir}/testing/googletest/build && cmake .. ${libcommon_a}: - ${MAKE} -f ${top_dir}/testing/makefiles/libcommon.mk -C ${top_dir}/testing + ${MAKE} -f ${top_dir}/testing/makefiles/libcommon.mk -C ${top_dir}/testing all Makefile: @: ${TESTS}: ${libcommon_a} googletest - ${MAKE} -f ${top_dir}/testing/makefiles/testcase.mk -C $@ top_dir=${top_dir} testcase=$@ + ${MAKE} -f ${top_dir}/testing/makefiles/testcase.mk -C $@ top_dir=${top_dir} testcase=$@ build %+run: ${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $* top_dir=${top_dir} testcase=$* run