Skip to content
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

Rename QUIT_GAP, FORCE_QUIT_GAP and GAP_EXIT_CODE to QuitGap, ForceQuitGap and GapExitCode (the old names remain available as synonyms) #3862

Merged
merged 2 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions benchmark/doublecoset/test1.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ res := Test( "doublecoset1.tst", rec(showProgress := true) );
Print( "*** RUNTIME ", Runtime()-starttime, "\n" );

if res then
QUIT_GAP(0);
QuitGap(0);
else
QUIT_GAP(1);
QuitGap(1);
fi;
4 changes: 2 additions & 2 deletions benchmark/doublecoset/test2.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ res := Test( "doublecoset2.tst", rec(showProgress := true) );
Print( "*** RUNTIME ", Runtime()-starttime, "\n" );

if res then
QUIT_GAP(0);
QuitGap(0);
else
QUIT_GAP(1);
QuitGap(1);
fi;
4 changes: 2 additions & 2 deletions benchmark/doublecoset/test3.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ res := Test( "doublecoset3.tst", rec(showProgress := true) );
Print( "*** RUNTIME ", Runtime()-starttime, "\n" );

if res then
QUIT_GAP(0);
QuitGap(0);
else
QUIT_GAP(1);
QuitGap(1);
fi;
4 changes: 2 additions & 2 deletions benchmark/grpauto/test1.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ res := Test( "permiso.tst", rec(showProgress := true) );
Print( "*** RUNTIME ", Runtime()-starttime, "\n" );

if res then
QUIT_GAP(0);
QuitGap(0);
else
QUIT_GAP(1);
QuitGap(1);
fi;
4 changes: 2 additions & 2 deletions benchmark/grpauto/test2.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ res := Test( "hardiso.tst", rec(showProgress := true) );
Print( "*** RUNTIME ", Runtime()-starttime, "\n" );

if res then
QUIT_GAP(0);
QuitGap(0);
else
QUIT_GAP(1);
QuitGap(1);
fi;
4 changes: 2 additions & 2 deletions benchmark/grpauto/test3.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ res := Test( "hardest.tst", rec(showProgress := true) );
Print( "*** RUNTIME ", Runtime()-starttime, "\n" );

if res then
QUIT_GAP(0);
QuitGap(0);
else
QUIT_GAP(1);
QuitGap(1);
fi;
4 changes: 2 additions & 2 deletions benchmark/grpconst/test1.g
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Print("*** RUNTIME ",Runtime()-starttime,"\n");

if has_errors then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
4 changes: 2 additions & 2 deletions benchmark/grpconst/test2.g
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Print("*** RUNTIME ",Runtime()-starttime,"\n");

if has_errors then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
4 changes: 2 additions & 2 deletions benchmark/grpconst/test3.g
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Print("*** RUNTIME ",Runtime()-starttime,"\n");

if has_errors then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
4 changes: 2 additions & 2 deletions benchmark/primgrp/test1.g
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Print("*** RUNTIME ",Runtime()-starttime,"\n");

if has_errors then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
4 changes: 2 additions & 2 deletions benchmark/primgrp/test2.g
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Print("*** RUNTIME ",Runtime()-starttime,"\n");

if has_errors then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
4 changes: 2 additions & 2 deletions benchmark/primgrp/test3.g
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Print("*** RUNTIME ",Runtime()-starttime,"\n");

if has_errors then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
4 changes: 2 additions & 2 deletions benchmark/smallgrp/test1.g
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Print("*** RUNTIME ",Runtime()-starttime,"\n");

if has_errors then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
4 changes: 2 additions & 2 deletions benchmark/smallgrp/test2.g
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Print("*** RUNTIME ",Runtime()-starttime,"\n");

if has_errors then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
4 changes: 2 additions & 2 deletions benchmark/smallgrp/test3.g
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Print("*** RUNTIME ",Runtime()-starttime,"\n");

if has_errors then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
2 changes: 1 addition & 1 deletion benchmark/transclosure/test1.g
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ for i in [1..6] do
od;

Print("*** RUNTIME ",Runtime()-starttime,"\n");
QUIT_GAP(0);
QuitGap(0);
2 changes: 1 addition & 1 deletion benchmark/transclosure/test2.g
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ i:=7;
t:=TransitiveClosureBinaryRelation(r);

Print("*** RUNTIME ",Runtime()-starttime,"\n");
QUIT_GAP(0);
QuitGap(0);
2 changes: 1 addition & 1 deletion benchmark/transclosure/test3.g
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ i:=8;
t:=TransitiveClosureBinaryRelation(r);

