Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of interactive debugger when running tests in watch mode #30

Merged
merged 2 commits into from Apr 2, 2024

Conversation

mattbrictson
Copy link
Owner

Before, mt --watch would take full control of stdin to listen for keyboard commands. This prevented the use of an interactive debugger when a test is being executed.

This PR changes the event loop implementation so that control of stdin is relinquished when running tests. This allows an interactive debugger to be used while tests are running.

Specifically:

  • Move stdin reader (i.e. $stdin.getc) out of a background thread and into the main event loop.
  • $stdin.getc blocks until a character is typed.
  • When the file system listener background thread detects a change, raise an exception in the main event loop to break out of $stdin.getc and proceed to run the tests.

@mattbrictson mattbrictson added the ✨ Feature Adds a new feature label Apr 2, 2024
@mattbrictson mattbrictson merged commit 0b3bb2d into main Apr 2, 2024
6 checks passed
@mattbrictson mattbrictson deleted the watch-and-debug branch April 2, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant