Commit c8f4d9e2 authored by André Anjos's avatar André Anjos 💬
Browse files

Merge branch 'simpleenv' into 'master'

Simpleenv

See merge request !22
parents 6dc6b634 fa74adfc
Pipeline #6883 passed with stages
in 9 minutes and 12 seconds
......@@ -23,10 +23,8 @@ class EnvironmentWrapper(object):
settings from initialization.
"""
# Note: CLang does not work well with BZ_DEBUG
# 24.01.2017: we only support gcc on both Linux and MacOSX
# 30.01.2017: we only set debug flags, release flags are set by toolchain
DEBUG_CFLAGS = '-O0 -g -DBOB_DEBUG -DBZ_DEBUG'
RELEASE_CFLAGS = '-O3 -g0 -DNDEBUG -mtune=generic'
def __init__(self, logger, debug=None, prefixes=None, environ=None):
......@@ -85,7 +83,6 @@ class EnvironmentWrapper(object):
# reset the CFLAGS and CXXFLAGS depending on the user input
cflags = None
if self.debug is True: cflags = str(EnvironmentWrapper.DEBUG_CFLAGS)
elif self.debug is False: cflags = str(EnvironmentWrapper.RELEASE_CFLAGS)
# else: pass
def _order_flags(key, internal=None):
......
......@@ -58,10 +58,8 @@ def test_set_debug_true():
assert 'CFLAGS' in os.environ
assert os.environ['CFLAGS'].find(EnvironmentWrapper.DEBUG_CFLAGS) >= 0
assert os.environ['CFLAGS'].find(EnvironmentWrapper.RELEASE_CFLAGS) < 0
assert 'CXXFLAGS' in os.environ
assert os.environ['CXXFLAGS'].find(EnvironmentWrapper.DEBUG_CFLAGS) >= 0
assert os.environ['CXXFLAGS'].find(EnvironmentWrapper.RELEASE_CFLAGS) < 0
e.unset()
for key in before:
......@@ -83,16 +81,10 @@ def test_set_debug_false():
e.set()
nose.tools.eq_(len(os.environ) - len(before), 2)
nose.tools.eq_(len(os.environ) - len(before), 0)
assert 'CFLAGS' in os.environ
assert 'CXXFLAGS' in os.environ
nose.tools.eq_(os.environ['CFLAGS'], e.environ['CFLAGS'])
assert os.environ['CFLAGS'].find(EnvironmentWrapper.DEBUG_CFLAGS) < 0
assert os.environ['CFLAGS'].find(EnvironmentWrapper.RELEASE_CFLAGS) >= 0
nose.tools.eq_(os.environ['CXXFLAGS'], e.environ['CXXFLAGS'])
assert os.environ['CXXFLAGS'].find(EnvironmentWrapper.DEBUG_CFLAGS) < 0
assert os.environ['CXXFLAGS'].find(EnvironmentWrapper.RELEASE_CFLAGS) >= 0
assert 'CFLAGS' not in os.environ
assert 'CXXFLAGS' not in os.environ
e.unset()
for key in before:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment