static void timeout_set(MuLoader* self, int timeout) { mu_sh_timeout = timeout; } static int timeout_get(MuLoader* self) { return mu_sh_timeout; } static MuOption cloader_options[] = { MU_OPTION("helper", MU_TYPE_STRING, helper_get, helper_set, "Path to the helper function script"), MU_OPTION("timeout", MU_TYPE_INTEGER, timeout_get, timeout_set, "Default time in milliseconds before tests time out"), MU_OPTION_END }; static MuLoader shloader = { .plugin = NULL, .can_open = sh_can_open, .open = sh_open, .get_tests = sh_get_tests, .free_tests = sh_free_tests, .close = sh_close, .library_name = sh_library_name, .test_name = sh_test_name,
} static void debug_set(MuLoader* self, bool set) { is_debug = set; } static bool debug_get(MuLoader* self) { return is_debug; } MuOption cloader_options[] = { MU_OPTION("timeout", MU_TYPE_INTEGER, timeout_get, timeout_set, "Time in milliseconds before tests automatically " "fail and are forcefully terminated"), MU_OPTION("iterations", MU_TYPE_INTEGER, iterations_get, iterations_set, "The number of times each test is run (unless specified by the test)"), MU_OPTION("debug", MU_TYPE_BOOLEAN, debug_get, debug_set, "Whether to run in debug mode (avoid forking)"), MU_OPTION_END };
static void destroy(MuLogger* _logger) { JsonLogger* logger = (JsonLogger*) _logger; if (logger->out) fclose(logger->out); if (logger->file) free(logger->file); free(logger); } static MuOption jsonlogger_options[] = { MU_OPTION("fd", MU_TYPE_INTEGER, get_fd, set_fd, "File descriptor to which results will be written"), MU_OPTION("file", MU_TYPE_STRING, get_file, set_file, "File to which results will be written"), MU_OPTION("title", MU_TYPE_STRING, get_title, set_title, "Title of the test results"), MU_OPTION("loglevel", MU_TYPE_STRING, get_loglevel, set_loglevel, "Maximum level of logged events which will be recorded"), MU_OPTION("pretty", MU_TYPE_BOOLEAN, get_pretty, set_pretty, "Output prettified JSON"), MU_OPTION_END }; static JsonLogger jsonlogger = { .base = {
{ XmlLogger* logger = (XmlLogger*) _logger; if (logger->out) fclose(logger->out); if (logger->name) free(logger->name); if (logger->file) free(logger->file); free(logger); } static MuOption xmllogger_options[] = { MU_OPTION("fd", MU_TYPE_INTEGER, get_fd, set_fd, "File descriptor to which results will be written"), MU_OPTION("file", MU_TYPE_STRING, get_file, set_file, "File to which results will be written"), MU_OPTION("name", MU_TYPE_STRING, get_name, set_name, "Value of the name attribute on the <run> node"), MU_OPTION("title", MU_TYPE_STRING, get_title, set_title, "Value of the title attribute on the <moonunit> node"), MU_OPTION_END }; static XmlLogger xmllogger = { .base = { .enter = enter, .leave = leave,