from CustomTests import ConfTest
MY_TESTS = {}
-
+
@ConfTest(MY_TESTS)
def CheckMyFoo(context):
pass
env = Environment()
env.Tool('CustomTests')
-
+
@env.ConfTest()
def CheckMyFoo(context):
pass
env['CUSTOM_TESTS'] and is thus automatically available to all
configuration contexts created from the environment.
"""
-
+
def __init__(self, registry=None):
if registry is None:
self.tests = {}
self.tests[func.__name__] = func
return func
-DefaultTest = ConfTest()
-
def Configure(self, *args, **kw):
try: kw['custom_tests'].update(self['CUSTOM_TESTS'])
except KeyError: kw['custom_tests'] = dict(self['CUSTOM_TESTS'])
return self._CustomTests_orig_Configure(*args, **kw)
-@DefaultTest
-def Fail(context, msg):
- SCons.Util.display("scons: *** %s" % msg)
- SCons.Script.Exit(1)
+def Fail(context, message, condition=True):
+ if condition:
+ SCons.Util.display("scons: *** %s" % message)
+ SCons.Script.Exit(1)
+
+DefaultTest = ConfTest()
+
+# Hmm .. no default tests for now ...
def generate(env):
env.Append( CUSTOM_TESTS = DefaultTest.tests )