valgrind.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. set -e
  3. set -x
  4. srcdir=$PWD/src
  5. objdir=${MOZ_OBJDIR-objdir}
  6. # If the objdir is a relative path, it is relative to the srcdir.
  7. case "$objdir" in
  8. /*)
  9. ;;
  10. *)
  11. objdir="$srcdir/$objdir"
  12. ;;
  13. esac
  14. if [ ! -d $objdir ]; then
  15. mkdir $objdir
  16. fi
  17. cd $objdir
  18. if [ "`uname -m`" = "x86_64" ]; then
  19. _arch=64
  20. else
  21. _arch=32
  22. fi
  23. TOOLTOOL_MANIFEST=browser/config/tooltool-manifests/linux${_arch}/releng.manifest
  24. TOOLTOOL_SERVER=https://api.pub.build.mozilla.org/tooltool/
  25. (cd $srcdir; python /builds/tooltool.py --url $TOOLTOOL_SERVER --overwrite -m $TOOLTOOL_MANIFEST fetch ${TOOLTOOL_CACHE:+ -c ${TOOLTOOL_CACHE}}) || exit 2
  26. # Note: an exit code of 2 turns the job red on TBPL.
  27. MOZCONFIG=$srcdir/browser/config/mozconfigs/linux${_arch}/valgrind make -f $srcdir/client.mk configure || exit 2
  28. make -j4 || exit 2
  29. make package || exit 2
  30. # We need to set MOZBUILD_STATE_PATH so that |mach| skips its first-run
  31. # initialization step and actually runs the |valgrind-test| command.
  32. export MOZBUILD_STATE_PATH=.
  33. # |mach valgrind-test|'s exit code will be 1 (which turns the job orange on
  34. # TBPL) if Valgrind finds errors, and 2 (which turns the job red) if something
  35. # else goes wrong, such as Valgrind crashing.
  36. python2.7 $srcdir/mach valgrind-test
  37. exit $?