test: fix eval and file-close - #43
Conversation
| let workspace = Path::new(env!("CARGO_MANIFEST_DIR")) | ||
| .parent() | ||
| .expect("vmm crate is inside the workspace"); | ||
|
|
||
| // Cargo supplies both binaries; VMM expects the guest ELF before guest argv | ||
| let child = Command::new(env!("CARGO_BIN_EXE_vmm")) | ||
| .arg(env!("CARGO_BIN_FILE_FIX_GUEST_fix")) | ||
| .arg("eval") | ||
| .arg(program.path()) | ||
| .current_dir(workspace) | ||
| .stdout(Stdio::piped()) | ||
| .stderr(Stdio::piped()) | ||
| .spawn() | ||
| .expect("launch Fix-on-Arca under the VMM"); |
There was a problem hiding this comment.
Can you have Rust embed the guest binary into this one instead or reading it? This currently seems brittle.
There was a problem hiding this comment.
In the Cargo.toml I added
[dev-dependencies]
fix-guest = { package = "fix", path = "../fix", artifact = "bin:fix", target = "x86_64-unknown-none" }
so calling cargo test should build the Fix guest artifact first. I tried embedding it but couldn't really see a clean way of doing so. Also, I'm not quite sure of the benefit of that approach, is there something that could fail with how it is right now?
There was a problem hiding this comment.
I think the main thing that concerns me is the path possibly being incorrect depending on the user's config; like their editor might invoke cargo test in the current file's directory rather than the project root. Right now the path is a compile-time literal but it's being evaluated at runtime which is odd. Also philosophically I'm hesitant to have a hard dependency that isn't visible to the compiler/runtime/OS...
Adds test for entire fix eval pipeline