* \note The description must not end with a newline.
*/
const char *description;
+ /*!
+ * \brief Only run if explicitly named
+ *
+ * \details
+ * Run this test only if it's explicitly named on the command line.
+ * Do NOT run it as part of an execute category or execute all command.
+ */
+ unsigned int explicit_only;
};
#ifdef TEST_FRAMEWORK
execute = 0;
switch (mode) {
case TEST_CATEGORY:
- if (!test_cat_cmp(test->info.category, category)) {
+ if (!test_cat_cmp(test->info.category, category) && !test->info.explicit_only) {
execute = 1;
}
break;
}
break;
case TEST_ALL:
- execute = 1;
+ execute = !test->info.explicit_only;
}
if (execute) {
return res;
}
+AST_TEST_DEFINE(segv)
+{
+ switch (cmd) {
+ case TEST_INIT:
+ info->name = "RAISE_SEGV";
+ info->category = "/DO_NOT_RUN/";
+ info->summary = "RAISES SEGV!!! (will only be run if explicitly called)";
+ info->description = "RAISES SEGV!!! (will only be run if explicitly called). "
+ "This test is mainly used for testing CI and tool failure scenarios.";
+ info->explicit_only = 1;
+ return AST_TEST_NOT_RUN;
+ case TEST_EXECUTE:
+ break;
+ }
+
+ raise(SIGSEGV);
+
+ return AST_TEST_FAIL;
+}
+
static int unload_module(void)
{
+ AST_TEST_UNREGISTER(segv);
AST_TEST_UNREGISTER(pattern_match_test);
return 0;
}
static int load_module(void)
{
AST_TEST_REGISTER(pattern_match_test);
+ AST_TEST_REGISTER(segv);
return AST_MODULE_LOAD_SUCCESS;
}