bins (only if benchmark targets are built and required features are.lib - used to link with binaries and benchmarks.When no target selection options are given, cargo bench will build theįollowing targets of the selected packages: Single quotes or double quotes around each pattern. However, to avoid your shellĪccidentally expanding glob patterns before Cargo handles them, you must use This flag may be specified multiple times and supportsĬommon Unix glob patterns like *, ? and. exclude SPEC… Exclude the specified packages. workspace Benchmark all members in the workspace. However, to avoid your shell accidentallyĮxpanding glob patterns before Cargo handles them, you must use single quotes orĭouble quotes around each pattern. This flag may be specified multiple times and supports common Unix p spec… -package spec… Benchmark only the specified packages. workspace), and a non-virtual workspace will include only the root crate itself. Virtual workspace will include all workspace members (equivalent to passing The default members of a workspace can be set explicitly with the The workspaces default members are selected, otherwise only the package defined If the manifest is the root of a workspace then Within the executable to completion, this flag only applies to the executableīy default, when no package selection options are given, the packages selectedĭepend on the selected manifest file (based on the current working directory if The Rust test harness will run all benchmarks Without this flag, Cargo will exitĪfter the first executable fails. no-fail-fast Run all benchmarks regardless of failure. OPTIONS Benchmark Options -no-run Compile, but don’t run benchmarks. Relative paths, regardless from where cargo bench was executed from. Makes it possible for benchmarks to reliably access the package’s files using Setting the working directory of benchmarks to the package’s root directory The working directory of every benchmark is set to the root directory of the You can then run the debug-enabled benchmark within aĭebugger. If you need to debug aīenchmark, you can use the -profile=dev command-line option to switch to Optimizations and disables debugging information. Running benchmarks on the stable channel, such asīy default, cargo bench uses the bench profile, which enables Is currently unstable and only available on the Manifest settings, in which case your code will need to provide its own main The libtest harness may be disabled by setting harness = false in the target The executableĪutomatically runs all functions annotated with the # attribute.Ĭargo passes the -bench flag to the test harness to tell it to run Special executable by linking your code with libtest. Similarly named benchmarks like foobar): cargo bench - foo -exactīenchmarks are built with the -test option to rustc which creates a For details about libtest’sĪrguments see the output of cargo bench -help and check out the rustcĪs an example, this will run only the benchmark named foo (and skip other To the binary, the ones before go to Cargo. You are passing arguments to both Cargo and the binary, the ones after - go Libtest (rustc’s built in unit-test and micro-benchmarking framework). The two dashes ( -) are passed to the benchmark binaries and thus to The benchmark filtering argument benchname and all the arguments following Cargo-bench - Execute benchmarks of a package SYNOPSISĬargo bench DESCRIPTION
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |