Skip to content

Commit 9470a0f

Browse files
committed
Add concrete examples for TestPaths paths
1 parent 2aaa62b commit 9470a0f

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/tools/compiletest/src/common.rs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,10 +1075,31 @@ fn query_rustc_output(config: &Config, args: &[&str], envs: HashMap<String, Stri
10751075
String::from_utf8(output.stdout).unwrap()
10761076
}
10771077

1078+
/// Path information for a single test file.
10781079
#[derive(Debug, Clone)]
1079-
pub struct TestPaths {
1080-
pub file: Utf8PathBuf, // e.g., compile-test/foo/bar/baz.rs
1081-
pub relative_dir: Utf8PathBuf, // e.g., foo/bar
1080+
pub(crate) struct TestPaths {
1081+
/// Full path to the test file.
1082+
///
1083+
/// For example:
1084+
/// - `/home/ferris/rust/tests/ui/warnings/hello-world.rs`
1085+
///
1086+
/// ---
1087+
///
1088+
/// For `run-make` tests, this path is the _directory_ that contains
1089+
/// `rmake.rs`.
1090+
///
1091+
/// For example:
1092+
/// - `/home/ferris/rust/tests/run-make/emit`
1093+
pub(crate) file: Utf8PathBuf,
1094+
1095+
/// Subset of the full path that excludes the suite directory and the
1096+
/// test filename. For tests in the root of their test suite directory,
1097+
/// this is blank.
1098+
///
1099+
/// For example:
1100+
/// - `file`: `/home/ferris/rust/tests/ui/warnings/hello-world.rs`
1101+
/// - `relative_dir`: `warnings`
1102+
pub(crate) relative_dir: Utf8PathBuf,
10821103
}
10831104

10841105
/// Used by `ui` tests to generate things like `foo.stderr` from `foo.rs`.

0 commit comments

Comments
 (0)