1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Shared code for the `zakurad` acceptance tests.
//!
//! # Warning
//!
//! Test functions in this file and its submodules will not be run.
//! This file is only for test library code.
//!
//! This module uses the legacy directory structure,
//! to avoid compiling an empty "common" test binary:
//! <https://doc.rust-lang.org/book/ch11-03-test-organization.html#submodules-in-integration-tests>
/// Returns the path to the compiled `zakurad` binary under test.
///
/// Prefers the value the test runner exports at run time
/// (`CARGO_BIN_EXE_zakurad`), so the tests keep working when the binaries are
/// relocated away from the directory they were compiled in — for example when
/// they are run from a `cargo nextest` archive on a different job than the one
/// that built them. Falls back to the path Cargo bakes in at compile time for
/// ordinary in-tree `cargo test` runs, where the run-time variable is absent.