Debian Codegraph @

debian/rust-vendor/rstest/tests/integration.rs

raw
1 use rstest_test::{sanitize_name, testname, Project};
2
3 /// Rstest integration tests
4 mod rstest;
5
6 /// Fixture's integration tests
7 mod fixture;
8
9 use lazy_static::lazy_static;
10
11 use std::path::{Path, PathBuf};
12 use temp_testdir::TempDir;
13
14 lazy_static! {
15 static ref ROOT_DIR: TempDir = TempDir::default().permanent();
16 static ref ROOT_PROJECT: Project = Project::new(ROOT_DIR.as_ref());
17 }
18
19 pub fn base_prj() -> Project {
20 let prj_name = sanitize_name(testname());
21
22 ROOT_PROJECT.subproject(&prj_name)
23 }
24
25 pub fn prj() -> Project {
26 let prj_name = sanitize_name(testname());
27
28 let prj = ROOT_PROJECT.subproject(&prj_name);
29 prj.add_local_dependency("rstest");
30 prj
31 }
32
33 pub fn resources<O: AsRef<Path>>(name: O) -> PathBuf {
34 Path::new("tests").join("resources").join(name)
35 }