#!/usr/bin/env bash

################################################################################
# Runs python doctest on all python source files in the cirq directory.
#
# See also:
#     https://docs.python.org/3/library/doctest.html
#
# Usage:
#     check/doctest [-q]
#
# The -q argument suppresses all output except the final result line and any
# error messages.
################################################################################

# Get the working directory to the repo root.
thisdir="$(dirname "${BASH_SOURCE[0]}")" || exit $?
topdir="$(git -C "${thisdir}" rev-parse --show-toplevel)" || exit $?
cd "${topdir}" || exit $?

source dev_tools/pypath

python dev_tools/docs/run_doctest.py "$@"
