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:
parent
1ea3d29110
commit
9a4917644a
@ -6,7 +6,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import os.path
|
|
||||||
|
|
||||||
import spack.main
|
import spack.main
|
||||||
|
|
||||||
@ -26,8 +25,16 @@ def no_compilers_yaml(mutable_config, monkeypatch):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.regression('11678')
|
@pytest.mark.regression('11678')
|
||||||
@pytest.mark.requires_executables('/usr/bin/gcc')
|
def test_compiler_find_without_paths(no_compilers_yaml, working_env, tmpdir):
|
||||||
def test_compiler_find_without_paths(no_compilers_yaml):
|
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')
|
output = compiler('find', '--scope=site')
|
||||||
|
|
||||||
assert 'gcc' in output
|
assert 'gcc' in output
|
||||||
|
Loading…
Reference in New Issue
Block a user