From 9a4917644a7c744c2ad19f94ef3930aceedb179c Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Wed, 19 Jun 2019 03:23:02 +0200 Subject: 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. --- lib/spack/spack/test/cmd/compiler_command.py | 13 ++++++++++--- 1 file 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 -- cgit v1.2.3-60-g2f50