Skip to content

Add unit tests for the delivery/IO modules - #57

Open
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
devin/1787187182-io-export-unit-tests
Open

Add unit tests for the delivery/IO modules#57
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
devin/1787187182-io-export-unit-tests

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

weft_core's delivery layer was effectively untested: the only test binaries exercised meshing (weft_tests) and the signature CLI, so per-file gcov on core/ showed the exporters and the IO registry at or near zero:

  0.0%   0/272   core/src/export_gltf.cpp
  0.0%   0/196   core/src/export_fbx.cpp
  0.0%   0/23    core/src/io/iges_reader.cpp
  0.0%   0/11    core/src/io/brep_reader.cpp
 13.3%   2/15    core/src/mesher_trace.cpp
 20.0%   8/40    core/src/io/format.cpp
 23.0%  35/152   core/src/io/mesh_writers.cpp
 29.4%  32/109   core/src/io/occ_writers.cpp
 30.6%  11/36    core/src/io/params.cpp
 34.1%  15/44    core/src/io/probes.cpp
 59.1%  13/22    core/src/io/occ_rollback.cpp

This adds tests/test_io_export.cpp (new weft_io_tests binary, ctest name io_export), covering the format table, param groups, content/extension probes, the writer/reader registry and its pairing rules, glTF/FBX/STL/OBJ/PLY writers, STEP/IGES/BREP round trips, tessellate-and-convert, viewport edge sampling, and the generation debug log. The same measurement after the new suite:

 99.6% export_gltf   100% export_fbx   100% iges_reader(95.7%)  100% brep_reader
 97.4% mesh_writers  93.6% occ_writers  100% params  100% probes  100% format
 100% occ_rollback   100% mesher_trace  97.9% io/system  96.0% viz

Assertions check binary structure rather than golden blobs — e.g. the .glb container header/chunk lengths are validated, accessor counts are tied to the mesh (positions == normals == faceIds, indices == 3 * triangles), the POSITION block's bounds must equal the mesh bounds, normals must be unit length, and _WEFT_FACE_ID values must fall in the model's face-id range. Body naming is asserted against model.solidNames (imported STEP names) with the sanitize/fallback path (object_<solidId>) covered separately.

Fixtures come from makeFixturewriteSteploadStepgenerate, so no new test assets are committed; files are written under TMPDIR. Nothing in core/ changed.

Remaining lowest-coverage modules after this change are core/src/fixture.cpp (71.5%) and core/src/edit.cpp (74.3%), both untouched here.

Link to Devin session: https://app.devin.ai/sessions/02f8dd75cefa4be5848e082b0bc1d368
Requested by: @jmossymoss

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@jmossymoss jmossymoss self-assigned this Aug 20, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

jmossymoss and others added 3 commits August 20, 2026 00:55
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant