![]() |
wtools 4.0.0-pre7
ESO waf tools
|
Functions | |
| handle_ut_attrs (kw, bld) | |
| node_names (nodes) | |
| get_module_name (ctx, submodule=None) | |
| get_module_namespace_path (ctx) | |
| _install_headers (bld, kw) | |
| _install_generated_headers (bld, taskgen, exts, kw) | |
| _append_kw (kw, name, value) | |
| _remove_kw (kw, name, value) | |
| _set_default (kw, name, value) | |
| _set_defaults (bld, kw) | |
| _set_qt5c_defaults (bld, kw) | |
| _set_qt5c_plugin_defaults (bld, kw) | |
| _set_c_defaults (bld, kw) | |
| _verify_c_build (bld, **kw) | |
| set_sanitize_flags (bld, kw) | |
| _set_java_defaults (bld, kw) | |
| auto_cunit (bld, *, target, test_tg=None, **kw) | |
| auto_qt5unit (bld, *, target, test_tg=None, **kw) | |
| auto_pyunit (bld, *, target, **kw) | |
| auto_cprogram (bld, *, target, **kw) | |
| auto_cprotobuf (bld, *, target, **kw) | |
| auto_cfastdds (bld, *, target, **kw) | |
| auto_cstlib (bld, *, target, **kw) | |
| auto_cobjects (bld, *, target, **kw) | |
| auto_cshlib (bld, *, target, **kw) | |
| auto_qt5cshlib (bld, *, target, **kw) | |
| auto_qt5cprogram (bld, *, target, **kw) | |
| auto_pypackage (bld, *, target, with_unit_test, **kw) | |
| auto_pyprogram (bld, *, target, with_unit_test, **kw) | |
| auto_pyprotobuf (bld, *, target, **kw) | |
| auto_jar (bld, *k, **kw) | |
| auto_javatest (bld, *k, **kw) | |
| auto_jprotobuf (bld, *k, **kw) | |
| auto_config (bld, **kw) | |
| auto_sphinx (bld, **kw) | |
| ext_sys_clib (cnf, name, libs, libpath, incpath) | |
| ext_proj_clib (cnf, name, libs=None, prefix=None) | |
| auto_malicd (bld, **kw) | |
| auto_malicd_topics (bld, **kw) | |
Variables | |
| list | STD_EXCL = ["**/*~", "**/.*"] |
Provides auto_cprogram, auto_cstlib, auto_cshlib aliases in the build context
to automate creation using project standardized directory structure::
module # Target node, also serves as the target name by default
src # Source files
src/include # Public includes (exportable)
test # Test files
wscript # build script that may use auto_*.
Enable by loading module in options::
def options(opt):
opt.load('auto', tooldir='wtools')
See `waflib/Tools/c_aliases.py` for implementation of bld.program, bld.stlib
and bld.shlib.
|
protected |
Append `value` to kw[name] as lists. value can be a list or space-separated list.
|
protected |
Create task that install generated headers from passed taskgen to ${PREFIX}/include
|
protected |
Create task that install headers from src/include/ to ${PREFIX}/include
|
protected |
Remove `value` from kw[name].
|
protected |
Set default arguments for C/C++ artefact modules. - .cpp and .c Sources are globbed from src/ directory. - Headers are exported from src/include and test/mock. Note: test/mock is exported to propagate the mocks to unit tests. The directory will be changed to test/include to make naming coherent with src/ (ELTDEV-676).
|
protected |
Set default keywords if not already set. This should remain language agnostic or compatible with supported languages
|
protected |
Set default values for QT plugins modules
| wtools.auto.auto_cfastdds | ( | bld, | |
| * | , | ||
| target, | |||
| ** | kw ) |
Declare C/C++ Fast DDS files generation (.idl file to .h/.cxx) and create
a dynamic library.
If a static library is preferred an option "features=cxxstlib" can be passed
Make sure that the project is configured (use) with 'fastdds' (and fastddsgen
tool is in the $PATH).
Kwargs:
target: Name of target
| wtools.auto.auto_cobjects | ( | bld, | |
| * | , | ||
| target, | |||
| ** | kw ) |
Declare C/C++ objects (collection of source and/or header files).
The following preprocessor definitions are automatically added:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
Kwargs:
target: Name of target
Returns:
Primary artefact taskgen
| wtools.auto.auto_config | ( | bld, | |
| ** | kw ) |
Declare configuration tasks that copies resource/** or files passed via kwargs in source. Destination is either $PREFIX or directory specified by install_path in kwargs. Files are copied with full directory if rel in kwargs is True (default), otherwise if False
| wtools.auto.auto_cprogram | ( | bld, | |
| * | , | ||
| target, | |||
| ** | kw ) |
Declare C/C++ program (.c and .cpp files)
The following preprocessor definitions are automatically added:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
Kwargs:
target: Name of target
Returns:
Primary artefact taskgen
| wtools.auto.auto_cprotobuf | ( | bld, | |
| * | , | ||
| target, | |||
| ** | kw ) |
Declare C/C++ protobuffer files generation (.proto file to pb.h/.pb.cc)
and create a dynamic library.
If a static library is preferred an option "features=cxxstlib" can be passed
Kwargs:
target: Name of target
| wtools.auto.auto_cshlib | ( | bld, | |
| * | , | ||
| target, | |||
| ** | kw ) |
Declare C/C++ shared library.
The following preprocessor definitions are automatically added:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
Kwargs:
target: Name of target
Returns:
Primary artefact taskgen
| wtools.auto.auto_cstlib | ( | bld, | |
| * | , | ||
| target, | |||
| ** | kw ) |
Declare C/C++ static library.
The following preprocessor definitions are automatically added:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
Kwargs:
target: Name of target
Returns:
Primary artefact taskgen
| wtools.auto.auto_cunit | ( | bld, | |
| * | , | ||
| target, | |||
| test_tg = None, | |||
| ** | kw ) |
Creates a cprogram task generator for the local unit test.
The following preprocessor definisions are defined by default:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
`UNIT_TEST=1`
Kwargs:
target: target name for unit test (must end in '_test' or '_cunit' or '_qt5unit').
If the name ends in _qt5unit it is supposed to be a QT unit test and a few
additional rules are applied (addition also of QT generated files as source,
additional libraries linked ...)
test_tg: (optional) The task generator for the software under test. Sources will
be copied from this task generator.
source: (optional) list of test source files defaults to test/**/*.cpp.
extra_source: (optional) list of additional source files, used to e.g.
build also primary artefact sources.
The file src/main.{cpp,c} will be removed if it exists to not
introduce another main() in the test artefact.
with_ut_lib: (optional) Unit test library to be used to execute the unit test
Supported values:
- gtest (default): Google test (https://github.com/google/googletest)
- qttest / qt5test: QT unit test (https://doc.qt.io/qt-5/qtest-overview.html)
- catch2 : catch2 (https://github.com/catchorg/Catch2)
- gbench : google test + benchmark (https://github.com/google/benchmark)
Default from cnf.env.CPP_DEFAULT_UT_LIB (either set by user, or defaults
to gtest)
ut_attrs: (optional) attributes to directly override in test task as compared to parent
valgrind_suppression: (optional) list with paths (relative to module or absolute) to add
as valgrind suppressions when run in valgrind mode
| wtools.auto.auto_jar | ( | bld, | |
| * | k, | ||
| ** | kw ) |
Declare Java JAR taskgenerator
Compiles all the .java files in src and generated relative .class files
that are then packed in the JAR from the build directory.
Files present in src/resources are recursively included in the JAR along
with all the generated .class files.
JAR files generated are installed in ${PREFIX}/lib
Kwargs:
target: (Mandatory) Name of task generator and generated JAR file
manifest: (Optional) Manifest file to be used (path relative from module)
| wtools.auto.auto_javatest | ( | bld, | |
| * | k, | ||
| ** | kw ) |
Declare Java TestNG test taskgenerator Test configuration is read from TestNG XML configuration files that are searched recursively under test/ for files that finish in testng.xml Files present in test/resources are recursively copied to the build along with all the generated .class files and can be therefore used by the test. If coverage is enabled the tests will be run through jacoco and at the end jacococli will be executed to generate the HTML reports from the jacoco binary data.
| wtools.auto.auto_jprotobuf | ( | bld, | |
| * | k, | ||
| ** | kw ) |
Declare Java protobuf files generation (.pb2 file to .java) and create
a JAR
Kwargs:
target: (Mandatory) Name of task generator and generated JAR file
manifest: (Optional) Manifest file to be used (path relative from module)
protoc_extincludes: (Optional) List of directories external to project to include for searching included files
| wtools.auto.auto_pypackage | ( | bld, | |
| * | , | ||
| target, | |||
| with_unit_test, | |||
| ** | kw ) |
Declare a Python package and unit tests.
| wtools.auto.auto_pyprogram | ( | bld, | |
| * | , | ||
| target, | |||
| with_unit_test, | |||
| ** | kw ) |
Declare a Python program, optional package and unit tests.
It assumes that there will be:
- A single `src/<target>.py` file representing the program executable. The script will be
installed without the `.py` extension
- An optional `src/<target>/` Python package for bigger programs needing multiple
files without having to create additional modules.
The unit tests will have the `PYTHONPATH` populated such that the pyprogram module Python package
can be imported in the tests.
Kwargs:
target: (Mandatory) Name of install target and task generator (must match target filename)
py_program: (Optional) Python program path [default: src/<target>.py]
py_package: (Optional) Python package dir [default: src/<target>/]
| wtools.auto.auto_pyprotobuf | ( | bld, | |
| * | , | ||
| target, | |||
| ** | kw ) |
Declare a Python module containing protobuffer interface (as a module, as protoc does) target: (Mandatory) Name of task generator protoc_extincludes: (Optional) List of directories external to project to include for searching included files
| wtools.auto.auto_pyunit | ( | bld, | |
| * | , | ||
| target, | |||
| ** | kw ) |
Creates a Python unit test runner task
It executes a python test runner on all sources in src/ test/ from in the build dir test
directory.
The PYTHONPATH is populated so that dependent Python modules and packages from use
list are found before any installed version.
Kwargs:
with_doctest: boolean flag to enable/disable doctests.
with_ut_lib: Unit test library to be used to execute the unit test
Supported values:
- pytest: PyTest (https://docs.pytest.org/en/latest/)
ut_attrs: (optional) attributes to directly override in test task as compared to parent
| wtools.auto.auto_qt5cprogram | ( | bld, | |
| * | , | ||
| target, | |||
| ** | kw ) |
Declare C/C++ program and unit test using Qt (.c and .cpp files) The following preprocessor definitions are automatically added: `WAF_MODULE_PATH = absolute path to the module root` `WAF_MODULE_NAME = fully qualified module name`
| wtools.auto.auto_qt5cshlib | ( | bld, | |
| * | , | ||
| target, | |||
| ** | kw ) |
Declare C/C++ shared library and unit test using Qt (.c and .cpp files) The following preprocessor definitions are automatically added: `WAF_MODULE_PATH = absolute path to the module root` `WAF_MODULE_NAME = fully qualified module name`
| wtools.auto.auto_qt5unit | ( | bld, | |
| * | , | ||
| target, | |||
| test_tg = None, | |||
| ** | kw ) |
Creates a cprogram task generator for the local unit test using QtTest.
Warning: QT unit test management has now been incorporated in standard C++ Unit test,
this is just a wrapper setting some default values. Please see auto_cunit definition for
complete details
The following preprocessor definitions are defined by default:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
`UNIT_TEST=1`
Kwargs:
target: target name for unit test (should end in _qt5unit)
test_tg: (optional) The task generator for the software under test. Sources will
be copied from this task generator.
source: (optional) list of test source files defaults to test/**/*.cpp.
extra_source: (optional) list of additional source files, used to e.g.
build also primary artefact sources.
The file src/main.{cpp,c} will be removed if it exists to not
introduce another main() in the test artefact.
with_ut_lib: (optional) Unit test library to be used to execute the unit test
Supported values:
- gtest: Google test (https://github.com/google/googletest)
- qttest / qt5test (default): QT unit test (https://doc.qt.io/qt-5/qtest-overview.html)
- catch2 : catch2 (https://github.com/catchorg/Catch2)
| wtools.auto.auto_sphinx | ( | bld, | |
| ** | kw ) |
Declare Sphinx documentation build.
| wtools.auto.ext_proj_clib | ( | cnf, | |
| name, | |||
| libs = None, | |||
| prefix = None ) |
Declare external project C/C++ library.
Kwargs:
name: Canonical library name. I.e. 'mod' for library 'libmod.so'/'libmod.a'
prefix: The prefix is automatically picked up from
| wtools.auto.ext_sys_clib | ( | cnf, | |
| name, | |||
| libs, | |||
| libpath, | |||
| incpath ) |
Declare external system C/C++ library
| wtools.auto.get_module_name | ( | ctx, | |
| submodule = None ) |
Get fully qualified module name using the standard convention that the wscript located in a directory named after the module and intermediate packages.
| wtools.auto.get_module_namespace_path | ( | ctx | ) |
Returns the current module namespace as a path element. Example: "module" if module is in the global module namespace or, "package1/package2/module" if the module is ordered inside package.
| wtools.auto.set_sanitize_flags | ( | bld, | |
| kw ) |
Set sanitizer compiler/linker flags for C/C++ taking into account also the toggle on the specific module kw['sanitize'] assumed True if missing