From 849c67e719a0aaf7155ec27ee13d9d85b0ee8c53 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 8 Mar 2024 10:25:52 -0800 Subject: [PATCH] Add more on-device tests and a test harness --- testing/device-testing/.gitignore | 1 + testing/device-testing/Makefile | 20 +++++++++++++++++++ .../{mouse_keys_defaults.py => test.py} | 0 ..._off_after_reboot_and_reset.py => test.py} | 0 ..._off_after_reboot_and_reset.py => test.py} | 0 5 files changed, 21 insertions(+) create mode 100644 testing/device-testing/.gitignore create mode 100644 testing/device-testing/Makefile rename testing/device-testing/mouse-keys-defaults/{mouse_keys_defaults.py => test.py} (100%) rename testing/device-testing/spacecadet-off/{space_cadet_off_after_reboot_and_reset.py => test.py} (100%) rename testing/device-testing/sticky-keys-off/{sticky_off_after_reboot_and_reset.py => test.py} (100%) diff --git a/testing/device-testing/.gitignore b/testing/device-testing/.gitignore new file mode 100644 index 0000000000..c18dd8d83c --- /dev/null +++ b/testing/device-testing/.gitignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/testing/device-testing/Makefile b/testing/device-testing/Makefile new file mode 100644 index 0000000000..bde80127a1 --- /dev/null +++ b/testing/device-testing/Makefile @@ -0,0 +1,20 @@ +# Makefile for running Python tests + +# Shell to use with Make +SHELL := /bin/bash + +# Find all Python test scripts +TEST_SCRIPTS := $(shell find . -type f -name 'test.py' ) + +.PHONY: test + +test-on-hardware-wiping-your-device: + @for script in $(TEST_SCRIPTS) ; do \ + echo "Running $$script..." ; \ + python -m unittest $$script ; \ + if [ $$? -ne 0 ]; then \ + echo "Test failed: $$script" ; \ + exit 1 ; \ + fi ; \ + done + diff --git a/testing/device-testing/mouse-keys-defaults/mouse_keys_defaults.py b/testing/device-testing/mouse-keys-defaults/test.py similarity index 100% rename from testing/device-testing/mouse-keys-defaults/mouse_keys_defaults.py rename to testing/device-testing/mouse-keys-defaults/test.py diff --git a/testing/device-testing/spacecadet-off/space_cadet_off_after_reboot_and_reset.py b/testing/device-testing/spacecadet-off/test.py similarity index 100% rename from testing/device-testing/spacecadet-off/space_cadet_off_after_reboot_and_reset.py rename to testing/device-testing/spacecadet-off/test.py diff --git a/testing/device-testing/sticky-keys-off/sticky_off_after_reboot_and_reset.py b/testing/device-testing/sticky-keys-off/test.py similarity index 100% rename from testing/device-testing/sticky-keys-off/sticky_off_after_reboot_and_reset.py rename to testing/device-testing/sticky-keys-off/test.py