#!/bin/sh
# Everything pre-commit is too slow to run: 4.0s for the full test suite on a warm
# tree, against 0.6s for the hook that runs on every commit. The doctests matter
# here because the readme is the crate's front page, so its examples are compiled
# and cannot drift from the API.
#
# Install: git config core.hooksPath .githooks
set -e

echo "pre-push: cargo test"
cargo test --quiet

echo "pre-push: cargo doc"
RUSTDOCFLAGS="-D warnings" cargo doc --quiet --no-deps

echo "pre-push: ok"
