c_tests¶
Various configuration tests.
- waflib.Tools.c_tests.conf(f)¶
Decorator: attach new configuration functions to
waflib.Build.BuildContext
andwaflib.Configure.ConfigurationContext
. The methods bound will accept a parameter named ‘mandatory’ to disable the configuration errors:def configure(conf): conf.find_program('abc', mandatory=False)
- Parameters
f (function) – method to bind
- waflib.Tools.c_tests.feature(*k)¶
Decorator that registers a task generator method that will be executed when the object attribute
feature
contains the corresponding key(s):from waflib.TaskGen import feature @feature('myfeature') def myfunction(self): print('that is my feature!') def build(bld): bld(features='myfeature')
- Parameters
k (list of string) – feature names
- waflib.Tools.c_tests.before_method(*k)[source]¶
Decorator that registera task generator method which will be executed before the functions of given name(s):
from waflib.TaskGen import feature, before @feature('myfeature') @before_method('fun2') def fun1(self): print('feature 1!') @feature('myfeature') def fun2(self): print('feature 2!') def build(bld): bld(features='myfeature')
- Parameters
k (list of string) – method names
- waflib.Tools.c_tests.after_method(*k)[source]¶
Decorator that registers a task generator method which will be executed after the functions of given name(s):
from waflib.TaskGen import feature, after @feature('myfeature') @after_method('fun2') def fun1(self): print('feature 1!') @feature('myfeature') def fun2(self): print('feature 2!') def build(bld): bld(features='myfeature')
- Parameters
k (list of string) – method names
- waflib.Tools.c_tests.link_lib_test_fun(self)[source]¶
Task generator method
The configuration test
waflib.Configure.run_build()
declares a unique task generator, so we need to create other task generators from here to check if the linker is able to link libraries.- Feature
- waflib.Tools.c_tests.check_library(self, mode=None, test_exec=True)[source]¶
Configuration Method bound to
waflib.Configure.ConfigurationContext
Checks if libraries can be linked with the current linker. Uses
waflib.Tools.c_tests.link_lib_test_fun()
.- Parameters
mode (string) – c or cxx or d
- waflib.Tools.c_tests.check_inline(self, **kw)[source]¶
Configuration Method bound to
waflib.Configure.ConfigurationContext
Checks for the right value for inline macro. Define INLINE_MACRO to 1 if the define is found. If the inline macro is not ‘inline’, add a define to the
config.h
(#define inline __inline__)- Parameters
define_name (string) – define INLINE_MACRO by default to 1 if the macro is defined
features (list of string) – by default c or cxx depending on the compiler present
- waflib.Tools.c_tests.check_large_file(self, **kw)[source]¶
Configuration Method bound to
waflib.Configure.ConfigurationContext
Checks for large file support and define the macro HAVE_LARGEFILE The test is skipped on win32 systems (DEST_BINFMT == pe).
- Parameters
define_name (string) – define to set, by default HAVE_LARGEFILE
execute (bool) – execute the test (yes by default)
- class waflib.Tools.c_tests.grep_for_endianness(*k, **kw)[source]¶
Task that reads a binary and tries to determine the endianness
- color = 'PINK'¶
Color for the console display, see
waflib.Logs.colors_lst
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- hcode = b"\tdef run(self):\n\t\ttxt = self.inputs[0].read(flags='rb').decode('latin-1')\n\t\tif txt.find('LiTTleEnDian') > -1:\n\t\t\tself.generator.tmp.append('little')\n\t\telif txt.find('BIGenDianSyS') > -1:\n\t\t\tself.generator.tmp.append('big')\n\t\telse:\n\t\t\treturn -1\n"¶
String representing an additional hash for the class representation
- waflib.Tools.c_tests.grep_for_endianness_fun(self)[source]¶
Task generator method
Used by the endianness configuration test
- Feature
- waflib.Tools.c_tests.check_endianness(self)[source]¶
Configuration Method bound to
waflib.Configure.ConfigurationContext
Executes a configuration test to determine the endianness
Features defined in this module: