Commit 1c96d267 authored by Dominik Charousset's avatar Dominik Charousset

Enable LeakSan on fedora-32 and verify checking

parent f84a26cf
......@@ -5,6 +5,7 @@ set -e
# This script expects the CAF source tree under 'sources', builds in 'build' and
# installs to 'bundle'. Additionally, the script expects the CMake pre-load
# script 'cmake-init.txt' in the current working directorys.
BaseDir="$PWD"
InitFile="$PWD/cmake-init.txt"
SourceDir="$PWD/sources"
BuildDir="$PWD/build"
......@@ -23,6 +24,28 @@ else
exit 1
fi
LeakSanCheck="
#include <cstdlib>
int main() {
int* ptr = new int(EXIT_SUCCESS);
return *ptr;
}
"
# Check that LeakSanitizer works if configured for this build.
if [ "${CAF_CHECK_LEAKS}" == "ON" ]; then
mkdir -p "$BaseDir/LeakCheck"
cd "$BaseDir/LeakCheck"
echo "${LeakSanCheck}" > check.cpp
c++ check.cpp -o check -fsanitize=address -fno-omit-frame-pointer
out=`./check 2>&1 | grep -o LeakSanitizer`
if [ "$out" != "LeakSanitizer" ]; then
echo "unable to detected memory leaks on this platform!"
return 1
fi
cd "$BaseDir"
fi
# Make sure all directories exist, then enter build directory.
mkdir -p "$BuildDir"
cd "$BuildDir"
......@@ -34,4 +57,4 @@ if [ -z "$CAF_NUM_CORES" ]; then
else
$CMakeCommand --build . --target install -- -j $CAF_NUM_CORES
fi
$CTestCommand
$CTestCommand --output-on-failure
......@@ -31,13 +31,11 @@ config = [
numCores: 4,
tags: ['docker'],
builds: ['debug', 'release'],
extraDebugFlags: ['CAF_SANITIZERS:STRING=address,undefined'],
]],
['centos-8', [
numCores: 4,
tags: ['docker'],
builds: ['debug', 'release'],
extraDebugFlags: ['CAF_SANITIZERS:STRING=address,undefined'],
]],
['debian-9', [
numCores: 4,
......@@ -73,6 +71,7 @@ config = [
numCores: 4,
tags: ['docker'],
builds: ['debug', 'release'],
extraDebugFlags: ['CAF_SANITIZERS:STRING=address'],
]],
// One extra debug build with exceptions disabled.
['centos-7', [
......@@ -119,6 +118,10 @@ config = [
],
// Platform-specific environment settings.
buildEnvironments: [
'fedora-32 && debug': [
'CAF_CHECK_LEAKS=ON',
'ASAN_OPTIONS=detect_leaks=1',
],
nop: [], // Dummy value for getting the proper types.
],
// Default CMake flags by build type.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment