fix(app): propagate CZ_TARGET_DEVICE to czcamera_core and keep reap_mutex_ across child_pid_ clear

This commit is contained in:
2026-11-19 14:03:05 -05:00
parent 4304cb259d
commit 3c4a870e70
3 changed files with 20 additions and 4 deletions

View File

@@ -259,6 +259,17 @@ void test_sim_backend_lifecycle() {
assert(from_env != nullptr);
assert(from_env->status().backend_name == "sim");
}
{
EnvVarGuard clear_backend("CZCAMERA_BACKEND");
EnvVarGuard clear_bin("CZCAMERA_CAM_BIN");
auto default_backend = cz::create_camera_backend(false);
assert(default_backend != nullptr);
#ifdef CZ_TARGET_DEVICE
assert(default_backend->status().backend_name == "picamera2-subprocess");
#else
assert(default_backend->status().backend_name == "sim");
#endif
}
cz::SimCameraBackend sim;
assert(!sim.status().ready);