Fix --exec interactive prompt bug and create comprehensive test suite
Major fixes: - Fixed --exec entering Python REPL instead of game loop - Resolved screenshot transparency issue (requires timer callbacks) - Added debug output to trace Python initialization Test suite created: - 13 comprehensive tests covering all Python-exposed methods - Tests use timer callback pattern for proper game loop interaction - Discovered multiple critical bugs and missing features Critical bugs found: - Grid class segfaults on instantiation (blocks all Grid functionality) - Issue #78 confirmed: Middle mouse click sends 'C' keyboard event - Entity property setters have argument parsing errors - Sprite texture setter returns improper error - keypressScene() segfaults on non-callable arguments Documentation updates: - Updated CLAUDE.md with testing guidelines and TDD practices - Created test reports documenting all findings - Updated ROADMAP.md with test results and new priorities The Grid segfault is now the highest priority as it blocks all Grid-based functionality.
This commit is contained in:
parent
9ad0b6850d
commit
18cfe93a44
36 changed files with 2386 additions and 13 deletions
|
|
@ -87,12 +87,12 @@ PyObject* PyInit_mcrfpy()
|
|||
auto t = pytypes[i];
|
||||
while (t != nullptr)
|
||||
{
|
||||
std::cout << "Registering type: " << t->tp_name << std::endl;
|
||||
//std::cout << "Registering type: " << t->tp_name << std::endl;
|
||||
if (PyType_Ready(t) < 0) {
|
||||
std::cout << "ERROR: PyType_Ready failed for " << t->tp_name << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
std::cout << " tp_alloc after PyType_Ready: " << (void*)t->tp_alloc << std::endl;
|
||||
//std::cout << " tp_alloc after PyType_Ready: " << (void*)t->tp_alloc << std::endl;
|
||||
PyModule_AddType(m, t);
|
||||
i++;
|
||||
t = pytypes[i];
|
||||
|
|
@ -316,7 +316,9 @@ void McRFPy_API::executeScript(std::string filename)
|
|||
{
|
||||
FILE* PScriptFile = fopen(filename.c_str(), "r");
|
||||
if(PScriptFile) {
|
||||
std::cout << "Before PyRun_SimpleFile" << std::endl;
|
||||
PyRun_SimpleFile(PScriptFile, filename.c_str());
|
||||
std::cout << "After PyRun_SimpleFile" << std::endl;
|
||||
fclose(PScriptFile);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue