Skip to content

Instantly share code, notes, and snippets.

@target-san
target-san / subprocess-test.rs
Last active April 19, 2025 18:34
Implement Rust test which launches itself as a separate subprocess
//! ```cargo
//! [dependencies]
//! tempfile = "3.19"
//! ```
use std::env::var_os;
use std::fs::File;
use std::io::{Read, Seek, SeekFrom};
use std::process::{Command, Stdio};
use tempfile::tempfile;