From 158c2853b64bad2cade06871da6bcb86d4524cab Mon Sep 17 00:00:00 2001 From: charles37 Date: Thu, 31 Oct 2024 17:56:48 -0400 Subject: [PATCH] remove should_fail button press test --- .github/workflows/treadmill-ci-test.yml | 1 - hwci/tests/button_print_should_fail.py | 50 ------------------------- 2 files changed, 51 deletions(-) delete mode 100644 hwci/tests/button_print_should_fail.py diff --git a/.github/workflows/treadmill-ci-test.yml b/.github/workflows/treadmill-ci-test.yml index 55594b7..450ea23 100644 --- a/.github/workflows/treadmill-ci-test.yml +++ b/.github/workflows/treadmill-ci-test.yml @@ -51,7 +51,6 @@ jobs: tests/c_hello. tests/mpu_walk_region.py tests/button_print.py - tests/button_print_should_fail.py # tests: | # tests/ble_env_sense.py diff --git a/hwci/tests/button_print_should_fail.py b/hwci/tests/button_print_should_fail.py deleted file mode 100644 index 3f5e1e1..0000000 --- a/hwci/tests/button_print_should_fail.py +++ /dev/null @@ -1,50 +0,0 @@ -# hwci/tests/button_print_should_fail.py - -# Licensed under the Apache License, Version 2.0 or the MIT License. -# SPDX-License-Identifier: Apache-2.0 OR MIT -# Copyright Tock Contributors 2024. - -import logging -from utils.test_helpers import OneshotTest - - -class ButtonPressTest(OneshotTest): - def __init__(self): - super().__init__(apps=["tests/button_print"]) - - def oneshot_test(self, board): - gpio = board.gpio - serial = board.serial - - button_pin = gpio.pin("P0.11") - # Set the pin as output to simulate button press (active low) - button_pin.set_mode("output") - button_pin.write(1) # Ensure button is not pressed initially - - # Start the test - logging.info("Starting Button Press Test") - - # Wait for initial message - output = serial.expect(r"\[TEST\] Button Press", timeout=10) - if not output: - raise Exception("Did not receive expected test start message") - - # Simulate button press - button_pin.write(0) # Active low, so writing 0 simulates press - logging.info("Button pressed (simulated)") - - # Wait for the expected output - output = serial.expect(r"Button Press! Button: 1 Status: 1", timeout=5) - if not output: - raise Exception("Did not receive expected button press message") - - logging.info("Button press message received") - - # Release button - button_pin.write(1) - logging.info("Button released (simulated)") - - logging.info("Button Press Test completed successfully") - - -test = ButtonPressTest()