#!/bin/bash

set -exuo pipefail

# Various commands in various configurations to verify.
bazel run --config=valgrind //base/archive:gzip_bench
bazel test --config=valgrind //base/strings:hex_test
bazel run --config=valgrind //base/strings:hex_test
bazel run --config=valgrind-ros //ros_utilities/roslaunch_helpers:calibration_root
bazel run --config=valgrind-ros //ros_utilities/roslaunch_helpers:test_get_rosparam
bazel test --config=valgrind-ros //ros_utilities/roslaunch_helpers:test_get_rosparam
bazel test //ci/runners:valgrind_test
bazel test //ci/runners:valgrind_ros_test
bazel build //base/strings:hex_test //bin:valgrind
# Ensure that we invoke the right version of valgrind.
PATH="$(pwd)/bazel-bin/bin:/bin:/usr/bin" valgrind "$(pwd)"/bazel-bin/base/strings/hex_test
