]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add test suite events to indicate when a feature is detected or not
authorJohn Bigelow <jbigelow@digium.com>
Wed, 30 Oct 2013 21:01:50 +0000 (21:01 +0000)
committerJohn Bigelow <jbigelow@digium.com>
Wed, 30 Oct 2013 21:01:50 +0000 (21:01 +0000)
These are needed by the bridge test suite tests for them to be able to run
against Asterisk 11.

Review: https://reviewboard.asterisk.org/r/2751/
........

Merged revisions 396884 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@402274 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/features.c

index e3792a01bcfd9c1753cb210cb6f8235424165e70..b91ad862ec7a86fea670eeff0f1e75b1e7f02352 100644 (file)
@@ -3607,6 +3607,10 @@ static int feature_interpret_helper(struct ast_channel *chan, struct ast_channel
                                res = AST_FEATURE_RETURN_SUCCESS; /* We found something */
                        } else if (operation == FEATURE_INTERPRET_DO) {
                                res = builtin_features[x].operation(chan, peer, config, code, sense, NULL);
+                               ast_test_suite_event_notify("FEATURE_DETECTION",
+                                               "Result: success\r\n"
+                                               "Feature: %s",
+                                               builtin_features[x].sname);
                        }
                        if (feature) {
                                memcpy(feature, &builtin_features[x], sizeof(*feature));
@@ -3619,6 +3623,12 @@ static int feature_interpret_helper(struct ast_channel *chan, struct ast_channel
                        }
                }
        }
+
+       if (operation == FEATURE_INTERPRET_CHECK && x == FEATURES_COUNT) {
+               ast_test_suite_event_notify("FEATURE_DETECTION",
+                               "Result: fail");
+       }
+
        ast_rwlock_unlock(&features_lock);
 
        if (ast_strlen_zero(dynamic_features_buf) || feature_detected) {