From e5bdb085a3d4c0b385256c3fa2d2171a49a4113f Mon Sep 17 00:00:00 2001 From: gryaznulka Date: Sat, 21 Nov 2026 15:29:09 +0100 Subject: [PATCH 1/7] docs: describe public DWG fixtures --- CONTRIBUTING.md | 6 ++---- README.md | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2bd1ea..6cb6835 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,10 +67,8 @@ Run the compile check with a separate artifact directory. dotnet build src/DwgIO.Scene/DwgIO.Scene.csproj -c Release -p:BuildNativeCoreOnly=true --artifacts-path ./artifacts/native-core-check ``` -Tests that need real drawings are skipped with a message when no drawing is -available. Set `DWGIO_TEST_FILES` to the folder containing your private -drawings, or place them in a `test_files` folder, to run them. The repository -ships no drawings. See [test fixtures](docs/test-fixtures.md). +CI exercises the committed public drawings. Set `DWGIO_TEST_FILES` to the folder containing your private +drawings, or place them in a `test_files` folder, to include them in local tests. See [test fixtures](docs/test-fixtures.md). ## Code conventions diff --git a/README.md b/README.md index a206203..1928624 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,8 @@ dotnet build DwgIO.slnx -c Release dotnet test ``` -Tests requiring real DWG files are skipped with a message unless `DWGIO_TEST_FILES` or a `test_files` folder provides private drawings. The repository includes no DWG drawings. See [test fixtures](docs/test-fixtures.md). +CI uses committed public drawings for R2010, R2013 and R2018. Set `DWGIO_TEST_FILES` or use a +`test_files` folder to include private drawings in local tests. See [test fixtures](docs/test-fixtures.md). ## Contributing From e3d2ff6b8e1e509ecf4531f299135e0d61018e2c Mon Sep 17 00:00:00 2001 From: gryaznulka Date: Sat, 21 Nov 2026 15:29:45 +0100 Subject: [PATCH 2/7] docs: update the fixture guide --- docs/test-fixtures.md | 14 +++++++------- docs/toc.yml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/test-fixtures.md b/docs/test-fixtures.md index a66bc5e..aa03ac0 100644 --- a/docs/test-fixtures.md +++ b/docs/test-fixtures.md @@ -1,10 +1,10 @@ -# Private test fixtures +# DWG test fixtures Most tests build their input in the test itself (cipher, decompression, checksums, bit reading, version detection, handle map, object stream and metadata parsing) and run everywhere. The fixture tests in `DwgFixtureTests` need real -drawings. The repository ships no drawings yet. Private fixtures belong in the ignored test folder or outside the -repository. Small redistributable drawings can be added under `test-files/public`. Once available, the fixture -tests will use them in CI on Windows, Linux and macOS. +drawings. The committed [public primitives](https://github.com/IOExtend/DwgIO/blob/main/test-files/public/README.md) cover R2010, R2013 and R2018 +in CI on Windows, Linux and macOS. Private fixtures still belong in the ignored test folder or outside the +repository. ## Where the drawings are looked for @@ -17,8 +17,8 @@ of these folders together: - a folder `test_files` in the repository root (or in any parent of the test binary folder). Every `*.dwg` file directly in such a folder or in one level of subfolders is used, whatever its name. Drawings of the -supported releases (AC1018, AC1024, AC1027, AC1032) are the useful ones. AC1018 has been checked on real local drawings and -still needs a redistributable fixture. Drawings of an unsupported version +supported releases (AC1018, AC1024, AC1027, AC1032) are the useful ones. AC1018 still needs a public fixture. +Drawings of an unsupported version (AC1012 to AC1015, AC1021) are ignored by the fixture tests and counted in the skip reason, so one file of a planned release does not fail every test. @@ -39,5 +39,5 @@ DWGIO_TEST_FILES= dotnet test In PowerShell: `$env:DWGIO_TEST_FILES = ''; dotnet test`. -Do not commit drawings, and do not put file names, object counts or other details of private drawings into tests, +Do not commit private drawings or put their file names, object counts or other details into tests, comments or documentation. diff --git a/docs/toc.yml b/docs/toc.yml index d675fed..e561bac 100644 --- a/docs/toc.yml +++ b/docs/toc.yml @@ -5,7 +5,7 @@ items: - name: Public API href: public-api.md - - name: Private test fixtures + - name: DWG test fixtures href: test-fixtures.md - name: API reference href: api/ From acb4ab34569e07c69dd6ab0d8c2623efaac0ab6d Mon Sep 17 00:00:00 2001 From: gryaznulka Date: Sat, 21 Nov 2026 15:30:56 +0100 Subject: [PATCH 3/7] test: add three redistributable DWG drawings --- test-files/public/README.md | 60 ++++++++++++++++++++++-- test-files/public/primitives-ac1024.dwg | Bin 0 -> 8428 bytes test-files/public/primitives-ac1027.dwg | Bin 0 -> 8394 bytes test-files/public/primitives-ac1032.dwg | Bin 0 -> 8428 bytes 4 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 test-files/public/primitives-ac1024.dwg create mode 100644 test-files/public/primitives-ac1027.dwg create mode 100644 test-files/public/primitives-ac1032.dwg diff --git a/test-files/public/README.md b/test-files/public/README.md index 8a76c53..6bf368e 100644 --- a/test-files/public/README.md +++ b/test-files/public/README.md @@ -1,9 +1,61 @@ # Redistributable test drawings (#33) -This folder is reserved for small DWG files whose licence allows redistribution, one per supported release -(AC1018, AC1024, AC1027, AC1032 — then AC1012 to AC1015 as the readers for those land). The fixture tests -run over every drawing in the fixture folders, so a drawing committed here turns its skipped tests into -real runs in CI on all three systems. +These small DWG drawings exercise R2010, R2013 and R2018 in CI on Windows, Linux and macOS. + +| Drawing | DWG release | SHA-256 of the committed file | +| --- | --- | --- | +| `primitives-ac1024.dwg` | AC1024 (2010) | `e28711b8b875d7d8203e0eef784304e39c95d12e44d28b236fa0765c700c372c` | +| `primitives-ac1027.dwg` | AC1027 (2013) | `1f04c46e0af453898f941b3242843bf07576a55f9066ec52db5830b331dc28c3` | +| `primitives-ac1032.dwg` | AC1032 (2018) | `73443dc0d95e9081aeb16ddb9c7f223ccb96541368c1f08ef4c5318aba3bd112` | + +**Origin and licence:** Each drawing was created from scratch for DwgIO #33 and is distributed +under [DwgIO's MIT licence](../../LICENSE). The independent writer is +[ACadSharp 3.8.35](https://www.nuget.org/packages/ACadSharp/3.8.35) (MIT). +No vendor or third-party drawing, writer implementation, or assembly is included. + +**Contents:** Model space, default layer `0`: one line from (1, 2, 3) to (4, 6, 8), one arc +centred at (-3, 7, 2) with radius 5 from π/6 to π/2 radians, one circle centred at (7, -2, 1) +with radius 4, and one point at (-5, -6, 9). These values are authored inputs, not values +captured from DwgIO. The xUnit theory checks the decoded values and version for every file. + +**Remaining coverage:** AC1018 (R2004) still needs a compatible public fixture. An ACadSharp 3.8.35 +R2004 candidate reopened in that writer's reader, but DwgIO did not decode the four authored entities +and failed its AppInfo and handle-map fixture checks. It is not committed. + +### Regenerating equivalent drawings + +Outside this repository, create a disposable .NET 10 console project and add the pinned writer: + +```sh +dotnet new console --framework net10.0 -o DwgFixtureGenerator +cd DwgFixtureGenerator +dotnet add package ACadSharp --version 3.8.35 +``` + +Replace `Program.cs` with this original fixture recipe: + +```csharp +using ACadSharp; +using ACadSharp.Entities; +using ACadSharp.IO; +using CSMath; + +foreach (var version in new[] { ACadVersion.AC1024, ACadVersion.AC1027, ACadVersion.AC1032 }) +{ + var drawing = new CadDocument(version); + drawing.Entities.Add(new Line(new XYZ(1, 2, 3), new XYZ(4, 6, 8))); + drawing.Entities.Add(new Arc(new XYZ(-3, 7, 2), 5, Math.PI / 6, Math.PI / 2)); + drawing.Entities.Add(new Circle(new XYZ(7, -2, 1), 4)); + drawing.Entities.Add(new Point(new XYZ(-5, -6, 9))); + var name = $"primitives-{version.ToString().ToLowerInvariant()}.dwg"; + DwgWriter.Write(name, drawing); +} +``` + +Run `dotnet run -c Release`. Writer metadata such as timestamps can change the bytes, so the hashes +above identify the committed drawings, not all equivalent regenerations. Validate the version and +geometry with DwgIO before replacing a file, then update the recorded hash. These fixtures exercise +the independent writer's output, not every DWG writer or entity kind. ## How a drawing qualifies diff --git a/test-files/public/primitives-ac1024.dwg b/test-files/public/primitives-ac1024.dwg new file mode 100644 index 0000000000000000000000000000000000000000..6a25c652a3cfc08a19cc60168a3b11bcdf698bb9 GIT binary patch literal 8428 zcmeHMeRLDomA~)JNHdZ~LbhdF27ioX8-&e=Z7|;nBP?v$mTlRV!59OwkwMtPQH>!c zH83^;WMWf?C0UatM39s?Kodwx!lpD8DM?*QTEc-%n$Xlu6GEZgBy5^ETL^o{`RMK@ z-Lrpev!~~D=G^!0`4-bx)UeV#3g)vZ#e`7veb55r7vD}xzxC#<$5(XvPnNHpwqhlP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00001 From df95ce468ece89aab91a59a8b1f562ea2cdff989 Mon Sep 17 00:00:00 2001 From: gryaznulka Date: Sat, 21 Nov 2026 15:31:22 +0100 Subject: [PATCH 4/7] test: assert authored geometry across DWG releases --- tests/DwgIO.Tests/DwgFixtureTests.cs | 37 ++++++++++++++++++++++++---- tests/DwgIO.Tests/TestFiles.cs | 12 +++++++++ 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/tests/DwgIO.Tests/DwgFixtureTests.cs b/tests/DwgIO.Tests/DwgFixtureTests.cs index 2e66a52..bedbfdd 100644 --- a/tests/DwgIO.Tests/DwgFixtureTests.cs +++ b/tests/DwgIO.Tests/DwgFixtureTests.cs @@ -4,9 +4,9 @@ namespace DwgIO.Tests; /// -/// Smoke tests against private DWG files located by (DWGIO_TEST_FILES or a -/// test_files folder; no fixtures are committed to the repository). Each test checks every file and reports -/// all failing files at once; with no file available it is reported as skipped with the reason. +/// Smoke tests against committed public or optional private DWG files located by . +/// Each test checks every file and reports all failing files at once; if no eligible file is available, +/// the test is reported as skipped with the reason. /// public class DwgFixtureTests { @@ -39,8 +39,8 @@ internal static void CheckAll(Func check, string requirement) if (checkedFiles == 0) { throw new SkipException(unsupported > 0 - ? $"No private fixture has {requirement}; {unsupported} drawing(s) of an unsupported version were ignored." - : $"No private fixture has {requirement}."); + ? $"No fixture has {requirement}; {unsupported} drawing(s) of an unsupported version were ignored." + : $"No fixture has {requirement}."); } } @@ -53,6 +53,33 @@ private static bool HasReadableSection(DwgDocument doc, string name) => private static string Diagnostics(DwgDocument doc) => string.Join(" | ", doc.Diagnostics); + [Theory] + [InlineData("AC1024", "primitives-ac1024.dwg")] + [InlineData("AC1027", "primitives-ac1027.dwg")] + [InlineData("AC1032", "primitives-ac1032.dwg")] + public void PublicDrawing_DecodesAuthoredPrimitives(string signature, string fileName) + { + var doc = DwgDocument.Open(TestFiles.PublicDrawing(fileName), new DwgReaderOptions { VerifyChecksums = true }); + + Assert.Equal(signature, doc.Version.Magic); + Assert.Equal(4, doc.Entities.Count(entity => entity.Geometry is not null)); + AssertGeometry(doc, DwgEntityKind.Line, [1, 2, 3, 4, 6, 8]); + AssertGeometry(doc, DwgEntityKind.Arc, [-3, 7, 2, 5, Math.PI / 6, Math.PI / 2]); + AssertGeometry(doc, DwgEntityKind.Circle, [7, -2, 1, 4]); + AssertGeometry(doc, DwgEntityKind.Point, [-5, -6, 9]); + } + + private static void AssertGeometry(DwgDocument document, DwgEntityKind kind, double[] expected) + { + var entity = Assert.Single(document.Entities, entity => entity.Kind == kind); + var geometry = Assert.IsType(entity.Geometry); + Assert.Equal(expected.Length, geometry.Length); + for (int i = 0; i < expected.Length; i++) + { + Assert.Equal(expected[i], geometry[i], precision: 10); + } + } + [SkippableFact] public void Open_ParsesSectionMap() => CheckAll(path => { diff --git a/tests/DwgIO.Tests/TestFiles.cs b/tests/DwgIO.Tests/TestFiles.cs index 62399a9..0247e2d 100644 --- a/tests/DwgIO.Tests/TestFiles.cs +++ b/tests/DwgIO.Tests/TestFiles.cs @@ -24,6 +24,18 @@ public static IEnumerable Roots() } } + /// Resolve a committed fixture only, without accepting a private file with the same name. + public static string PublicDrawing(string fileName) + { + for (var directory = AppContext.BaseDirectory; directory != null; directory = Path.GetDirectoryName(directory)) + { + string candidate = Path.Combine(directory, "test-files", "public", fileName); + if (File.Exists(candidate)) return candidate; + } + + throw new FileNotFoundException($"Committed DWG fixture '{fileName}' is missing."); + } + /// Every *.dwg in the fixture folders (root plus one level of subfolders, so a mistyped variable cannot sweep a /// whole tree), sorted ordinally, or a when there is none. public static List DwgFiles() From fefa5d7f3fafe6e4a179342828d169aa1acaa4cc Mon Sep 17 00:00:00 2001 From: gryaznulka Date: Sun, 22 Nov 2026 17:00:35 +0100 Subject: [PATCH 5/7] Resolve required DWG fixtures from the test output --- tests/DwgIO.Tests/DwgIO.Tests.csproj | 6 ++++++ tests/DwgIO.Tests/TestFiles.cs | 19 +++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/DwgIO.Tests/DwgIO.Tests.csproj b/tests/DwgIO.Tests/DwgIO.Tests.csproj index 7c0fbb6..2335e61 100644 --- a/tests/DwgIO.Tests/DwgIO.Tests.csproj +++ b/tests/DwgIO.Tests/DwgIO.Tests.csproj @@ -17,6 +17,12 @@ + + + + diff --git a/tests/DwgIO.Tests/TestFiles.cs b/tests/DwgIO.Tests/TestFiles.cs index 0247e2d..02099a9 100644 --- a/tests/DwgIO.Tests/TestFiles.cs +++ b/tests/DwgIO.Tests/TestFiles.cs @@ -1,9 +1,7 @@ namespace DwgIO.Tests; -/// Where the tests find DWG fixtures: the folder named by the environment variable DWGIO_TEST_FILES, the committed -/// redistributable drawings of test-files/public, and a test_files folder in the repository root (or in an ancestor of the test -/// binary). Files may lie directly in a folder or in one level of subfolders. A test that needs a file which is not -/// there is reported as skipped with the reason, never passed. +/// Resolves required public DWG fixtures from the test output and finds optional inputs from +/// DWGIO_TEST_FILES and fixture folders in ancestors of the test binary. internal static class TestFiles { public const string EnvironmentVariable = "DWGIO_TEST_FILES"; @@ -24,16 +22,13 @@ public static IEnumerable Roots() } } - /// Resolve a committed fixture only, without accepting a private file with the same name. + /// Resolve the build's fixture copy, never a private file with the same name. public static string PublicDrawing(string fileName) { - for (var directory = AppContext.BaseDirectory; directory != null; directory = Path.GetDirectoryName(directory)) - { - string candidate = Path.Combine(directory, "test-files", "public", fileName); - if (File.Exists(candidate)) return candidate; - } - - throw new FileNotFoundException($"Committed DWG fixture '{fileName}' is missing."); + // Keep these copies outside the fixture roots searched by DwgFiles. + string path = Path.Combine(AppContext.BaseDirectory, "PublicFixtures", fileName); + if (File.Exists(path)) return path; + throw new FileNotFoundException($"Required public DWG fixture '{fileName}' is missing from the test output.", path); } /// Every *.dwg in the fixture folders (root plus one level of subfolders, so a mistyped variable cannot sweep a From c5e1846121f66bf9b884a2a594be7a8d92bc14ae Mon Sep 17 00:00:00 2001 From: gryaznulka Date: Sun, 22 Nov 2026 17:01:38 +0100 Subject: [PATCH 6/7] Document required public DWG fixtures --- docs/test-fixtures.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/test-fixtures.md b/docs/test-fixtures.md index aa03ac0..c91303a 100644 --- a/docs/test-fixtures.md +++ b/docs/test-fixtures.md @@ -8,8 +8,11 @@ repository. ## Where the drawings are looked for -The fixture tests find their input through one helper, `TestFiles` in the test project. Drawings are taken from all -of these folders together: +The required `PublicDrawing_DecodesAuthoredPrimitives` theory reads only the three committed drawings, copied +to a dedicated subfolder of the test output at build time. This works even when `--artifacts-path` places the +assembly outside the checkout. + +The optional fixture checks take drawings from all of these folders together: - the folder named by the environment variable `DWGIO_TEST_FILES` (ignored when the folder does not exist); - the committed redistributable drawings of [test-files/public](https://github.com/IOExtend/DwgIO/blob/main/test-files/public/README.md), with their @@ -24,10 +27,11 @@ planned release does not fail every test. ## Without drawings -When no drawing is found, the fixture tests are reported as **skipped with a reason** that names `DWGIO_TEST_FILES`. -They never pass silently and never fail for lack of a file. The attributes `[SkippableFact]` and `[SkippableTheory]` -(`SkippableFact.cs`) report a test that throws `SkipException` as skipped, because xunit 2.9 has no runtime skip of its -own; `TestFiles` throws it when no drawing is available. +Optional fixture checks are reported as **skipped with a reason** when no eligible drawing is available. +If no drawing is found, the reason names `DWGIO_TEST_FILES`. The attributes `[SkippableFact]` and +`[SkippableTheory]` (`SkippableFact.cs`) report `SkipException` as a skip, because xunit 2.9 has no runtime skip +of its own. The public geometry theory requires all three committed drawings and fails if any is missing +from the test output. No test uses a fixed absolute path. From 73148c4a86fea0efd38085082a315f75017d4393 Mon Sep 17 00:00:00 2001 From: gryaznulka Date: Sun, 22 Nov 2026 17:02:21 +0100 Subject: [PATCH 7/7] Clarify which DWG fixture checks may skip --- test-files/public/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test-files/public/README.md b/test-files/public/README.md index 6bf368e..5234741 100644 --- a/test-files/public/README.md +++ b/test-files/public/README.md @@ -71,6 +71,8 @@ see `docs/test-fixtures.md`) remains the place for larger local test sets. ## The fixture search -`TestFiles` looks for drawings in the folder named by `DWGIO_TEST_FILES`, in a `test_files` folder and in -this `test-files/public` folder; one level of subfolders is searched too. Nothing else about the search -changes: unsupported versions are skipped and counted, and a missing drawing never fails a test. +For optional fixture checks, `TestFiles` looks in `DWGIO_TEST_FILES`, ancestor `test_files` and +`test-files/public` folders, and one level of subfolders. Unsupported versions are skipped and counted; +checks with no eligible drawing are skipped. The required `PublicDrawing_DecodesAuthoredPrimitives` theory +instead reads the three committed files copied into the test output at build time. A missing copy fails +that theory even when no private drawings are configured.