Drives the full Lua-side suite via test_graphics.lua's `functions.test_graphics`. The Lua side asserts on shape/types and on the "no graphics context" baseline that the script test harness produces (no HContext is wired into dmScript here).
| 26 | // The Lua side asserts on shape/types and on the "no graphics context" baseline |
| 27 | // that the script test harness produces (no HContext is wired into dmScript here). |
| 28 | TEST_F(ScriptGraphicsTest, TestGraphics) |
| 29 | { |
| 30 | int top = lua_gettop(L); |
| 31 | |
| 32 | ASSERT_TRUE(RunFile(L, "test_graphics.luac")); |
| 33 | |
| 34 | lua_getglobal(L, "functions"); |
| 35 | ASSERT_EQ(LUA_TTABLE, lua_type(L, -1)); |
| 36 | lua_getfield(L, -1, "test_graphics"); |
| 37 | ASSERT_EQ(LUA_TFUNCTION, lua_type(L, -1)); |
| 38 | int result = dmScript::PCall(L, 0, LUA_MULTRET); |
| 39 | if (result == LUA_ERRRUN) |
| 40 | { |
| 41 | ASSERT_TRUE(false); |
| 42 | } |
| 43 | else |
| 44 | { |
| 45 | ASSERT_EQ(0, result); |
| 46 | } |
| 47 | lua_pop(L, 1); |
| 48 | |
| 49 | ASSERT_EQ(top, lua_gettop(L)); |
| 50 | } |
| 51 | |
| 52 | // Spot-check from C++ side: graphics.get_engine_adapters must include "null" |
| 53 | // when the test binary links GRAPHICS_NULL. This guards against the Lua |
nothing calls this directly
no test coverage detected