/tests/unit/test_payload
/tests/unit/test_event_rule
/tests/unit/test_condition
+/tests/unit/test_action
/tests/unit/test_unix_socket
/tests/regression/ust/multi-session/gen-nevents
/tests/regression/ust/low-throughput/gen-events
TESTS = \
ini_config/test_ini_config \
+ test_action \
test_buffer_view \
test_directory_handle \
test_event_expr_to_bytecode \
# Define test programs
noinst_PROGRAMS = \
+ test_action \
test_buffer_view \
test_condition \
test_directory_handle \
# Log level rule api
test_log_level_rule_SOURCES = test_log_level_rule.c
test_log_level_rule_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
+
+# Action api
+test_action_SOURCES = test_action.c
+test_action_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
--- /dev/null
+/*
+ * test_action.c
+ *
+ * Unit tests for the notification API.
+ *
+ * Copyright (C) 2017 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ */
+
+#include <assert.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <tap/tap.h>
+
+#include <common/payload-view.h>
+#include <common/payload.h>
+#include <lttng/action/action-internal.h>
+#include <lttng/action/action.h>
+#include <lttng/action/firing-policy-internal.h>
+#include <lttng/action/firing-policy.h>
+#include <lttng/action/notify.h>
+
+/* For error.h */
+int lttng_opt_quiet = 1;
+int lttng_opt_verbose;
+int lttng_opt_mi;
+
+#define NUM_TESTS 2
+
+static void test_action_notify(void)
+{
+ struct lttng_action *notify_action = NULL;
+
+ notify_action = lttng_action_notify_create();
+ ok(notify_action, "Create notify action");
+ ok(lttng_action_get_type(notify_action) == LTTNG_ACTION_TYPE_NOTIFY,
+ "Action has type LTTNG_ACTION_TYPE_NOTIFY");
+ lttng_action_destroy(notify_action);
+}
+
+int main(int argc, const char *argv[])
+{
+ plan_tests(NUM_TESTS);
+ test_action_notify();
+ return exit_status();
+}
int lttng_opt_verbose;
int lttng_opt_mi;
-#define NUM_TESTS 182
+#define NUM_TESTS 180
static void test_condition_buffer_usage(
struct lttng_condition *buffer_usage_condition)
lttng_condition_destroy(buffer_usage_high);
}
-static void test_action(void)
-{
- struct lttng_action *notify_action = NULL;
-
- notify_action = lttng_action_notify_create();
- ok(notify_action, "Create notify action");
- ok(lttng_action_get_type(notify_action) == LTTNG_ACTION_TYPE_NOTIFY, "Action has type LTTNG_ACTION_TYPE_NOTIFY");
- lttng_action_destroy(notify_action);
-}
-
static void test_trigger(void)
{
struct lttng_action *notify_action = NULL;
plan_tests(NUM_TESTS);
test_condition_buffer_usage_low();
test_condition_buffer_usage_high();
- test_action();
test_trigger();
return exit_status();
}