Skip to content

Instantly share code, notes, and snippets.

@sfiera
Created July 8, 2010 18:09
Show Gist options
  • Save sfiera/468371 to your computer and use it in GitHub Desktop.
Save sfiera/468371 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -o errexit
PERFTOOLS=google-perftools-1.5
if (($# == 1)); then
VERSION=$1
CONFIGFLAGS=
export CC=gcc-$VERSION
export CXX=g++-$VERSION
elif (($# == 2)); then
VERSION=$1
BUILD=$2
CONFIGFLAGS="$CONFIGFLAGS --build=$BUILD"
export CC=$BUILD-gcc-$VERSION
export CXX=$BUILD-g++-$VERSION
else
echo 1>&2 "usage: $0 VERSION [BUILD]"
exit 1
fi
echo "Testing $CXX..."
(
exec > build-$CXX.log 2>&1
rm -Rf $PERFTOOLS
unzip $PERFTOOLS.zip
cd $PERFTOOLS
./configure $CONFIGFLAGS
make
)
if DYLD_LIBRARY_PATH=$PERFTOOLS/.libs $PERFTOOLS/.libs/heap-profiler_unittest; then
echo "...SUCCESS"
else
echo "...FAILURE"
fi
#!/bin/bash
set -o errexit
./test.sh 4.0
./test.sh 4.2
./test.sh 4.0.1 i686-apple-darwin10
./test.sh 4.2.1 i686-apple-darwin10
./test.sh 4.0.1 powerpc-apple-darwin10
./test.sh 4.2.1 powerpc-apple-darwin10
% ./testall-10.6.sh
Testing g++-4.0...
Starting tracking the heap
Starting tracking the heap
DONE.
...SUCCESS
Testing g++-4.2...
Starting tracking the heap
Had other new/delete MallocHook-s set. Are you using the heap leak checker? Use --heap_check="" to avoid this conflict.
./test.sh: line 36: 28555 Abort trap DYLD_LIBRARY_PATH=$PERFTOOLS/.libs $PERFTOOLS/.libs/heap-profiler_unittest
...FAILURE
Testing i686-apple-darwin10-g++-4.0.1...
Starting tracking the heap
Starting tracking the heap
DONE.
...SUCCESS
Testing i686-apple-darwin10-g++-4.2.1...
Starting tracking the heap
Starting tracking the heap
DONE.
...SUCCESS
Testing powerpc-apple-darwin10-g++-4.0.1...
Starting tracking the heap
Starting tracking the heap
DONE.
...SUCCESS
Testing powerpc-apple-darwin10-g++-4.2.1...
Starting tracking the heap
Starting tracking the heap
DONE.
...SUCCESS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment