try:
common[k] = (c1[k], c2[k])
except KeyError:
- pass
+ # Transition: we added the module to the names of a bunch of
+ # the logged objects. Assume that c1 might be from an older log
+ # without the modules in the names, and look for an equivalent
+ # in c2.
+ if not '.' in k:
+ s = '.'+k
+ l = len(s)
+ for k2 in c2.keys():
+ if k2[-l:] == s:
+ common[k2] = (c1[k], c2[k2])
+ del c1[k]
+ del c2[k2]
+ break
else:
del c1[k]
del c2[k]
# factory above does). cmd will be passed to
# Environment.subst_list() for substituting environment
# variables.
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Action.CommandAction')
apply(_ActionAction.__init__, (self,)+args, kw)
if SCons.Util.is_List(cmd):
if filter(SCons.Util.is_List, cmd):
class CommandGeneratorAction(ActionBase):
"""Class for command-generator actions."""
def __init__(self, generator, *args, **kw):
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Action.CommandGeneratorAction')
self.generator = generator
self.gen_kw = kw
__metaclass__ = SCons.Memoize.Memoized_Metaclass
def __init__(self, var, *args, **kw):
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Action.LazyAction')
apply(CommandAction.__init__, (self, '$'+var)+args, kw)
self.var = SCons.Util.to_String(var)
self.gen_kw = kw
"""Class for Python function actions."""
def __init__(self, execfunction, *args, **kw):
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Action.FunctionAction')
self.execfunction = execfunction
apply(_ActionAction.__init__, (self,)+args, kw)
self.varlist = kw.get('varlist', [])
class ListAction(ActionBase):
"""Class for lists of other actions."""
def __init__(self, list):
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Action.ListAction')
def list_of_actions(x):
if isinstance(x, ActionBase):
return x
"""
def __init__(self, dict):
UserDict.UserDict.__init__(self, dict)
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Builder.OverrideWarner')
self.already_warned = None
def warn(self):
if self.already_warned:
chdir = _null,
is_explicit = 1,
**overrides):
- if __debug__: logInstanceCreation(self, 'BuilderBase')
+ if __debug__: logInstanceCreation(self, 'Builder.BuilderBase')
self.action = SCons.Action.Action(action)
self.multi = multi
if SCons.Util.is_Dict(prefix):
"""
def __init__(self, builder, env, tlist):
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Builder.ListBuilder')
SCons.Util.Proxy.__init__(self, builder)
self.builder = builder
self.target_scanner = builder.target_scanner
source_scanner = None,
emitter=None,
single_source=0):
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Builder.MultiStepBuilder')
BuilderBase.__init__(self, action, prefix, suffix, src_suffix,
target_factory, source_factory,
target_scanner, source_scanner, emitter,
"""
def __init__(self, builder, cmdgen):
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Builder.CompositeBuilder')
SCons.Util.Proxy.__init__(self, builder)
# cmdgen should always be an instance of DictCmdGenerator.
def __init__(self, **kw):
"""Initialization of an underlying SubstitutionEnvironment class.
"""
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Environment.SubstitutionEnvironment')
self.fs = SCons.Node.FS.default_fs
self.ans = SCons.Node.Alias.default_ans
self.lookup_list = SCons.Node.arg2nodes_lookups
initialize things in a very specific order that doesn't work
with the much simpler base class initialization.
"""
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Environment.Base')
self.fs = SCons.Node.FS.default_fs
self.ans = SCons.Node.Alias.default_ans
self.lookup_list = SCons.Node.arg2nodes_lookups
for key, value in kw.items():
new[key] = SCons.Util.scons_subst_once(value, self, key)
apply(clone.Replace, (), new)
- if __debug__: logInstanceCreation(self, 'EnvironmentCopy')
+ if __debug__: logInstanceCreation(self, 'Environment.EnvironmentCopy')
return clone
def Detect(self, progs):
__metaclass__ = SCons.Memoize.Memoized_Metaclass
def __init__(self, subject, overrides={}):
- if __debug__: logInstanceCreation(self, 'OverrideEnvironment')
+ if __debug__: logInstanceCreation(self, 'Environment.OverrideEnvironment')
self.__dict__['__subject'] = subject
self.__dict__['overrides'] = overrides
def __init__(self, action, env=None, overridelist=[{}],
targets=[], sources=[], builder_kw={}):
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Executor.Executor')
if not action:
raise SCons.Errors.UserError, "Executor must have an action."
self.action = action
disassociate Builders from Nodes entirely, so we're not
going to worry about unit tests for this--at least for now.
"""
+ def __init__(self):
+ if __debug__: logInstanceCreation(self, 'Executor.Null')
def get_build_env(self):
class NullEnvironment:
def get_scanner(self, key):
The path argument must be a valid absolute path.
"""
- if __debug__: logInstanceCreation(self)
+ if __debug__: logInstanceCreation(self, 'Node.FS')
self.Top = None
if path == None:
self.pathTop = os.getcwd()
pass
def __init__(self):
- if __debug__: logInstanceCreation(self, 'Node')
+ if __debug__: logInstanceCreation(self, 'Node.Node')
# Note that we no longer explicitly initialize a self.builder
# attribute to None here. That's because the self.builder
# attribute may be created on-the-fly later by a subclass (the
test.run(arguments = "--debug=count")
stdout = test.stdout()
-test.fail_test(re.search('\d+ +\d+ +\d+ +\d+ BuilderBase', stdout) is None)
-test.fail_test(re.search('\d+ +\d+ +\d+ +\d+ FS', stdout) is None)
-test.fail_test(re.search('\d+ +\d+ +\d+ +\d+ Node', stdout) is None)
-test.fail_test(re.search('\d+ +\d+ +\d+ +\d+ SConsEnvironment', stdout) is None)
+def find_object_count(s, stdout):
+ re_string = '\d+ +\d+ +\d+ +\d+ %s' % re.escape(s)
+ return re.search(re_string, stdout)
+objects = [
+ 'Action.CommandAction',
+ 'Builder.BuilderBase',
+ 'Environment.Base',
+ 'Executor.Executor',
+ 'Node.FS',
+ 'Node.FS.Base',
+ 'Node.Node',
+]
+
+missing = filter(lambda o: find_object_count(o, stdout) is None, objects)
+
+if missing:
+ print "Missing the following object lines:"
+ print "\t", string.join(missing)
+ print "STDOUT =========="
+ print stdout
+ test.fail_test(1)
test.pass_test()