horizon-world probes: one binary, probe <name>
The 168 horizon-world examples the parity harnesses run become modules of one example, examples/probe, that dispatches on its first argument; crate::args() gives each the command line its example saw. Linking ~170 binaries, each instantiating horizon-world's generics again, was most of the parity job's probe build (review plan, section 1). The harnesses build `--example probe` and run `probe <name> ...`. tools/parity.py counts only the probes a harness ran, and the support modules they name, as its dependencies, so editing one probe still reruns only its own harnesses (and PARITY_RUST_SCOPE keeps working). The six manual tools (benches, loot_fill, structure_blocks, vanilla_diff, attribute_memory, behaviour_load_profile) stay separate examples. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -51,7 +51,7 @@ def main():
|
||||
if not tags or tags!=worldgen.tag_resources(jars['client']):raise ValueError('client/server tags differ')
|
||||
(build/'tags.json').write_text(json.dumps(tags,separators=(',',':')),encoding='utf-8')
|
||||
sources=[oracle,helper,tag_helper,Path(__file__),lab.ROOT/"tools/test_worldgen_parity.py",lab.ROOT/"tools/test_rust_parity.py",lab.ROOT/"tools/lab.py",lab.ROOT/"Cargo.toml",lab.ROOT/"Cargo.lock",lab.ROOT/"crates/horizon-core/Cargo.toml",lab.ROOT/"crates/horizon-world/Cargo.toml",
|
||||
*sorted((lab.ROOT/"crates/horizon-core/src").rglob("*.rs")),*sorted((lab.ROOT/"crates/horizon-world/src").rglob("*.rs")),lab.ROOT/"crates/horizon-world/examples/replace_block_fixture.rs"]
|
||||
*sorted((lab.ROOT/"crates/horizon-core/src").rglob("*.rs")),*sorted((lab.ROOT/"crates/horizon-world/src").rglob("*.rs")),lab.ROOT/"crates/horizon-world/examples/probe/replace_block_fixture.rs"]
|
||||
tested_sources=base.source_hashes(sources)
|
||||
fixture_paths=[build/"tags.json"];classes=build/"classes";classes.mkdir(exist_ok=True)
|
||||
def run(command,name):
|
||||
@@ -68,10 +68,10 @@ def main():
|
||||
fixtures=list(corpus(facts));inputs=build/"inputs.txt";inputs.write_text("".join(json.dumps(f,separators=(",",":"))+"\n" for f in fixtures),encoding="utf-8")
|
||||
fixture_paths.append(inputs)
|
||||
tested_fixtures=base.source_hashes(fixture_paths)
|
||||
run(["cargo","build","--release","-p","horizon-world","--example","replace_block_fixture"],"compile-rust")
|
||||
run(["cargo","build","--release","-p","horizon-world","--example","probe"],"compile-rust")
|
||||
metadata=json.loads(subprocess.check_output(["cargo","metadata","--no-deps","--format-version","1"],cwd=lab.ROOT,text=True))
|
||||
binary=Path(metadata["target_directory"])/"release/examples"/("replace_block_fixture.exe" if os.name=="nt" else "replace_block_fixture")
|
||||
run([binary,build],"rust")
|
||||
binary=Path(metadata["target_directory"])/"release/examples"/("probe.exe" if os.name=="nt" else "probe")
|
||||
run([binary,"replace_block_fixture",build],"rust")
|
||||
references=[]
|
||||
for side,jar in jars.items():
|
||||
reference=build/f"{side}.txt"
|
||||
|
||||
Reference in New Issue
Block a user