From 3160dface77dca8bceba1e783c786c0859327794 Mon Sep 17 00:00:00 2001 From: Eric Paniagua Date: Thu, 3 Sep 2020 17:57:05 -0700 Subject: [PATCH] Fix simulator tests, sort of. They can be run individually, but if run all together the output will be split up by build output. Unset VERBOSE to see the ouput more compactly. Signed-off-by: Eric Paniagua --- bin/kaleidoscope-builder | 1 - test/.gitignore | 2 ++ test/simulator/Makefile | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 test/.gitignore diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index dff8f9e5..92c22c81 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -583,7 +583,6 @@ build_gtest_gmock() { run_simulator_tests() { (cd "${BOARD_HARDWARE_PATH}/keyboardio" && make prepare-virtual) - build_gtest_gmock kaleidoscope_dir="$(dirname "$0")/.." cd "${kaleidoscope_dir}/test/simulator" ${MAKE:-make} diff --git a/test/.gitignore b/test/.gitignore new file mode 100644 index 00000000..d6a853a6 --- /dev/null +++ b/test/.gitignore @@ -0,0 +1,2 @@ +**/bin/ +**/lib/ diff --git a/test/simulator/Makefile b/test/simulator/Makefile index fbba1c2d..3e33f767 100644 --- a/test/simulator/Makefile +++ b/test/simulator/Makefile @@ -1,3 +1,5 @@ +BIN_DIR=bin +LIB_DIR=lib TEST_DIRS = $(dir $(wildcard */tests.h)) all: ${TEST_DIRS} @@ -11,7 +13,11 @@ Makefile: ${TEST_DIRS} echo 'Unable to find tests file "$@/tests.h"'; \ else \ echo "Running test in $@"; \ - env LOCAL_CFLAGS='-DTESTING_INCLUDE_FILE="$@/tests.h" "-I$(PWD)/$@"' VERBOSE=1 $(MAKE) -f delegate.mk; \ + rm -rf "${BIN_DIR}" "${LIB_DIR}"; \ + mkdir -p "${BIN_DIR}" "${LIB_DIR}"; \ + env LIBONLY=yes LOCAL_CFLAGS='-DTESTING_INCLUDE_FILE="$@/tests.h" "-I$(PWD)/$@"' OUTPUT_PATH="${PWD}/${LIB_DIR}" VERBOSE=1 $(MAKE) -f delegate.mk; \ + g++ -o "${BIN_DIR}/sketch" -lpthread -g -w -lm -lXtst -lX11 "${LIB_DIR}/sketch-latest.a"; \ + "./${BIN_DIR}/sketch" -t; \ fi .PHONY: FORCE