From db66a8cd9548fa42ec8b34fe66bb5736f01de363 Mon Sep 17 00:00:00 2001 From: Tanish Manku Date: Fri, 20 Nov 2026 06:45:34 -0700 Subject: [PATCH] One more layer-state DWG test opts in; the CLI's run documents that it needs a DWG worker Found by running every test of the io, engine, CLI, UI and MCP crates in its own process, as CI does: no other test needs the call. --- apps/cadcraft-cli/src/lib.rs | 4 ++++ crates/io/tests/it/layer_states_acad.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/apps/cadcraft-cli/src/lib.rs b/apps/cadcraft-cli/src/lib.rs index 583c14c70..9f1cc0f0a 100644 --- a/apps/cadcraft-cli/src/lib.rs +++ b/apps/cadcraft-cli/src/lib.rs @@ -76,6 +76,10 @@ pub fn command() -> clap::Command { /// Run the CLI on its arguments (without the program name). Returns the process exit code (0 ok, /// 1 failure, 2 usage). clap reads the arguments as they are: a value that is not valid Unicode /// is a usage error, never a panic as with `std::env::args()`. +/// +/// Reading or writing DWG needs a conversion worker, which this function does not set up: the +/// binary calls `cadcraft_io::dwg_worker::use_own_worker()` first. A caller that hasn't set one up +/// gets "no worker is configured" and exit code 1 for a DWG file. pub fn run(args: I, out: &mut dyn Write, err: &mut dyn Write) -> i32 where I: IntoIterator, diff --git a/crates/io/tests/it/layer_states_acad.rs b/crates/io/tests/it/layer_states_acad.rs index b83be765b..d34155cc1 100644 --- a/crates/io/tests/it/layer_states_acad.rs +++ b/crates/io/tests/it/layer_states_acad.rs @@ -367,6 +367,8 @@ fn a_layer_of_an_xref_gets_group_93() { #[test] fn named_plot_styles_are_written_by_placeholder() { + // The drawing is the test's own, so it is converted in this process. + cadcraft_io::dwg_worker::allow_in_process(); // In a drawing of named plot styles AutoCAD 2024 writes a layer's plot style as group 390, the // handle of the style's placeholder object (measured); CADCraft reads it back by that handle. let mut d = drawing();