summaryrefslogtreecommitdiff
path: root/share/spack/qa/run-unit-tests
diff options
context:
space:
mode:
Diffstat (limited to 'share/spack/qa/run-unit-tests')
-rwxr-xr-xshare/spack/qa/run-unit-tests40
1 files changed, 6 insertions, 34 deletions
diff --git a/share/spack/qa/run-unit-tests b/share/spack/qa/run-unit-tests
index c266665ccb..7e300280ff 100755
--- a/share/spack/qa/run-unit-tests
+++ b/share/spack/qa/run-unit-tests
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/bash -e
#
# Description:
# Runs Spack unit tests.
@@ -10,44 +10,16 @@
# Optionally add one or more unit tests
# to only run these tests.
#
-# Notes:
-# Requires coverage, git, mercurial, and subversion.
-#
-
-QA_DIR="$(dirname "$0")"
-SPACK_ROOT="$QA_DIR/../../.."
-
-# Array of dependencies
-deps=(
- coverage
- git
- hg
- svn
-)
-
-# Check for dependencies
-"$QA_DIR/check_dependencies" "${deps[@]}" || exit 1
-
-# Add Spack to the PATH.
-export PATH="$SPACK_ROOT/bin:$PATH"
+. "$(dirname $0)/setup.sh"
+check_dependencies ${coverage} git hg svn
# Move to root directory of Spack
# Allows script to be run from anywhere
cd "$SPACK_ROOT"
-# Run integration tests
-# TODO: should these be separated into a different test suite?
-source "$SPACK_ROOT/share/spack/setup-env.sh"
-spack compilers
+# Print compiler information
spack config get compilers
# Run unit tests with code coverage
-py_ver=$(python -c 'import platform; print(platform.python_version())')
-if [[ "$py_ver" == 2.7* || "$py_ver" == 3.6* ]];
-then
- coverage run bin/spack install -v libdwarf
- coverage run bin/spack test "$@" && coverage combine
-else
- spack install -v libdwarf
- spack test "$@"
-fi
+${coverage_run} bin/spack test "$@"
+${coverage_combine}