summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2017-07-22 21:27:54 -0700
committerGitHub <noreply@github.com>2017-07-22 21:27:54 -0700
commitf159246d1d073ae7230b5412a4a2a20eac7f49c2 (patch)
tree22bc9233b630669ae351f5480a2d8dd866e3ba9c /var
parentc07d93a3e5101d72939ab0feb841a98b4bc36cb8 (diff)
downloadspack-f159246d1d073ae7230b5412a4a2a20eac7f49c2.tar.gz
spack-f159246d1d073ae7230b5412a4a2a20eac7f49c2.tar.bz2
spack-f159246d1d073ae7230b5412a4a2a20eac7f49c2.tar.xz
spack-f159246d1d073ae7230b5412a4a2a20eac7f49c2.zip
Make testing spack commands simpler (#4868)
Adds SpackCommand class allowing Spack commands to be easily in Python Example usage: from spack.main import SpackCommand info = SpackCommand('info') out, err = info('mpich') print(info.returncode) This allows easier testing of Spack commands. Also: * Simplify command tests * Simplify mocking in command tests. * Simplify module command test * Simplify python command test * Simplify uninstall command test * Simplify url command test * SpackCommand uses more compatible output redirection
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/a/package.py2
-rw-r--r--var/spack/repos/builtin.mock/packages/libdwarf/package.py2
-rw-r--r--var/spack/repos/builtin.mock/packages/libelf/package.py9
3 files changed, 3 insertions, 10 deletions
diff --git a/var/spack/repos/builtin.mock/packages/a/package.py b/var/spack/repos/builtin.mock/packages/a/package.py
index 59d8b9e330..e2fa6c35b0 100644
--- a/var/spack/repos/builtin.mock/packages/a/package.py
+++ b/var/spack/repos/builtin.mock/packages/a/package.py
@@ -26,7 +26,7 @@ from spack import *
class A(AutotoolsPackage):
- """Simple package with no dependencies"""
+ """Simple package with one optional dependency"""
homepage = "http://www.example.com"
url = "http://www.example.com/a-1.0.tar.gz"
diff --git a/var/spack/repos/builtin.mock/packages/libdwarf/package.py b/var/spack/repos/builtin.mock/packages/libdwarf/package.py
index 10d6fa8e88..0cdbaf2a33 100644
--- a/var/spack/repos/builtin.mock/packages/libdwarf/package.py
+++ b/var/spack/repos/builtin.mock/packages/libdwarf/package.py
@@ -41,4 +41,4 @@ class Libdwarf(Package):
depends_on("libelf")
def install(self, spec, prefix):
- pass
+ touch(prefix.libdwarf)
diff --git a/var/spack/repos/builtin.mock/packages/libelf/package.py b/var/spack/repos/builtin.mock/packages/libelf/package.py
index 3a2fe603ef..0390963081 100644
--- a/var/spack/repos/builtin.mock/packages/libelf/package.py
+++ b/var/spack/repos/builtin.mock/packages/libelf/package.py
@@ -34,11 +34,4 @@ class Libelf(Package):
version('0.8.10', '9db4d36c283d9790d8fa7df1f4d7b4d9')
def install(self, spec, prefix):
- configure("--prefix=%s" % prefix,
- "--enable-shared",
- "--disable-dependency-tracking",
- "--disable-debug")
- make()
-
- # The mkdir commands in libelf's intsall can fail in parallel
- make("install", parallel=False)
+ touch(prefix.libelf)