diff --git a/gap/utils.gi b/gap/utils.gi index f8c3decf7..fe82ea156 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/"); 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