Skip to content
Merged
66 changes: 66 additions & 0 deletions .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
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 --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 libsemigroups test . . ."
uses: gap-actions/run-pkg-tests@v4
with:
testfile: tst/github_actions/libsemigroups.g
pre-gap: ${{ env.VALGRIND }}
coverage: false
- name: "Run SemigroupsTestStandard (release candidate only) . . ."
if: ${{ startsWith(github.ref_name, 'rc-v') }}
uses: gap-actions/run-pkg-tests@v4
with:
testfile: tst/github_actions/standard-for-valgrind.g
pre-gap: ${{ env.VALGRIND }}
coverage: false
3 changes: 3 additions & 0 deletions gap/tools/utils.gi
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
18 changes: 8 additions & 10 deletions gapbind14/src/gapbind14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/bipart.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/bipart.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/conglatt.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/conglatt.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/froidure-pin-fallback.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/froidure-pin-fallback.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-cong.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-cong.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-froidure-pin-base.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-froidure-pin-bipart.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-froidure-pin-bmat.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-froidure-pin-matrix.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-froidure-pin-max-plus-mat.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-froidure-pin-min-plus-mat.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-froidure-pin-pbr.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-froidure-pin-pperm.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-froidure-pin-transf.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-froidure-pin.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-to-congruence.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/init-to-froidure-pin.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/pkg.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/semigroups-debug.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/to-cpp.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/to-gap.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/to-gap.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 7 additions & 0 deletions tst/github_actions/examples.g
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
LoadPackage("semigroups", false);;
if SEMIGROUPS.TestManualExamples() then
QUIT_GAP(0);
else
QUIT_GAP(1);
fi;
FORCE_QUIT_GAP(1);
7 changes: 7 additions & 0 deletions tst/github_actions/extreme.g
Original file line number Diff line number Diff line change
@@ -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);
7 changes: 7 additions & 0 deletions tst/github_actions/install.g
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
LoadPackage("semigroups", false);;
if SemigroupsTestInstall() then
QUIT_GAP(0);
else
QUIT_GAP(1);
fi;
FORCE_QUIT_GAP(1);
11 changes: 11 additions & 0 deletions tst/github_actions/libsemigroups.g
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
LoadPackage("semigroups", false);;
if SEMIGROUPS.TestDir(
DirectoriesPackageLibrary(
"semigroups",
"tst/standard/libsemigroups")[1]![1],
[rec(earlyStop := false)]) then
QUIT_GAP(0);
else
QUIT_GAP(1);
fi;
FORCE_QUIT_GAP(1);
8 changes: 8 additions & 0 deletions tst/github_actions/standard-for-valgrind.g
Original file line number Diff line number Diff line change
@@ -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);
7 changes: 7 additions & 0 deletions tst/github_actions/standard.g
Original file line number Diff line number Diff line change
@@ -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);
Loading