summaryrefslogblamecommitdiff
path: root/share/spack/qa/run-doc-tests
blob: 0b23bd9d3d82306a8394a20fb1bdaa42e4ca7596 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                   









                                                
                                                      





                                    

                       
                 
                
       
      
       



                                                   
 



                                       
                                                            
                                              
 

                                
 
#!/usr/bin/env bash
#
# Description:
#     Builds Spack documentation and checks for
#     possible syntax errors. Treats warnings as
#     fatal errors.
#
# Usage:
#     run-doc-tests
#
# Notes:
#     Requires sphinx, git, mercurial, and subversion.
#

QA_DIR="$(dirname "$0")"
SPACK_ROOT="$QA_DIR/../../.."
DOC_DIR="$SPACK_ROOT/lib/spack/docs"

# Array of dependencies
deps=(
    sphinx-apidoc
    sphinx-build
    git
    hg
    svn
)

# Check for dependencies
"$QA_DIR/check_dependencies" "${deps[@]}" || exit 1

# Move to documentation directory
# Allows script to be run from anywhere
cd "$DOC_DIR"

# Cleanup temporary files upon exit or when script is killed
trap 'make clean --silent' EXIT SIGINT SIGTERM

# Treat warnings as fatal errors
make SPHINXOPTS=-W