Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ jobs:
if: ${{ !startsWith(matrix.build, 'netbsd') }}
run: ${{ env.CARGO }} test --verbose ${{ env.TARGET_FLAGS }}

- name: cargo test (container tests)
if: ${{ matrix.build == 'linux' }}
# Grant the tests (running inside the cross docker container) access to the host's docker socket
env:
CROSS_CONTAINER_OPTS: -v /var/run/docker.sock:/var/run/docker.sock -e DOCKER_HOST=unix:///var/run/docker.sock
CROSS_CONTAINER_UID: "0"
CROSS_CONTAINER_GID: "0"
CROSS_CONTAINER_USER_NAMESPACE: none
run: ${{ env.CARGO }} test --verbose --test freedesktop_tests ${{ env.TARGET_FLAGS }} -- --ignored

- name: cargo test (without chrono)
if: ${{ !startsWith(matrix.build, 'netbsd') }}
run: ${{ env.CARGO }} test --verbose --no-default-features --features coinit_apartmentthreaded ${{ env.TARGET_FLAGS }}
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ env_logger = "0.10.0"
tempfile = "3.8.0"
defer = "0.2.1"

[target.'cfg(target_os = "linux")'.dev-dependencies]
testcontainers = "0.23"
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time"] }


[target.'cfg(target_os = "macos")'.dependencies]
objc2 = "0.6.2"
Expand Down
21 changes: 21 additions & 0 deletions examples/trash.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/// Simple CLI that calls `trash::delete`.
///
/// Usage: trash delete <path>
///
/// Exits 0 on success, 1 on trash error, 2 on bad arguments.
///
/// Note: This binary is used by the freedesktop_tests integration tests.
fn main() {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call this trash and put it into examples? I'd like to avoid src/bin while it's used just for testing.

Copy link
Copy Markdown
Contributor Author

@null-dev null-dev Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good idea, done! Just be aware that the CARGO_BIN_EXE_ trick Copilot mentioned here doesn't work with example bins so I had to go change that logic back to the manual detection approach.

let args: Vec<String> = std::env::args().collect();
if args.len() < 3 || args[1] != "delete" {
eprintln!("Usage: trash delete <path>");
std::process::exit(2);
}
match trash::delete(&args[2]) {
Ok(()) => {}
Err(e) => {
eprintln!("Error: {e:?}");
std::process::exit(1);
}
}
}
Loading
Loading