diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml new file mode 100644 index 000000000..10e419995 --- /dev/null +++ b/.github/workflows/valgrind.yml @@ -0,0 +1,59 @@ +name: Valgrind +on: + workflow_dispatch: + release: + types: [created] + push: + branches: + - rc-v* + pull_request: + paths: + - src/*.[hc]pp + +concurrency: + # Group by workflow and ref; the last component ensures that for pull + # requests, we limit to 1 concurrent job, but for the main branch we don't + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || github.run_number }} + # Only cancel intermediate pull request builds + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + test-valgrind: + name: "Ubuntu / GAP stable-4.15 / valgrind" + runs-on: ubuntu-latest + env: + NO_COVERAGE: true + VALGRIND: valgrind --trace-children=yes --leak-check=full --show-leak-kinds=all --error-exitcode=1 + steps: + - uses: actions/checkout@v5 + - name: "Output g++ version . . ." + run: g++ --version + - name: "Install Valgrind . . ." + run: | + sudo apt-get update + sudo apt-get install valgrind + - name: "Install GAP . . ." + uses: gap-actions/setup-gap@v3 + with: + gap-version: stable-4.15 + configflags: --enable-valgrind + - name: "Build additional necessary GAP packages . . ." + run: | + cd ${GAPROOT}/pkg + ../bin/BuildPackages.sh --strict digraphs* io* orb* datastructures* profiling* + - name: "Build Semigroups . . ." + uses: gap-actions/build-pkg@v2 + with: + CONFIGFLAGS: --disable-hpcombi + - name: "Run SemigroupsTestInstall . . ." + uses: gap-actions/run-pkg-tests@v4 + with: + testfile: tst/github_actions/install.g + pre-gap: ${{ env.VALGRIND }} + coverage: false + - name: "Run SemigroupsTestStandard . . ." + uses: gap-actions/run-pkg-tests@v4 + with: + testfile: tst/github_actions/valgrind.g + pre-gap: ${{ env.VALGRIND }} + coverage: false diff --git a/gap/tools/utils.gi b/gap/tools/utils.gi index 283b17a2e..e7dd0d58d 100644 --- a/gap/tools/utils.gi +++ b/gap/tools/utils.gi @@ -197,6 +197,9 @@ SEMIGROUPS.TestDir := function(dir, arg) if "suppressStatusMessage" in RecNames(arg[1]) then opts.suppressStatusMessage := arg[1].suppressStatusMessage; fi; + if "exclude" in RecNames(arg[1]) then + opts.exclude := arg[1].exclude; + fi; elif Length(arg) <> 0 then ErrorNoReturn("there must be no arguments, or the argument ", "must be a record"); diff --git a/gapbind14/src/gapbind14.cpp b/gapbind14/src/gapbind14.cpp index 362777593..54b258388 100644 --- a/gapbind14/src/gapbind14.cpp +++ b/gapbind14/src/gapbind14.cpp @@ -25,10 +25,8 @@ #include "gapbind14/gap_include.hpp" // for Obj etc -#define GVAR_ENTRY(srcfile, name, nparam, params) \ - { \ -#name, nparam, params, (ObjFunc) name, srcfile ":Func" #name \ - } +#define GVAR_ENTRY(srcfile, name, nparam, params) \ + {#name, nparam, params, (ObjFunc) name, srcfile ":Func" #name} namespace gapbind14 { UInt T_GAPBIND14_OBJ = 0; @@ -104,21 +102,21 @@ namespace gapbind14 { void Module::clear() { for (auto &func : _funcs) { - delete func.name; + delete[] func.name; if (func.nargs != 0) { - delete func.args; + delete[] func.args; } - delete func.cookie; + delete[] func.cookie; } _funcs.clear(); for (auto &vec : _mem_funcs) { for (auto &func : vec) { - delete func.name; + delete[] func.name; if (func.nargs != 0) { - delete func.args; + delete[] func.args; } - delete func.cookie; + delete[] func.cookie; } vec.clear(); } diff --git a/src/bipart.cpp b/src/bipart.cpp index 52d4b7d98..2a4ae24f1 100644 --- a/src/bipart.cpp +++ b/src/bipart.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2016 James D. Mitchell +// Copyright (C) 2016-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/bipart.hpp b/src/bipart.hpp index 44a52236a..e5b2b3ef7 100644 --- a/src/bipart.hpp +++ b/src/bipart.hpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2016 James D. Mitchell +// Copyright (C) 2016-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/conglatt.cpp b/src/conglatt.cpp index ef1ada48a..b323b2ec0 100644 --- a/src/conglatt.cpp +++ b/src/conglatt.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2022 James D. Mitchell +// Copyright (C) 2022-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/conglatt.hpp b/src/conglatt.hpp index 4614c27df..852966c87 100644 --- a/src/conglatt.hpp +++ b/src/conglatt.hpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2022 James D. Mitchell +// Copyright (C) 20222-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/froidure-pin-fallback.cpp b/src/froidure-pin-fallback.cpp index a7b5e0f0d..746a25f5e 100644 --- a/src/froidure-pin-fallback.cpp +++ b/src/froidure-pin-fallback.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2016-2022 James D. Mitchell +// Copyright (C) 2016-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/froidure-pin-fallback.hpp b/src/froidure-pin-fallback.hpp index 8981f5f99..35f0b1309 100644 --- a/src/froidure-pin-fallback.hpp +++ b/src/froidure-pin-fallback.hpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2016-2022 James D. Mitchell +// Copyright (C) 2016-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-cong.cpp b/src/init-cong.cpp index 992b2d952..f08c26b6a 100644 --- a/src/init-cong.cpp +++ b/src/init-cong.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021-26 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-cong.hpp b/src/init-cong.hpp index a725b336a..9c35a26fb 100644 --- a/src/init-cong.hpp +++ b/src/init-cong.hpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021-26 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-froidure-pin-base.cpp b/src/init-froidure-pin-base.cpp index 83f9b418f..b5bcd08c7 100644 --- a/src/init-froidure-pin-base.cpp +++ b/src/init-froidure-pin-base.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2022 James D. Mitchell +// Copyright (C) 2022-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-froidure-pin-bipart.cpp b/src/init-froidure-pin-bipart.cpp index 05995012c..4b00aa01c 100644 --- a/src/init-froidure-pin-bipart.cpp +++ b/src/init-froidure-pin-bipart.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-froidure-pin-bmat.cpp b/src/init-froidure-pin-bmat.cpp index f1dc38c13..849f5caf6 100644 --- a/src/init-froidure-pin-bmat.cpp +++ b/src/init-froidure-pin-bmat.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-froidure-pin-matrix.cpp b/src/init-froidure-pin-matrix.cpp index 86f497eb9..7e0c73d39 100644 --- a/src/init-froidure-pin-matrix.cpp +++ b/src/init-froidure-pin-matrix.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-froidure-pin-max-plus-mat.cpp b/src/init-froidure-pin-max-plus-mat.cpp index a877d4421..ee9898c14 100644 --- a/src/init-froidure-pin-max-plus-mat.cpp +++ b/src/init-froidure-pin-max-plus-mat.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-froidure-pin-min-plus-mat.cpp b/src/init-froidure-pin-min-plus-mat.cpp index 9346d367d..54b966487 100644 --- a/src/init-froidure-pin-min-plus-mat.cpp +++ b/src/init-froidure-pin-min-plus-mat.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-froidure-pin-pbr.cpp b/src/init-froidure-pin-pbr.cpp index 9c79e2fc6..b5527a6c2 100644 --- a/src/init-froidure-pin-pbr.cpp +++ b/src/init-froidure-pin-pbr.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-froidure-pin-pperm.cpp b/src/init-froidure-pin-pperm.cpp index 39d2e585a..3eceb9867 100644 --- a/src/init-froidure-pin-pperm.cpp +++ b/src/init-froidure-pin-pperm.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-froidure-pin-transf.cpp b/src/init-froidure-pin-transf.cpp index 933a19a60..c8e1bbed2 100644 --- a/src/init-froidure-pin-transf.cpp +++ b/src/init-froidure-pin-transf.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-froidure-pin.hpp b/src/init-froidure-pin.hpp index 3c7f53781..4c6b1b786 100644 --- a/src/init-froidure-pin.hpp +++ b/src/init-froidure-pin.hpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-to-congruence.cpp b/src/init-to-congruence.cpp index 142e64607..613b0c54d 100644 --- a/src/init-to-congruence.cpp +++ b/src/init-to-congruence.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021-26 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/init-to-froidure-pin.cpp b/src/init-to-froidure-pin.cpp index dd6578ead..a94cfd03e 100644 --- a/src/init-to-froidure-pin.cpp +++ b/src/init-to-froidure-pin.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021-26 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/pkg.hpp b/src/pkg.hpp index ed8d9119a..63e92eae0 100644 --- a/src/pkg.hpp +++ b/src/pkg.hpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2016-2022 James D. Mitchell +// Copyright (C) 2016-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/semigroups-debug.hpp b/src/semigroups-debug.hpp index 9fb89deca..850511763 100644 --- a/src/semigroups-debug.hpp +++ b/src/semigroups-debug.hpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2017 James D. Mitchell +// Copyright (C) 2017-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/to-cpp.hpp b/src/to-cpp.hpp index 58423ac99..6d08f853f 100644 --- a/src/to-cpp.hpp +++ b/src/to-cpp.hpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2020-2022 James D. Mitchell +// Copyright (C) 2020-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/to-gap.cpp b/src/to-gap.cpp index 12698374a..3df37539a 100644 --- a/src/to-gap.cpp +++ b/src/to-gap.cpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2021 James D. Mitchell +// Copyright (C) 2021-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/to-gap.hpp b/src/to-gap.hpp index 3b25ad8a0..55eaff7ef 100644 --- a/src/to-gap.hpp +++ b/src/to-gap.hpp @@ -1,6 +1,6 @@ // // Semigroups package for GAP -// Copyright (C) 2020-2022 James D. Mitchell +// Copyright (C) 2020-2026 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/tst/github_actions/examples.g b/tst/github_actions/examples.g new file mode 100644 index 000000000..7f2d5ba66 --- /dev/null +++ b/tst/github_actions/examples.g @@ -0,0 +1,7 @@ +LoadPackage("semigroups", false);; +if SEMIGROUPS.TestManualExamples() then + QUIT_GAP(0); +else + QUIT_GAP(1); +fi; +FORCE_QUIT_GAP(1); diff --git a/tst/github_actions/extreme.g b/tst/github_actions/extreme.g new file mode 100644 index 000000000..b2ea88290 --- /dev/null +++ b/tst/github_actions/extreme.g @@ -0,0 +1,7 @@ +LoadPackage("semigroups", false);; +if SemigroupsTestExtreme(rec(earlyStop := false)) then + QUIT_GAP(0); +else + QUIT_GAP(1); +fi; +FORCE_QUIT_GAP(1); diff --git a/tst/github_actions/install.g b/tst/github_actions/install.g new file mode 100644 index 000000000..7456be72d --- /dev/null +++ b/tst/github_actions/install.g @@ -0,0 +1,7 @@ +LoadPackage("semigroups", false);; +if SemigroupsTestInstall() then + QUIT_GAP(0); +else + QUIT_GAP(1); +fi; +FORCE_QUIT_GAP(1); diff --git a/tst/github_actions/standard.g b/tst/github_actions/standard.g new file mode 100644 index 000000000..ab13b5d1d --- /dev/null +++ b/tst/github_actions/standard.g @@ -0,0 +1,7 @@ +LoadPackage("semigroups", false);; +if SemigroupsTestStandard(rec(earlyStop := false)) then + QUIT_GAP(0); +else + QUIT_GAP(1); +fi; +FORCE_QUIT_GAP(1); diff --git a/tst/github_actions/valgrind.g b/tst/github_actions/valgrind.g new file mode 100644 index 000000000..5ab3b1686 --- /dev/null +++ b/tst/github_actions/valgrind.g @@ -0,0 +1,8 @@ +LoadPackage("semigroups", false);; +if SemigroupsTestStandard( + rec(earlyStop := false, exclude := ["fp/tietze.tst"])) then + QUIT_GAP(0); +else + QUIT_GAP(1); +fi; +FORCE_QUIT_GAP(1);