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 8, 2018
1 parent 44f1a0c commit 8af543f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/test.gi
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ InstallGlobalFunction(RunTests, function(arg)
t := Runtime() - t;
CloseStream(fres);
CloseStream(s);
# check whether the user aborted by pressing ctrl-C
if StartsWith(res, "Error, user interrupt") then
BreakOnError := breakOnError;
Error("user interrupt");
BreakOnError := opts.breakOnError;
fi;
Add(cmp, res);
Add(times, t);
od;
Expand Down

0 comments on commit 8af543f

Please sign in to comment.