Skip to content

WIP: Test Suite (Use Zngur for C++ bindings)#7

Draft
JaminKoke wants to merge 26 commits intoBorgerLand:masterfrom
JaminKoke:zngur
Draft

WIP: Test Suite (Use Zngur for C++ bindings)#7
JaminKoke wants to merge 26 commits intoBorgerLand:masterfrom
JaminKoke:zngur

Conversation

@JaminKoke
Copy link
Copy Markdown
Contributor

So I found a cool looking project called Zngur, and it seems to make Rust/C++ interop a lot easier!

I'm also going to include a little "wrapper" library so that it's easier to use with the Manifold test suite with it matching the naming convention.

I also wedged in corrosion somewhere in the middle of the CMakeLists.txt. I hate CMake.

Supersedes #3

@JaminKoke
Copy link
Copy Markdown
Contributor Author

So I was able to compile the test suite!

I had to comment out a few of the tests, and almost all of them are failing, but we're getting somewhere!

I'll probably have to clean up a few things and there are other PRs that should be merged that would make it so I can clean up the commit history, but I'm happy!

@luisfonsivevo
Copy link
Copy Markdown
Member

This is an awesome project! Nice to know that not ALL the tests are failing! Is there any way to make use of git submodules so that we're not carrying a clone of the entire test suite? Trying to open the PR crashed my browser.

@JaminKoke
Copy link
Copy Markdown
Contributor Author

Just made it as a submodule, though now I have to do a weird thing where it deletes the manifold src directory so that it knows to look for the "wrapper" header files. (Maybe instead we could apply a diff to the code after it's cloned?)

@JaminKoke
Copy link
Copy Markdown
Contributor Author

New milestone for the test suite: now only 82 out of the 248 tests that are running are failing (166 passing) 😁

@JaminKoke
Copy link
Copy Markdown
Contributor Author

I have recently realized that I'm working on too much with this that is not related to getting the actual test suite "working".

Initially, I was porting more of Manifold to be able to see if this was a viable option, but now that this has 204 tests passing, I think that this is, indeed, viable. At this point I'm going to stop porting parts of Manifold that I don't use, clean this PR up, and continue splitting up features that are not related to zngur/test suite into other PRs to hopefully be easier to review.

@luisfonsivevo
Copy link
Copy Markdown
Member

204 is outstanding! It'll be a bit easier to review once the other PR's make their way in, but I'd love to get this merged soon so that meshbool can be published to crates.io in confidence. Is it just a matter of bug fixing now or is there much more to port? Honestly if there are tests failing purely due to the feature not existing yet, I don't think they ought to count in the score.

Just made it as a submodule, though now I have to do a weird thing where it deletes the manifold src directory so that it knows to look for the "wrapper" header files. (Maybe instead we could apply a diff to the code after it's cloned?)

This might be a job for GitHub actions and/or a bash script. More automated = better. I don't mind the test suite being slightly cobbled together so long as it Just Works and isn't difficult to maintain, because most people don't touch it.

@luisfonsivevo luisfonsivevo changed the title WIP: Use Zngur for C++ bindings WIP: Test Suite (Use Zngur for C++ bindings) Jan 6, 2026
@JaminKoke JaminKoke mentioned this pull request Jan 6, 2026
@JaminKoke
Copy link
Copy Markdown
Contributor Author

204 is outstanding! It'll be a bit easier to review once the other PR's make their way in, but I'd love to get this merged soon so that meshbool can be published to crates.io in confidence.

:)

Is it just a matter of bug fixing now or is there much more to port?

There are 3 out of the 44 fails are bugs with the rest being unported functions.

The specific fails
[ RUN      ] Manifold.MergeDegenerates
/home/user0/.local/src/meshbool/cpp/manifold_wrapper/test/manifold_test.cpp:855: Failure
Value of: squash.Merge()
  Actual: false
Expected: true

/home/user0/.local/src/meshbool/cpp/manifold_wrapper/test/manifold_test.cpp:858: Failure
Value of: squashed.IsEmpty()
  Actual: true
Expected: false

[  FAILED  ] Manifold.MergeDegenerates (0 ms)


[ RUN      ] Boolean.AlmostCoplanar
/home/user0/.local/src/meshbool/cpp/manifold_wrapper/test/test_main.cpp:433: Failure
Expected equality of these values:
  manifolds[i].NumVert()
    Which is: 21
  meshSize[i].numVert
    Which is: 20

/home/user0/.local/src/meshbool/cpp/manifold_wrapper/test/test_main.cpp:434: Failure
Expected equality of these values:
  manifolds[i].NumTri()
    Which is: 38
  meshSize[i].numTri
    Which is: 36

/home/user0/.local/src/meshbool/cpp/manifold_wrapper/test/test_main.cpp:436: Failure
Expected equality of these values:
  manifolds[i].NumPropVert()
    Which is: 21
  meshSize[i].numPropVert
    Which is: 20

[  FAILED  ] Boolean.AlmostCoplanar (7 ms)


[ RUN      ] Boolean.Precision
/home/user0/.local/src/meshbool/cpp/manifold_wrapper/test/test_main.cpp:426: Failure
Expected equality of these values:
  manifolds.size()
    Which is: 2
  meshSize.size()
    Which is: 1

/home/user0/.local/src/meshbool/cpp/manifold_wrapper/test/test_main.cpp:433: Failure
Expected equality of these values:
  manifolds[i].NumVert()
    Which is: 7
  meshSize[i].numVert
    Which is: 8

/home/user0/.local/src/meshbool/cpp/manifold_wrapper/test/test_main.cpp:434: Failure
Expected equality of these values:
  manifolds[i].NumTri()
    Which is: 10
  meshSize[i].numTri
    Which is: 12

/home/user0/.local/src/meshbool/cpp/manifold_wrapper/test/test_main.cpp:436: Failure
Expected equality of these values:
  manifolds[i].NumPropVert()
    Which is: 7
  meshSize[i].numPropVert
    Which is: 8

[  FAILED  ] Boolean.Precision (3 ms)

Honestly if there are tests failing purely due to the feature not existing yet, I don't think they ought to count in the score.

Probably a good idea! Do you think it we should have a hard-coded list of tests to skip, or maybe we can throw an error that the test suite recognizes as "there is something here that is not implemented"? (I haven't looked into how the testing works so I don't know what is easy to do)

Just made it as a submodule, though now I have to do a weird thing where it deletes the manifold src directory so that it knows to look for the "wrapper" header files. (Maybe instead we could apply a diff to the code after it's cloned?)

This might be a job for GitHub actions and/or a bash script. More automated = better. I don't mind the test suite being slightly cobbled together so long as it Just Works and isn't difficult to maintain, because most people don't touch it.

If you are ok with it being kinda "hacky" then it already is easy to run, the CMakeLists.txt does it for you making it so it only requires you to run mkdir build && cd build && cmake .. && make to do everything!


Also, sorry for the late reply on this one, got distracted on other things.

Also want to let you know that while I will help finish this PR because of the time and effort I put into it, I've recently been having performance issues with my game I'm working on, meaning that something like Manifold/MeshBool might be too heavy for my use case, or that what I'm trying to do is not realistic. So after this I'm going to explore other things to see if I can go about what I want to do without a CSG library.

I will also upload some other work in progress ports that I didn't finish that maybe you could work off of to continue porting.

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.

2 participants