Make the console test build and pass again - #26
Conversation
Building with OD_BUILD_TESTING=ON has been broken for a while: the console interface test no longer compiled, and once it compiled it did not link, and once it linked it crashed. One layer at a time: addCommand() lost its description parameter at some point, with the form that takes one renamed to addCommandAux(), and the test still called the old one. ConsoleInterface.cpp includes pybind11/embed.h without using anything from it. The include drags Python symbols into the object file, which the game only carries because it links pybind11::embed; the test target does not, and has no reason to. The include goes away, which unbreaks the link and drops a spurious dependency. Executing a command no longer records it in the history: the history belongs to whoever owns the prompt, and the game console, which now runs its commands through Python, records what was typed itself. The test still assumed recording was implicit, so its history was empty and it dereferenced the boost::none that scrolling an empty history correctly returns. It now records each command the way the game does, and the scrolling expectations hold as written: nine commands in, the prompt round trip, nine commands back out. The whole suite passes, each test against its own server the way run_unit_tests.sh starts them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 10ccb9f)
|
That's fine , any ideas on fixing the other tests ? For that example , the tests, which requires client connecting to server : /============================================================================/ *** 5 failures are detected in the test module "TestLaunchGame" |
|
The The repo already has the harness for this: I've also opened #31 which wires that server start/stop into CTest itself, so a plain |
Building with
OD_BUILD_TESTING=ONhas been broken on the base branch for a while: the console interface test no longer compiled, then did not link, then crashed. This fixes all three layers so the test builds and passes again. One commit.Split out of #16 so each topic can be reviewed on its own. Merging all of the split PRs reproduces the tree of #16 exactly.
🤖 Generated with Claude Code