From 7f9d098c2ff7e25a55bb3a69bd9d7314af1f9abc Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 23 Aug 2016 11:13:02 -0500 Subject: Add mercurial package, used as test dependency --- share/spack/qa/check_dependencies | 31 ++++++++++++++++++++++++++----- share/spack/qa/run-doc-tests | 1 + share/spack/qa/run-unit-tests | 7 ++++++- 3 files changed, 33 insertions(+), 6 deletions(-) (limited to 'share') diff --git a/share/spack/qa/check_dependencies b/share/spack/qa/check_dependencies index cbcda0ce0f..292eac7dd3 100755 --- a/share/spack/qa/check_dependencies +++ b/share/spack/qa/check_dependencies @@ -13,16 +13,37 @@ for dep in "$@"; do if ! which $dep &> /dev/null; then - # sphinx-build comes from sphinx - package=$(echo $dep | cut -d - -f 1) + # Map binary name to package name + case $dep in + sphinx-apidoc|sphinx-build) + spack_package=py-sphinx + pip_package=sphinx + ;; + coverage) + spack_package=py-coverage + pip_package=coverage + ;; + flake8) + spack_package=py-flake8 + pip_package=flake8 + ;; + hg) + spack_package=py-mercurial + pip_package=mercurial + ;; + *) + spack_package=$dep + pip_package=$dep + ;; + esac cat << EOF -ERROR: $package is required to run this script. +ERROR: $dep is required to run this script. To install with Spack, run: - $ spack install py-$package + $ spack install $spack_package or, to install with pip, run: - $ pip install $package + $ pip install $pip_package Then add the bin directory to your PATH. EOF exit 1 diff --git a/share/spack/qa/run-doc-tests b/share/spack/qa/run-doc-tests index bde30f74cc..9feaa3b3e3 100755 --- a/share/spack/qa/run-doc-tests +++ b/share/spack/qa/run-doc-tests @@ -18,6 +18,7 @@ DOC_DIR="$SPACK_ROOT/lib/spack/docs" # Array of dependencies deps=( + sphinx-apidoc sphinx-build hg ) diff --git a/share/spack/qa/run-unit-tests b/share/spack/qa/run-unit-tests index 9ce3062e58..fe2166d2dc 100755 --- a/share/spack/qa/run-unit-tests +++ b/share/spack/qa/run-unit-tests @@ -20,6 +20,7 @@ SPACK_ROOT="$QA_DIR/../../.." # Array of dependencies deps=( coverage + hg ) # Check for dependencies @@ -28,6 +29,10 @@ deps=( # Add Spack to the PATH. export PATH="$SPACK_ROOT/bin:$PATH" +# Move to root directory of Spack +# Allows script to be run from anywhere +cd "$SPACK_ROOT" + # Array of directories containing core Spack framework core_dirs=( bin @@ -57,4 +62,4 @@ spack config get compilers spack install -v libdwarf # Run unit tests with code coverage -coverage run spack test "$@" +coverage run bin/spack test "$@" -- cgit v1.2.3-60-g2f50