Make it possible to only run a subset of the simulator tests using the TEST_PATH variable

Suggested by @gendankenexperimenter
pull/950/head
Jesse Vincent 4 years ago
parent 9ec11f1b4b
commit e96d06893c
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -80,7 +80,7 @@ simulator-tests: prepare-virtual
$(MAKE) -C tests all $(MAKE) -C tests all
docker-simulator-tests: docker-simulator-tests:
BOARD_HARDWARE_PATH="$(BOARD_HARDWARE_PATH)" ./bin/run-docker "make simulator-tests" BOARD_HARDWARE_PATH="$(BOARD_HARDWARE_PATH)" ./bin/run-docker "make simulator-tests TEST_PATH=\"${TEST_PATH}\""
run-tests: prepare-virtual build-gtest-gmock run-tests: prepare-virtual build-gtest-gmock
$(MAKE) -c tests $(MAKE) -c tests

@ -0,0 +1,32 @@
This is not yet proper documentation about running or writing tests, just some rough notes.
Kaleidoscope includes a simulator that can pretend (to a certain extent) to be a keyboard for the purpose of testing.
On most UNIX-like systems, you can run Kaleidoscope's simulator tests by running
```
make simulator-tests
```
Our simulator currently has some weird linking issues on macOS, so the easiest way to run tests on macOS is using Docker.
```
make docker-simulator-tests
```
During development, when you may be running your tests very frequently, it's sometimes useful to run a subset of tests.
You can control the directory that Kaleidoscope searches for test suites with the 'TEST_PATH' variable.
To only run tests in subdirectories of the 'tests/hid' directory, you'd write:
```
make simulator-tests TEST_PATH=tests/hid
```
or
```
make docker-simulator-tests TEST_PATH=tests/hid
```

@ -4,7 +4,9 @@ LIB_DIR := ${build_dir}/lib
libcommon_a := ${top_dir}/_build/lib/libcommon.a libcommon_a := ${top_dir}/_build/lib/libcommon.a
TESTS ?= $(shell find . -name 'sketch.ino' -exec dirname {} \;) TEST_PATH ?= tests/
TESTS ?= $(shell find ${top_dir}/${TEST_PATH} -name 'sketch.ino' -exec dirname {} \;)
.PHONY: clean cmake-clean all googletest .PHONY: clean cmake-clean all googletest
all: ${TESTS} all: ${TESTS}

Loading…
Cancel
Save