mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-21 20:18:06 +02:00
[pitboss] phase 04: M4 — Rust harness (second-language validation)
This commit is contained in:
parent
e875aa1208
commit
3ffe480660
37 changed files with 1872 additions and 54 deletions
|
|
@ -4,6 +4,7 @@
|
|||
//! The top-level [`emit`] function dispatches on `spec.lang`.
|
||||
|
||||
pub mod python;
|
||||
pub mod rust;
|
||||
|
||||
use crate::dynamic::spec::HarnessSpec;
|
||||
use crate::evidence::UnsupportedReason;
|
||||
|
|
@ -14,16 +15,25 @@ use crate::symbol::Lang;
|
|||
pub struct HarnessSource {
|
||||
/// Harness source code as a UTF-8 string.
|
||||
pub source: String,
|
||||
/// Filename for the harness (e.g. `"harness.py"`).
|
||||
/// Filename for the harness (e.g. `"harness.py"`, `"src/main.rs"`).
|
||||
pub filename: String,
|
||||
/// Shell command to invoke the harness (relative to the workdir).
|
||||
pub command: Vec<String>,
|
||||
/// Additional files to write to the workdir alongside the main source.
|
||||
/// Each entry is `(relative_path, content)`. Subdirectories are created
|
||||
/// automatically (e.g. `"Cargo.toml"` or `"src/entry.rs"`).
|
||||
pub extra_files: Vec<(String, String)>,
|
||||
/// Where to copy the entry source file (relative to workdir).
|
||||
/// `None` = workdir root (Python default).
|
||||
/// `Some("src/entry.rs")` = Rust module path.
|
||||
pub entry_subpath: Option<String>,
|
||||
}
|
||||
|
||||
/// Dispatch to the appropriate language emitter.
|
||||
pub fn emit(spec: &HarnessSpec) -> Result<HarnessSource, UnsupportedReason> {
|
||||
match spec.lang {
|
||||
Lang::Python => python::emit(spec),
|
||||
Lang::Rust => rust::emit(spec),
|
||||
_ => Err(UnsupportedReason::LangUnsupported),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue