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 ...@@ -5,6 +5,7 @@ set -e
# This script expects the CAF source tree under 'sources', builds in 'build' and # This script expects the CAF source tree under 'sources', builds in 'build' and
# installs to 'bundle'. Additionally, the script expects the CMake pre-load # installs to 'bundle'. Additionally, the script expects the CMake pre-load
# script 'cmake-init.txt' in the current working directorys. # script 'cmake-init.txt' in the current working directorys.
BaseDir="$PWD"
InitFile="$PWD/cmake-init.txt" InitFile="$PWD/cmake-init.txt"
SourceDir="$PWD/sources" SourceDir="$PWD/sources"
BuildDir="$PWD/build" BuildDir="$PWD/build"
...@@ -23,6 +24,28 @@ else ...@@ -23,6 +24,28 @@ else
exit 1 exit 1
fi 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. # Make sure all directories exist, then enter build directory.
mkdir -p "$BuildDir" mkdir -p "$BuildDir"
cd "$BuildDir" cd "$BuildDir"
...@@ -34,4 +57,4 @@ if [ -z "$CAF_NUM_CORES" ]; then ...@@ -34,4 +57,4 @@ if [ -z "$CAF_NUM_CORES" ]; then
else else
$CMakeCommand --build . --target install -- -j $CAF_NUM_CORES $CMakeCommand --build . --target install -- -j $CAF_NUM_CORES
fi fi
$CTestCommand $CTestCommand --output-on-failure
...@@ -31,13 +31,11 @@ config = [ ...@@ -31,13 +31,11 @@ config = [
numCores: 4, numCores: 4,
tags: ['docker'], tags: ['docker'],
builds: ['debug', 'release'], builds: ['debug', 'release'],
extraDebugFlags: ['CAF_SANITIZERS:STRING=address,undefined'],
]], ]],
['centos-8', [ ['centos-8', [
numCores: 4, numCores: 4,
tags: ['docker'], tags: ['docker'],
builds: ['debug', 'release'], builds: ['debug', 'release'],
extraDebugFlags: ['CAF_SANITIZERS:STRING=address,undefined'],
]], ]],
['debian-9', [ ['debian-9', [
numCores: 4, numCores: 4,
...@@ -73,6 +71,7 @@ config = [ ...@@ -73,6 +71,7 @@ config = [
numCores: 4, numCores: 4,
tags: ['docker'], tags: ['docker'],
builds: ['debug', 'release'], builds: ['debug', 'release'],
extraDebugFlags: ['CAF_SANITIZERS:STRING=address'],
]], ]],
// One extra debug build with exceptions disabled. // One extra debug build with exceptions disabled.
['centos-7', [ ['centos-7', [
...@@ -119,6 +118,10 @@ config = [ ...@@ -119,6 +118,10 @@ config = [
], ],
// Platform-specific environment settings. // Platform-specific environment settings.
buildEnvironments: [ buildEnvironments: [
'fedora-32 && debug': [
'CAF_CHECK_LEAKS=ON',
'ASAN_OPTIONS=detect_leaks=1',
],
nop: [], // Dummy value for getting the proper types. nop: [], // Dummy value for getting the proper types.
], ],
// Default CMake flags by build type. // 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