Print("*** RUNTIME ",Runtime()-starttime,"\n");
QUIT_GAP(0);
QuitGap(0);
4 changes: 2 additions & 2 deletions benchmark/transgrp/test1.g
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ l:=Length(MakeTransitiveGroups(12));
Print("*** RUNTIME ",Runtime()-starttime,"\n");
if l<>301 then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
4 changes: 2 additions & 2 deletions benchmark/transgrp/test2.g
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ l:=Length(MakeTransitiveGroups(16));
Print("*** RUNTIME ",Runtime()-starttime,"\n");
if l<>1954 then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
4 changes: 2 additions & 2 deletions benchmark/transgrp/test3.g
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ l:=Length(MakeTransitiveGroups(20));
Print("*** RUNTIME ",Runtime()-starttime,"\n");
if l<>1117 then
Print("*** FAIL\n");
QUIT_GAP(1);
QuitGap(1);
else
QUIT_GAP(0);
QuitGap(0);
fi;
40 changes: 23 additions & 17 deletions doc/ref/mloop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -986,36 +986,43 @@ or <C>brk></C> or <C>brk_<A>nn</A>></C> prompt.
</ManSection>

<ManSection>
<Func Name="GAP_EXIT_CODE" Arg='ret'/>
<Func Name="GapExitCode" Arg='[ret]'/>

