| import inspect | |
| import logging | |
| import os | |
| from pyhttpd.env import HttpdTestEnv, HttpdTestSetup | |
| log = logging.getLogger(__name__) | |
| class LuaTestSetup(HttpdTestSetup): | |
| def __init__(self, env: 'HttpdTestEnv'): | |
| super().__init__(env=env) | |
| self.add_source_dir(os.path.dirname(inspect.getfile(LuaTestSetup))) | |
| # mod_lua needs liblua, so it may not have been built; the tests | |
| # skip when it is absent. | |
| self.add_optional_modules(["lua"]) | |
| class LuaTestEnv(HttpdTestEnv): | |
| def __init__(self, pytestconfig=None): | |
| super().__init__(pytestconfig=pytestconfig) | |
| self.add_httpd_log_modules(["lua"]) | |
| def setup_httpd(self, setup: HttpdTestSetup = None): | |
| super().setup_httpd(setup=LuaTestSetup(env=self)) |