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.
This commit is contained in:
Greg Becker 2019-06-19 03:23:02 +02:00 committed by Peter Scheibel
parent 1ea3d29110
commit 9a4917644a

View File

@ -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