From 08c255b6e45e7fe5553b98267ea8ef5dd5043359 Mon Sep 17 00:00:00 2001 From: xs5871 Date: Thu, 16 Feb 2023 09:21:13 +0000 Subject: [PATCH] Add optional selection of specific unit test to Makefile --- Makefile | 2 +- docs/en/contributing.md | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1cc282c..aaea433 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ test: lint unit-tests .PHONY: unit-tests unit-tests: devdeps - @$(PIPENV) run python3 -m unittest + @$(PIPENV) run python3 -m unittest $(TESTS) reset-bootloader: @echo "===> Rebooting your board to bootloader (safe to ignore file not found errors)" diff --git a/docs/en/contributing.md b/docs/en/contributing.md index 8e2b91e..21921df 100644 --- a/docs/en/contributing.md +++ b/docs/en/contributing.md @@ -27,7 +27,12 @@ to Black formatting as documented in `pyproject.toml`) Unit tests within the `tests` folder mock various CircuitPython modules to allow them to be executed in a desktop development environment. -Execute tests using the command `python -m unittest`. +Execute tests using the command `make unit-tests`. The unit-tests target accepts +an optional environment variable for specifying a subset of tests with python +unittest syntax: +```sh +make unit-tests TESTS="tests.test_capsword tests.test_hold_tap" +``` ## Contributing Documentation While KMK welcomes documentation from anyone with and understanding of the issues