diff options
author | Greg Becker <becker33@llnl.gov> | 2019-06-19 03:23:02 +0200 |
---|---|---|
committer | Peter Scheibel <scheibel1@llnl.gov> | 2019-06-18 18:23:02 -0700 |
commit | 9a4917644a7c744c2ad19f94ef3930aceedb179c (patch) | |
tree | 435914c8e7aa8c11e3a186dd790362d45e600155 | |
parent | 1ea3d2911044384149d88b069b88d288598ad972 (diff) | |
download | spack-9a4917644a7c744c2ad19f94ef3930aceedb179c.tar.gz spack-9a4917644a7c744c2ad19f94ef3930aceedb179c.tar.bz2 spack-9a4917644a7c744c2ad19f94ef3930aceedb179c.tar.xz spack-9a4917644a7c744c2ad19f94ef3930aceedb179c.zip |
Remove test dependency on /usr/bin/gcc (#11769)
The regression test for #11678 fails on at least some Mac OS systems
because they have a /usr/bin/gcc that is secretly clang.
This PR replaces the dependency on a system gcc executable with a
test-generated script that generates the expected output for the
compiler logic.
-rw-r--r-- | lib/spack/spack/test/cmd/compiler_command.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/spack/spack/test/cmd/compiler_command.py b/lib/spack/spack/test/cmd/compiler_command.py index 042cb99484..e40e49544d 100644 --- a/lib/spack/spack/test/cmd/compiler_command.py +++ b/lib/spack/spack/test/cmd/compiler_command.py @@ -6,7 +6,6 @@ import pytest import os -import os.path import spack.main @@ -26,8 +25,16 @@ def no_compilers_yaml(mutable_config, monkeypatch): @pytest.mark.regression('11678') -@pytest.mark.requires_executables('/usr/bin/gcc') -def test_compiler_find_without_paths(no_compilers_yaml): +def test_compiler_find_without_paths(no_compilers_yaml, working_env, tmpdir): + with tmpdir.as_cwd(): + with open('gcc', 'w') as f: + f.write("""\ +#!/bin/bash +echo "0.0.0" +""") + os.chmod('gcc', 0o700) + + os.environ['PATH'] = str(tmpdir) output = compiler('find', '--scope=site') assert 'gcc' in output |