From 7c55c0c00c761144e618868325f081771f6eb74e Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 30 Oct 2024 04:51:06 +0300 Subject: testsuite: added --valgrind option for running SciTECO under Valgrind (memcheck) * Any memory error will let the test case fail with code 66. * You can also call make check TESTSUITEFLAGS="--valgrind" * There is no program test for Valgrind in configure.ac for the time being. `valgrind` must be in $PATH. * All CI testsuite runs under Ubuntu are now with Valgrind. --- tests/atlocal.in | 6 +++++- tests/testsuite.at | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/atlocal.in b/tests/atlocal.in index 4bc0a21..3c533a6 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -6,8 +6,12 @@ host=@host@ # anyway as we don't want to test some preinstalled SciTECO. SCITECO="@abs_top_builddir@/src/sciteco" +if [ $at_arg_valgrind != false ]; then + SCITECO="valgrind --tool=memcheck --error-exitcode=66 $SCITECO" +fi + # For testing command-line editing: -SCITECO_CMDLINE="@abs_top_builddir@/src/sciteco --no-profile --fake-cmdline" +SCITECO_CMDLINE="$SCITECO --no-profile --fake-cmdline" # Make sure that the standard library from the source package # is used. diff --git a/tests/testsuite.at b/tests/testsuite.at index 01ca664..edf2d3f 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -1,6 +1,9 @@ AT_INIT AT_COLOR_TESTS +AT_ARG_OPTION([valgrind], + AS_HELP_STRING([--valgrind], [Run tests under Valgrind (memcheck)])) + # NOTE: There is currently no way to influence the return # code of SciTECO, except to provoke an error. # Since errors cannot be yielded explicitly, we use the -- cgit v1.2.3