summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authortimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-20 19:41:15 +0000
committertimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-20 19:41:15 +0000
commitb9056e9d42dafd1ccaf6e4840bd12e18a0646847 (patch)
tree190cb5ef51ecdbf4ec8cd70c9846b9a2661ce179 /tools
parentda4c190047d7d361f91403272097e03bf122da12 (diff)
downloadchromium_src-b9056e9d42dafd1ccaf6e4840bd12e18a0646847.zip
chromium_src-b9056e9d42dafd1ccaf6e4840bd12e18a0646847.tar.gz
chromium_src-b9056e9d42dafd1ccaf6e4840bd12e18a0646847.tar.bz2
Run Valgrind binaries from SVN (if present).
If the binaries are not present in third_party/valgrind, use the same binaries we used earlier (/usr/local/valgrind-...) Review URL: http://codereview.chromium.org/552034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36656 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/valgrind/chrome_tests.sh81
1 files changed, 67 insertions, 14 deletions
diff --git a/tools/valgrind/chrome_tests.sh b/tools/valgrind/chrome_tests.sh
index 1d75e7f..5630fa0 100755
--- a/tools/valgrind/chrome_tests.sh
+++ b/tools/valgrind/chrome_tests.sh
@@ -8,25 +8,78 @@
# but allow users to override this default without editing scripts and
# without specifying a commandline option
-if test x"$CHROME_VALGRIND_BIN" = x
+export THISDIR=`dirname $0`
+
+# User may use his own valgrind by giving its path with CHROME_VALGRIND env.
+if [ "$CHROME_VALGRIND" = "" ]
then
- # Figure out which valgrind is installed. Use most recent one.
- # See build-valgrind-for-chromium.sh and its history for these constants.
- for SVNREV in '10880-redzone' '10880' '10771' '20090715'
- do
- CHROME_VALGRIND_BIN=/usr/local/valgrind-$SVNREV/bin
- test -x $CHROME_VALGRIND_BIN/valgrind && break
- done
+ # Guess which binaries we should use by uname
+ case "$(uname -a)" in
+ *Linux*x86_64*)
+ PLATFORM="linux_x64"
+ ;;
+ *Linux*86*)
+ PLATFORM="linux_x86"
+ ;;
+ *Darwin*9.[678].[01]*i386*)
+ # Didn't test other kernels.
+ PLATFORM="mac"
+ ;;
+ *)
+ echo "Unknown platform:"
+ uname -a
+ echo "We'll try to search for valgrind binaries installed in /usr/local"
+ PLATFORM=
+ esac
+
+ if [ "$PLATFORM" != "" ]
+ then
+ # The binaries should be in third_party/valgrind
+ # (checked out from deps/third_party/valgrind/binaries).
+ CHROME_VALGRIND="$THISDIR/../../third_party/valgrind/$PLATFORM"
+
+ # TODO(timurrrr): readlink -f is not present on Mac...
+ if [ "$PLATFORM" != "mac" ]
+ then
+ # Get rid of all "../" dirs
+ CHROME_VALGRIND=`readlink -f $CHROME_VALGRIND`
+ fi
+
+ if ! test -x $CHROME_VALGRIND/bin/valgrind
+ then
+ # We couldn't find the binaries in third_party/valgrind
+ CHROME_VALGRIND=""
+ fi
+ fi
+
+ if [ "$CHROME_VALGRIND" = "" ]
+ then
+ # Couldn't find the binaries checked out from SVN.
+ # Let's try to find out valgrind in /usr/local. Use the most recent one.
+ # See build-valgrind-for-chromium.sh and its history for these constants.
+ for SVNREV in '10880-redzone' '10880'
+ do
+ CHROME_VALGRIND=/usr/local/valgrind-$SVNREV
+ test -x $CHROME_VALGRIND/bin/valgrind && break
+ done
+ fi
fi
-if ! test -x $CHROME_VALGRIND_BIN/valgrind
+if ! test -x $CHROME_VALGRIND/bin/valgrind
then
- echo "Could not find chromium's version of valgrind."
- echo "Please run build-valgrind-for-chromium.sh or set CHROME_VALGRIND_BIN."
+ # TODO(timurrrr): give a link to instructions on what to do in this case
+ # once the SVN-binaries Valgrind deployment method is out of experimental.
+ echo "Could not find valgrind binaries in ${CHROME_VALGRIND}."
+ echo "Please run build-valgrind-for-chromium.sh or set CHROME_VALGRIND."
exit 1
fi
-echo "Using ${CHROME_VALGRIND_BIN}/valgrind"
-PATH="${CHROME_VALGRIND_BIN}:$PATH"
-export THISDIR=`dirname $0`
+# We need to set these variables to override default lib paths hard-coded into
+# Valgrind binary.
+export VALGRIND_LIB="$CHROME_VALGRIND/lib/valgrind"
+export VALGRIND_LIB_INNER="$CHROME_VALGRIND/lib/valgrind"
+
+echo "Using valgrind binaries from ${CHROME_VALGRIND}"
+PATH="${CHROME_VALGRIND}/bin:$PATH"
+
PYTHONPATH=$THISDIR/../../webkit/tools/layout_tests/:$THISDIR/../python "$THISDIR/chrome_tests.py" "$@"