| 950 | } |
| 951 | |
| 952 | static void add_luacov_coroutine_wrapper(lua_State *L) |
| 953 | { |
| 954 | color_ostream *out = Lua::GetOutput(L); |
| 955 | if (!Lua::PushModulePublic(*out, L, "luacov_helper", "with_luacov")) |
| 956 | { |
| 957 | out->printerr("Failed to load luacov_helper.with_luacov.\n"); |
| 958 | return; |
| 959 | } |
| 960 | lua_swap(L); |
| 961 | if (!Lua::SafeCall(*out, L, 1, 1)) |
| 962 | out->printerr("Failed to set luacov monitoring wrapper.\n"); |
| 963 | } |
| 964 | |
| 965 | lua_State *DFHack::Lua::NewCoroutine(lua_State *L) { |
| 966 | if (Lua::IsCoreContext(L) && getenv("DFHACK_ENABLE_LUACOV")) |
no test coverage detected