Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Morganamilo committed Nov 5, 2023
1 parent 672c4b6 commit 5aa80cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/paru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ jobs:
run: cargo build --locked --features git,generate

- name: Test
run: sudo -u nobody RUST_BACKTRACE=1 BUILDDIR=/tmp PKGDEST=/tmp SRCDEST=/tmp CARGO_HOME=/tmp/cargo cargo test --locked --features git,generate,mock --target-dir=/tmp -- --test-threads=1 --nocapture
run: sudo -u nobody BUILDDIR=/tmp PKGDEST=/tmp SRCDEST=/tmp CARGO_HOME=/tmp/cargo cargo test --locked --features git,generate,mock --target-dir=/tmp -- --test-threads=1 --nocapture
9 changes: 9 additions & 0 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ async fn run(run_args: &[&str], repo: bool) -> Result<(TempDir, i32)> {
let tmp = TempDir::new().unwrap();
let dir = tmp.path();
let testdata = Path::new(&var("CARGO_MANIFEST_DIR").unwrap()).join("testdata");
println!("1");

let status = Command::new("cp")
.arg("-rp")
Expand Down Expand Up @@ -57,9 +58,15 @@ async fn run(run_args: &[&str], repo: bool) -> Result<(TempDir, i32)> {
.status()?;
assert!(status.success());
}
println!("2");

println!("{} {}", dir.display(), testdata.display());
println!("{}", dir.join("cache/pkg"));
println!("2.4");
std::fs::create_dir_all(dir.join("cache/pkg"))?;
println!("2.5");
std::fs::create_dir_all(testdata.join("pkg"))?;
println!("3");

let mut file = fs::OpenOptions::new()
.append(true)
Expand Down Expand Up @@ -137,6 +144,7 @@ async fn run(run_args: &[&str], repo: bool) -> Result<(TempDir, i32)> {
let mut path = std::env::var("PATH").unwrap();
path.push(':');
path.push_str(testdata.join("bin").to_str().unwrap());
println!("4");

std::env::set_var("PACMAN", "true");
std::env::set_var("PACMAN_CONF", dir.join("pacman.conf"));
Expand Down Expand Up @@ -175,6 +183,7 @@ async fn run(run_args: &[&str], repo: bool) -> Result<(TempDir, i32)> {
let ret = paru::run(&args).await;
assert_eq!(ret, 0);
}
println!("5");

args.extend(run_args);
let ret = paru::run(&args).await;
Expand Down

0 comments on commit 5aa80cd

Please sign in to comment.