<Description>
A <C>GAP_EXIT_CODE</C> sets the return value which will be used when
&GAP; exits. This may be an integer, or a boolean (where
<K>true</K> is interpreted as 0, and
<K>false</K> is interpreted as 1.
<P/>
<Ref Func="GapExitCode"/> sets the exit value which is returned
to the operating system (or parent process) when &GAP; exits.
This may be an integer in the range [-128..127] (other values
are reduced modulo 256), or a boolean. <K>true</K> corresponds
to the return value 0, which by convention is treated as "success".
<K>false</K> corresponds to the return value 1, which by convention
is treated as "failure". The exit value is not changed if no argument
is given.
<P/>
The <E>previous</E> exit code is returned.
</Description>
</ManSection>

<ManSection>
<Func Name="QUIT_GAP" Arg='[ret]'/>
<Func Name="QuitGap" Arg='[ret]'/>

<Description>
A <C>QUIT_GAP</C> acts similarly to the keyword <C>quit</C>. It exits
&GAP; cleanly, calling any function installed using <C>InstallAtExit</C>.
The optional argument will be passed to <C>GAP_EXIT_CODE</C>.
<Ref Func="QuitGap"/> acts similarly to the keyword <C>QUIT</C>, except
<C>QUIT</C> can not be called from a function. It exits
&GAP; cleanly, calling any function installed using <Ref Func="InstallAtExit"/>.
The optional argument <A>ret</A> will be passed to <Ref Func="GapExitCode"/>.
<P/>
</Description>
</ManSection>

<ManSection>
<Func Name="FORCE_QUIT_GAP" Arg='[ret]'/>
<Func Name="ForceQuitGap" Arg='[ret]'/>

<Description>
A <C>FORCE_QUIT_GAP</C> is similar to <C>QUIT_GAP</C>, except it ignores any
functions installed with <C>InstallAtExit</C>, or any other functions
normally run at GAP exit, and exits GAP immediately.
The optional argument will be passed to <C>GAP_EXIT_CODE</C>.
<Ref Func="ForceQuitGap"/> is similar to <Ref Func="QuitGap"/>, except it ignores any
functions installed with <Ref Func="InstallAtExit"/>, or any other functions
normally run at GAP exit, such as flushing any partially outputted lines
to both the screen and files, and exits GAP immediately.
The optional argument <A>ret</A> will be passed to <Ref Func="GapExitCode"/>.
<P/>
</Description>
</ManSection>
Expand All @@ -1027,7 +1034,7 @@ The optional argument will be passed to <C>GAP_EXIT_CODE</C>.

<Description>
Before actually terminating, &GAP; will call (with no arguments) all
of the functions that have been installed using <C>InstallAtExit</C>. These
of the functions that have been installed using <Ref Func="InstallAtExit"/>. These
typically perform tasks such as cleaning up temporary files created
during the session, and closing open files. If an error occurs during
the execution of one of these functions, that function is simply
Expand Down Expand Up @@ -1434,4 +1441,3 @@ interpret.
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<!-- %% -->
<!-- %E -->

2 changes: 1 addition & 1 deletion doc/ref/testconsistency.g
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,6 @@ end;

# Uncomment next line to add ManSections without examples to the test log
# CheckDocCoverage(doc);
QUIT_GAP( CheckManSectionTypes(doc) );
QuitGap( CheckManSectionTypes(doc) );


10 changes: 5 additions & 5 deletions etc/bisect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ echo '
# if ErrorLevel is not defined, something is very wrong, so skip the commit
if not IsBound(ErrorLevel) then
Print("Panic, ErrorLevel not defined, skipping this commit\\n");
FORCE_QUIT_GAP(125);
ForceQuitGap(125);
fi;

# intercept any further break loops and again, bail out
OnBreak:=function()
Print("Panic, break loop was triggered, skipping this commit\\n");
FORCE_QUIT_GAP(125);
ForceQuitGap(125);
end;

# check if we are in an error handler...
Expand All @@ -119,16 +119,16 @@ if ErrorLevel > 0 then
else
# ... for any other error: tell git to skip this commit
Print("Panic, GAP run into an error during startup, skipping this commit\\n");
FORCE_QUIT_GAP(125);
ForceQuitGap(125);
fi;
fi;

# run the actual test
if Test("'${TESTFILE}'") then
Print("Commit is good\\n");
QUIT_GAP(0);
QuitGap(0);
else
Print("Commit is bad\\n");
QUIT_GAP(1);
QuitGap(1);
fi;
' | bin/gap.sh -A -b -q
2 changes: 1 addition & 1 deletion etc/ci-gather-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ls -l "$COVDIR" # for debugging
$GAP -a 500M -m 500M -q <<GAPInput
if LoadPackage("profiling") <> true then
Print("ERROR: could not load profiling package");
FORCE_QUIT_GAP(1);
ForceQuitGap(1);
fi;
d := Directory("$COVDIR");;
Print("Scanning for coverage data...\n");
Expand Down
2 changes: 1 addition & 1 deletion etc/ci-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ else
fi

# check that GAP is at least able to start
echo 'Print("GAP started successfully\n");QUIT_GAP(0);' | ./gap -T
echo 'Print("GAP started successfully\n");QuitGap(0);' | ./gap -T

# packages must be placed inside SRCDIR, as only that
# is a GAP root, while BUILDDIR is not.
Expand Down
8 changes: 4 additions & 4 deletions etc/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ do
$GAP -b <<GAPInput
SaveWorkspace("testpackagesload.wsp");
PrintTo("packagenames", JoinStringsWithSeparator( SortedList(RecNames( GAPInfo.PackagesInfo )),"\n") );
QUIT_GAP(0);
QuitGap(0);
GAPInput
for pkg in $(cat packagenames)
do
Expand Down Expand Up @@ -208,15 +208,15 @@ GAPInput
SetUserPreference("ReproducibleBehaviour", true);
Read("$SRCDIR/tst/testmanuals.g");
SaveWorkspace("testmanuals.wsp");
QUIT_GAP(0);
QuitGap(0);
GAPInput

TESTMANUALSPASS=yes
for ch in $SRCDIR/tst/testmanuals/*.tst
do
$GAP -b -L testmanuals.wsp --cover $COVDIR/$(basename $ch).coverage <<GAPInput || TESTMANUALSPASS=no
TestManualChapter("$ch");
QUIT_GAP(0);
QuitGap(0);
GAPInput
done

Expand All @@ -229,7 +229,7 @@ GAPInput
# Also test a package banner
LoadPackage("polycyclic");
SaveWorkspace("test.wsp");
QUIT_GAP(0);
QuitGap(0);
GAPInput

;;
Expand Down
4 changes: 2 additions & 2 deletions hpcgap/demo/unittest.g
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ end;
TestReportAndExit := function()
if NumTestErrors = 1 then
Print("*** 1 error occurred.\n");
GAP_EXIT_CODE(1);
GapExitCode(1);
elif NumTestErrors > 1 then
Print("*** ", NumTestErrors, " errors occurred.\n");
GAP_EXIT_CODE(1);
GapExitCode(1);
else
Print("*** No errors occurred.\n");
fi;
Expand Down
4 changes: 2 additions & 2 deletions hpcgap/lib/hpc/consoleui.g
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ end);

BindGlobal("CommandQUIT@", function(line)
TERMINAL_CLOSE();
FORCE_QUIT_GAP();
ForceQuitGap();
end);

BindGlobal("InitializeCommands@", function()
Expand Down Expand Up @@ -1087,7 +1087,7 @@ BindGlobal("MULTI_SESSION", function()
CompleteHandShake(ProgramShutdown@);
PROGRAM_CLEAN_UP();
TERMINAL_CLOSE();
QUIT_GAP();
QuitGap();
end);

BindGlobal("ConsoleUIRegisterCommand", function(name, func)
Expand Down
Loading