From 386d2c388470d0d5708306da4c16d878ddf56af8 Mon Sep 17 00:00:00 2001 From: Jose Benito Gonzalez Lopez Date: Tue, 22 Sep 2015 16:38:06 +0200 Subject: [PATCH] tests: check sphinx-apidoc output * Checks that `spinhx-apidoc` has been run and the output matches what is in `docs/api/*`. (closes #72) Signed-off-by: Jose Benito Gonzalez Lopez --- .travis.yml | 6 ++++++ docs/api/claimstore.app.rst | 2 +- run-tests.sh | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fbae3a7..7fc2439 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,6 +49,12 @@ before_install: TRAVIS_COMMIT_RANGE=$PR_FIRST^..$TRAVIS_COMMIT fi - echo ${TRAVIS_COMMIT_RANGE} + - | + sphinx-apidoc -f -e -o docs/api/ claimstore + if [ -n "$(git status -s)" ]; then + echo "sphinx-apidoc and docs/api/* mismatch" + exit 1 + fi install: - travis_retry pip install --upgrade pip diff --git a/docs/api/claimstore.app.rst b/docs/api/claimstore.app.rst index 8fa06a9..1f37a4d 100644 --- a/docs/api/claimstore.app.rst +++ b/docs/api/claimstore.app.rst @@ -1,4 +1,4 @@ -claimstore.app module +xlaimstore.app module ===================== .. automodule:: claimstore.app diff --git a/run-tests.sh b/run-tests.sh index a8d9639..870162f 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -18,6 +18,12 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, # USA. +sphinx-apidoc -f -e -o docs/api/ claimstore +if [ -n "$(git status -s)" ]; then + echo + echo "ERROR: there is a mismatch between sphinx-apidoc and docs/api. Check 'git status'." + exit 1 +fi sphinx-build -qnNW docs docs/_build/html python setup.py test sphinx-build -qnNW -b doctest docs docs/_build/doctest