2017-04-27 11:47:56 -07:00
|
|
|
#!/bin/bash -e
|
2018-10-07 13:52:23 -07:00
|
|
|
#
|
2019-12-30 22:36:56 -08:00
|
|
|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
2018-10-07 13:52:23 -07:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2016-07-30 18:10:33 +02:00
|
|
|
#
|
2016-08-22 18:40:53 -05:00
|
|
|
# Description:
|
|
|
|
# Runs Spack unit tests.
|
2016-07-30 18:10:33 +02:00
|
|
|
#
|
2016-08-22 18:40:53 -05:00
|
|
|
# Usage:
|
|
|
|
# run-unit-tests [test ...]
|
2016-07-30 18:10:33 +02:00
|
|
|
#
|
2016-08-22 18:40:53 -05:00
|
|
|
# Options:
|
|
|
|
# Optionally add one or more unit tests
|
|
|
|
# to only run these tests.
|
2016-07-30 18:10:33 +02:00
|
|
|
#
|
2019-07-03 01:56:13 -07:00
|
|
|
|
|
|
|
#-----------------------------------------------------------
|
|
|
|
# Run a few initial commands and set up test environment
|
|
|
|
#-----------------------------------------------------------
|
|
|
|
ORIGINAL_PATH="$PATH"
|
|
|
|
|
2017-04-27 11:47:56 -07:00
|
|
|
. "$(dirname $0)/setup.sh"
|
2020-01-05 23:35:23 -08:00
|
|
|
check_dependencies $coverage git hg svn
|
2016-08-22 18:40:53 -05:00
|
|
|
|
2016-08-23 11:13:02 -05:00
|
|
|
# Move to root directory of Spack
|
|
|
|
# Allows script to be run from anywhere
|
|
|
|
cd "$SPACK_ROOT"
|
|
|
|
|
2017-04-27 11:47:56 -07:00
|
|
|
# Print compiler information
|
2016-07-30 18:10:33 +02:00
|
|
|
spack config get compilers
|
|
|
|
|
2017-05-08 13:18:29 -07:00
|
|
|
# Run spack help to cover command import
|
2019-06-08 13:04:44 -07:00
|
|
|
bin/spack -h
|
|
|
|
bin/spack help -a
|
2017-05-08 13:18:29 -07:00
|
|
|
|
2017-05-01 14:32:33 -07:00
|
|
|
# Profile and print top 20 lines for a simple call to spack spec
|
2020-04-23 11:40:23 +02:00
|
|
|
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
|
|
|
spack -p --lines 20 spec openmpi
|
|
|
|
else
|
|
|
|
spack -p --lines 20 spec mpileaks%gcc ^elfutils@0.170
|
|
|
|
fi
|
2017-05-01 14:32:33 -07:00
|
|
|
|
2019-07-03 01:56:13 -07:00
|
|
|
#-----------------------------------------------------------
|
2016-07-30 18:10:33 +02:00
|
|
|
# Run unit tests with code coverage
|
2019-07-03 01:56:13 -07:00
|
|
|
#-----------------------------------------------------------
|
2020-03-05 16:54:29 -08:00
|
|
|
$coverage_run $(which spack) test -x --verbose
|