From be7e4b75ca60ea72280cb863b966240f39994dd1 Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Thu, 9 Jan 2025 14:00:37 +0100 Subject: [PATCH] set an exit code in `pkg/JuliaInterface/makedoc.g` --- pkg/JuliaInterface/makedoc.g | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pkg/JuliaInterface/makedoc.g b/pkg/JuliaInterface/makedoc.g index b9ef8b7f..aa6fc793 100644 --- a/pkg/JuliaInterface/makedoc.g +++ b/pkg/JuliaInterface/makedoc.g @@ -7,6 +7,13 @@ if fail = LoadPackage("AutoDoc", ">= 2014.03.27") then Error("AutoDoc version 2014.03.27 is required."); fi; +# collect output messages +outputstring:= "";; +outputstream:= OutputTextString(outputstring, true);; +SetPrintFormattingStatus(outputstream, false); +SetInfoOutput(InfoGAPDoc, outputstream); +SetInfoOutput(InfoWarning, outputstream); + AutoDoc(rec( autodoc := true, extract_examples:= true, @@ -17,4 +24,19 @@ AutoDoc(rec( ), )); +CloseStream(outputstream); +UnbindInfoOutput(InfoGAPDoc); +UnbindInfoOutput(InfoWarning); +Print(outputstring); + +# evaluate the outputs +outputstring:= ReplacedString(outputstring, "\c", "");; +errors:= Filtered(SplitString(outputstring, "\n"), + x -> StartsWith(x, "#W ") and x <> "#W There are overfull boxes:");; +if Length(errors) = 0 then + QuitGap(true); +else + Print(errors, "\n"); + QuitGap(false); +fi; QUIT;