forge
Explore
Log in

Don't you dare go Hollow

edith

Clone
★ 0

0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits

hwchild.rs23 lines, 956 bytesHistoryRawDownload
1//! The check every test that needs a hardware seat runs first.
2//!
3//! The seats open `hw-child` beside the executable, and nothing builds it for
4//! `cargo test -p engine`. Without it every hardware call answers "no" and the
5//! test fails with a vague "no plugin available", or quietly takes the software
6//! path. So on a machine that has a render node, a missing child is a panic
7//! that names the build command. On a machine without one, the tests keep their
8//! old behaviour and skip.
9//!
10//! Included by path (`#[path = "support/hwchild.rs"] mod hwchild;`); not a test
11//! target of its own.
12#![allow(dead_code)]
13
14/// Panics when this machine has a render node but no `hw-child` can be found.
15pub fn require() {
16 if engine::hwproc::child_path().is_some() || !engine::hwproc::render_node_present() {
17 return;
18 }
19 panic!(
20 "hw-child not built: run `{}` (or set VE_HW_CHILD_BIN)",
21 engine::hwproc::BUILD_CHILD
22 );
23}