Skip to content

Commit

Permalink
Teach Test() to abort test if ctrl-C is pressed
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fingolfin committed Oct 5, 2018
1 parent 94e61ab commit 3ba2c06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/test.gi
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ InstallGlobalFunction(RunTests, function(arg)
t := Runtime() - t;
CloseStream(fres);
CloseStream(s);
if res = "Error, user interrupt\n" then
BreakOnError := breakOnError;
Error("user interrupt");
BreakOnError := opts.breakOnError;
fi;
Add(cmp, res);
Add(times, t);
od;
Expand Down

0 comments on commit 3ba2c06

Please sign in to comment.