diff options
author | George Joseph <gjoseph@digium.com> | 2017-05-24 14:50:56 -0600 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2017-05-24 14:56:14 -0600 |
commit | 65898c3af82e2d780a48d9d50d3b1c952c208a89 (patch) | |
tree | 92235fde577cdf951a62489c06ec6947e957f0cf /main/test.c | |
parent | 1bddf1efc342a44f08e2f2d40f70f070b4ac542e (diff) |
unittests: Add a unit test that causes a SEGV and...
...that can only be run by explicitly calling it with
'test execute category /DO_NOT_RUN/ name RAISE_SEGV'
This allows us to more easily test CI and debugging tools that
should do certain things when asterisk coredumps.
To allow this a new member was added to the ast_test_info
structure named 'explicit_only'. If set by a test, the test
will be skipped during a 'test execute all' or
'test execute category ...'.
Change-Id: Ia3a11856aae4887df9a02b6b081cc777b36eb6ed
Diffstat (limited to 'main/test.c')
-rw-r--r-- | main/test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/test.c b/main/test.c index e9b56ebd8..d22f2ebea 100644 --- a/main/test.c +++ b/main/test.c @@ -346,7 +346,7 @@ static int test_execute_multiple(const char *name, const char *category, struct 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; @@ -356,7 +356,7 @@ static int test_execute_multiple(const char *name, const char *category, struct } break; case TEST_ALL: - execute = 1; + execute = !test->info.explicit_only; } if (execute) { |