From 6977c5536be887d5506a8406c247f88fa6934c3d Mon Sep 17 00:00:00 2001 From: Wilf Wilson Date: Sat, 22 May 2021 15:18:30 +0100 Subject: [PATCH 1/2] Update problems in DigraphsTest{Standard/Extreme}, and make more flexible --- gap/utils.gi | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/gap/utils.gi b/gap/utils.gi index 83c381b5d..77502a612 100644 --- a/gap/utils.gi +++ b/gap/utils.gi @@ -140,15 +140,26 @@ end); InstallGlobalFunction(DigraphsTestStandard, function(arg) local opts, dir; - if Length(arg) = 1 and IsRecord(arg[2]) then - opts := arg[1]; + if Length(arg) = 1 and IsRecord(arg[1]) then + opts := ShallowCopy(arg[1]); elif Length(arg) <> 0 then ErrorNoReturn("there must be no arguments, or the argument ", "must be a record"); else - opts := rec(suppressStatusMessage := true, - earlyStop := true, - testOptions := rec(showProgress := false)); + opts := rec(); + fi; + + if not IsBound(opts.suppressStatusMessage) then + opts.suppressStatusMessage := true; + fi; + if not IsBound(opts.earlyStop) then + opts.earlyStop := true; + fi; + if not IsBound(opts.testOptions) or not IsRecord(opts.testOptions) then + opts.testOptions := rec(); + fi; + if not IsBound(opts.testOptions.showProgress) then + opts.testOptions.showProgress := false; fi; dir := DirectoriesPackageLibrary("digraphs", "tst/standard/"); @@ -170,15 +181,29 @@ function(arg) "and try again,"); fi; - if Length(arg) = 1 and IsRecord(arg[2]) then - opts := arg[1]; + if Length(arg) = 1 and IsRecord(arg[1]) then + opts := ShallowCopy(arg[1]); elif Length(arg) <> 0 then ErrorNoReturn("there must be no arguments, or the argument ", "must be a record"); else - opts := rec(suppressStatusMessage := true, - earlyStop := true, - testOptions := rec(showProgress := "some")); + opts := rec(); + fi; + + if not IsBound(opts.suppressStatusMessage) then + opts.suppressStatusMessage := true; + fi; + if not IsBound(opts.earlyStop) then + opts.earlyStop := true; + fi; + if not IsBound(opts.testOptions) or not IsRecord(opts.testOptions) then + opts.testOptions := rec(); + fi; + if not IsBound(opts.testOptions.showProgress) then + opts.testOptions.showProgress := false; + fi; + if not IsBound(opts.testOptions.showProgress) then + opts.suppressStatusMessage := "some"; fi; dir := DirectoriesPackageLibrary("digraphs", "tst/extreme/"); From 24ed11dfc1acb9f9bfbbfed64467df8b4942c272 Mon Sep 17 00:00:00 2001 From: Wilf Wilson Date: Sat, 22 May 2021 14:56:25 +0100 Subject: [PATCH 2/2] test{all/standard}.g: do not finish early --- tst/testall.g | 29 +++++++++++++++++++---------- tst/teststandard.g | 8 ++++---- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/tst/testall.g b/tst/testall.g index 3f8aac689..d5f01246f 100644 --- a/tst/testall.g +++ b/tst/testall.g @@ -1,11 +1,20 @@ -LoadPackage("digraphs"); - -DigraphsMakeDoc(); -if DigraphsTestInstall() - and DigraphsTestStandard() - and DIGRAPHS_RunTest(DigraphsTestManualExamples) - and DigraphsTestExtreme() then - FORCE_QUIT_GAP(0); +############################################################################# +## +#W testall.g +#Y Copyright (C) 2021 Wilf A. Wilson +## +## Licensing information can be found in the README file of this package. +## +############################################################################# +## +LoadPackage("digraphs", false);; +opts := rec(earlyStop := false); +if SizeBlist([DigraphsTestInstall(), + DigraphsTestStandard(opts), + DIGRAPHS_RunTest(DigraphsTestManualExamples), + DigraphsTestExtreme(opts)]) = 4 then + QUIT_GAP(0); +else + QUIT_GAP(1); fi; - -FORCE_QUIT_GAP(1); +FORCE_QUIT_GAP(1); # if we ever get here, there was an error diff --git a/tst/teststandard.g b/tst/teststandard.g index 45dc5a156..c1276bc29 100644 --- a/tst/teststandard.g +++ b/tst/teststandard.g @@ -8,12 +8,12 @@ ############################################################################# ## LoadPackage("digraphs", false);; -# These "{No} errors detected" lines currently have to be printed in this way +# The "{No} errors detected" lines currently have to be printed in this way # to satisfy the automated GAP testing system that runs on Jenkins. # This requirement will hopefully go soon. -if DigraphsTestInstall() - and DigraphsTestStandard() - and DIGRAPHS_RunTest(DigraphsTestManualExamples) then +if SizeBlist([DigraphsTestInstall(), + DigraphsTestStandard(rec(earlyStop := false)), + DIGRAPHS_RunTest(DigraphsTestManualExamples)]) = 3 then Print("#I No errors detected while testing\n\n"); QUIT_GAP(0); else