blob: 1b5547b0615f4afef26ae30e51779672bbc74dfc [file] [log] [blame]
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace rust_test}
/***/
{template .soyweb}
{call buck.page}
{param title: 'rust_test()' /}
{param navid: 'rule_rust_test' /}
{param prettify: true /}
{param description}
A rust_test() rule runs Rust tests.
{/param}
{param content}
{call buck.rule}
{param status: 'UNFROZEN' /}
{param overview}
<p>
A rust_test() rule builds a Rust test native executable from the supplied set of Rust source
files and dependencies and runs this test.
</p>
<p>
{call rust_common.supported_language_version /}
</p>
{/param}
{param args}
{call buck.name_arg /}
{call buck.arg}
{param name: 'framework' /}
{param default : true /}
{param desc}
Use the standard test framework. If this is set to false, then the result is a normal
executable which requires a <code>main()</code>, etc. It is still expected to accept the
same command-line parameters and produce the same output as the test framework.
{/param}
{/call}
{call test_common.contacts_arg /}
{call rust_common.srcs_arg /}
{call rust_common.mapped_srcs_arg /}
{call rust_common.deps_arg /}
{call rust_common.named_deps_arg /}
{call buck.platform_deps_arg /}
{call rust_common.edition_arg /}
{call rust_common.features_arg /}
{call rust_common.rustc_flags_arg /}
{call rust_common.env_arg /}
{call rust_common.crate /}
{call rust_common.crate_root /}
{call native_common.link_style /}
{/param} // close args
{param examples}
{call rust_common.more_examples /}
{literal}<pre class="prettyprint lang-py">
rust_test(
name='greet',
srcs=[
'greet.rs',
],
deps=[
':greeting',
],
)
rust_library(
name='greeting',
srcs=[
'greeting.rs',
],
deps=[
':join',
],
)
rust_library(
name='join',
srcs=[
'join.rs',
],
)
</pre>{/literal}
{/param}
{/call} // close buck.rule
{/param}
{/call}
{/template}