From 2cca6a7a8b5c0374598e4471495a7907fa9d2d34 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 7 Oct 2018 23:51:40 +0200 Subject: [PATCH] Teach Test() to abort test if ctrl-C is pressed 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 --- lib/test.gi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/test.gi b/lib/test.gi index 7cb01dfdd5..4a5f3e7ea9 100644 --- a/lib/test.gi +++ b/lib/test.gi @@ -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;