summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2017-08-19 14:48:24 -0700
committerGitHub <noreply@github.com>2017-08-19 14:48:24 -0700
commitbb10bc39abd27d9ffee379b02ceff23a020f2391 (patch)
tree661de5365b86cf222f07e4b57bcaabd3509a7a6c
parentbe0e05187044e08ede722ae224ca59895edd0f46 (diff)
downloadspack-bb10bc39abd27d9ffee379b02ceff23a020f2391.tar.gz
spack-bb10bc39abd27d9ffee379b02ceff23a020f2391.tar.bz2
spack-bb10bc39abd27d9ffee379b02ceff23a020f2391.tar.xz
spack-bb10bc39abd27d9ffee379b02ceff23a020f2391.zip
Make test_inspect_path work on Mac OS X without XCode (#5168)
- Mac OS X Sierra has no /usr/include by default - Instead of assuming there's an include directory in /usr, mock up a directory that looks like we expect.
-rw-r--r--lib/spack/spack/test/modules.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py
index bd37196f2a..40841f15a7 100644
--- a/lib/spack/spack/test/modules.py
+++ b/lib/spack/spack/test/modules.py
@@ -27,6 +27,7 @@ import contextlib
from six import StringIO
import pytest
+
import spack.modules
import spack.spec
@@ -105,8 +106,13 @@ def test_update_dictionary_extending_list():
assert target['baz'] == 'foobaz'
-def test_inspect_path():
- env = spack.modules.inspect_path('/usr')
+def test_inspect_path(tmpdir):
+ tmpdir.chdir()
+ tmpdir.mkdir('bin')
+ tmpdir.mkdir('lib')
+ tmpdir.mkdir('include')
+
+ env = spack.modules.inspect_path(str(tmpdir))
names = [item.name for item in env]
assert 'PATH' in names
assert 'LIBRARY_PATH' in names