2020-10-22 07:07:31 +08:00
|
|
|
---
|
|
|
|
short-description: Rust language integration module
|
|
|
|
authors:
|
|
|
|
- name: Dylan Baker
|
|
|
|
email: dylan@pnwbakers.com
|
|
|
|
years: [2020]
|
|
|
|
...
|
|
|
|
|
|
|
|
# Unstable Rust module
|
|
|
|
|
|
|
|
*(new in 0.57.0)*
|
|
|
|
|
|
|
|
**Note** Unstable modules make no backwards compatible API guarantees.
|
|
|
|
|
2021-02-01 00:00:24 +08:00
|
|
|
The rust module provides helper to integrate rust code into Meson. The
|
|
|
|
goal is to make using rust in Meson more pleasant, while still
|
|
|
|
remaining mesonic, this means that it attempts to make Rust work more
|
|
|
|
like Meson, rather than Meson work more like rust.
|
2020-10-22 07:07:31 +08:00
|
|
|
|
|
|
|
## Functions
|
|
|
|
|
|
|
|
### test(name: string, target: library | executable, dependencies: []Dependency)
|
|
|
|
|
2021-01-30 19:20:59 +08:00
|
|
|
This function creates a new rust unittest target from an existing rust
|
|
|
|
based target, which may be a library or executable. It does this by
|
|
|
|
copying the sources and arguments passed to the original target and
|
|
|
|
adding the `--test` argument to the compilation, then creates a new
|
|
|
|
test target which calls that executable, using the rust test protocol.
|
2020-10-22 07:07:31 +08:00
|
|
|
|
|
|
|
This accepts all of the keyword arguments as the
|
|
|
|
[`test`](Reference-manual.md#test) function except `protocol`, it will set
|
|
|
|
that automatically.
|
|
|
|
|
|
|
|
Additional, test only dependencies may be passed via the dependencies
|
|
|
|
argument.
|