-
Notifications
You must be signed in to change notification settings - Fork 161
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
Improve interaction between ctrl-c and Test() #1879
Labels
kind: enhancement
Label for issues suggesting enhancements; and for pull requests implementing enhancements
topic: tests
issues or PRs related to tests
Comments
fingolfin
added
the
kind: enhancement
Label for issues suggesting enhancements; and for pull requests implementing enhancements
label
Nov 8, 2017
fingolfin
added a commit
to fingolfin/gap
that referenced
this issue
Oct 5, 2018
This is a bit of a hack, but seems to work very well in practice. You can even resume the test with `return` if you want (but the interrupted line will still lead to diffs). Resolves gap-system#1879
fingolfin
added a commit
to fingolfin/gap
that referenced
this issue
Oct 6, 2018
This is a bit of a hack, but seems to work very well in practice. You can even resume the test with `return` if you want (but the interrupted line will still lead to diffs). Resolves gap-system#1879
fingolfin
added a commit
to fingolfin/gap
that referenced
this issue
Oct 7, 2018
This is a bit of a hack, but seems to work very well in practice. You can even resume the test with `return` if you want (but the interrupted line will still lead to diffs). Resolves gap-system#1879
fingolfin
added a commit
that referenced
this issue
Oct 8, 2018
This is a bit of a hack, but seems to work very well in practice. You can even resume the test with `return` if you want (but the interrupted line will still lead to diffs). Resolves #1879
ssiccha
pushed a commit
to ssiccha/gap
that referenced
this issue
Mar 27, 2019
This is a bit of a hack, but seems to work very well in practice. You can even resume the test with `return` if you want (but the interrupted line will still lead to diffs). Resolves gap-system#1879
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind: enhancement
Label for issues suggesting enhancements; and for pull requests implementing enhancements
topic: tests
issues or PRs related to tests
Right now, pressing ctrl-c while
Test(...)
is running does not open a break prompt, nor does it abortTest(...)
. Instead, the user interrupt is treated like an error in the code being tested. This makes it difficult to abort certain long running tests; sometimes, if you are lucky, you can press ctrl-c quickly repeatedly to at least exit GAP, but even that can fail.Perhaps we could teach
Test()
and friends to treat user interrupts differently -- i.e. if a user interrupt happens, either abortTest()
, or (for bonus points) actually enter a break prompt (that might be difficult to pull of, though; it's not that important anyway).To implement this, I imagine we'd modify (at least) the following places:
1 .
READ_TEST_OR_LOOP
, to teach it to abort upon user interrupt;2.
FuncREAD_STREAM_LOOP
, to signal whether the operation completed normal, or was interrupted by the user (and possibly more), e.g. via its return value3.
RunTests
inlib/test.gi
then would track the return value ofREAD_STREAM_LOOP
, and if it indicates a user interrupt, would take appropriate steps, e.g. abort itself, and possibly indicate that via a return value, too. Or perhaps better, it could just issue anError("user interrupt detected")
of its own, with the break loop re-enabled; then the user can choose whether to abort the test (viaquit;
), or to continue to the next test file (by doing areturn;
; then I imagine right after theError
,RunTests
would return itself, so that processing the current file ends).The text was updated successfully, but these errors were encountered: