Skip to content

Commit

Permalink
Adjust tests further to accommodate C++ support.
Browse files Browse the repository at this point in the history
  • Loading branch information
sciyoshi authored and jaraco committed Feb 14, 2024
1 parent f65c932 commit ae3afa4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion distutils/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def customize_compiler(compiler): # noqa: C901
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
if 'CFLAGS' in os.environ:
cflags = os.environ['CFLAGS']
cflags = cflags + ' ' + os.environ['CFLAGS']
ldshared = ldshared + ' ' + os.environ['CFLAGS']
if 'CXXFLAGS' in os.environ:
cxxflags = os.environ['CXXFLAGS']
Expand Down
4 changes: 2 additions & 2 deletions distutils/tests/test_sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_customize_compiler(self):
assert comp.exes['compiler_so'] == (
'env_cc --sc-cflags ' '--env-cflags ' '--env-cppflags --sc-ccshared'
)
assert comp.exes['compiler_cxx'] == 'env_cxx --env-cxx-flags'
assert comp.exes['compiler_cxx'] == 'env_cxx --env-cxx-flags --sc-cflags --env-cppflags'
assert comp.exes['linker_exe'] == 'env_cc'
assert comp.exes['linker_so'] == (
'env_ldshared --env-ldflags --env-cflags' ' --env-cppflags'
Expand Down Expand Up @@ -161,7 +161,7 @@ def test_customize_compiler(self):
assert comp.exes['preprocessor'] == 'sc_cc -E'
assert comp.exes['compiler'] == 'sc_cc --sc-cflags'
assert comp.exes['compiler_so'] == 'sc_cc --sc-cflags --sc-ccshared'
assert comp.exes['compiler_cxx'] == 'sc_cxx'
assert comp.exes['compiler_cxx'] == 'sc_cxx --sc-cflags'
assert comp.exes['linker_exe'] == 'sc_cc'
assert comp.exes['linker_so'] == 'sc_ldshared'
assert comp.shared_lib_extension == 'sc_shutil_suffix'
Expand Down
6 changes: 5 additions & 1 deletion distutils/tests/test_unixccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,13 @@ def test_cc_overrides_ldshared_for_cxx_correctly(self):
def gcv(v):
if v == 'LDSHARED':
return 'gcc-4.2 -bundle -undefined dynamic_lookup '
elif v == 'LDCXXSHARED':
return 'g++-4.2 -bundle -undefined dynamic_lookup '
elif v == 'CXX':
return 'g++-4.2'
return 'gcc-4.2'
elif v == 'CC':
return 'gcc-4.2'
return ''

def gcvs(*args, _orig=sysconfig.get_config_vars):
if args:
Expand Down

0 comments on commit ae3afa4

Please sign in to comment.