projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: tap.h conflicts with Clang C++ headers
[lttng-tools.git]
/
tests
/
unit
/
test_event_rule.cpp
diff --git
a/tests/unit/test_event_rule.cpp
b/tests/unit/test_event_rule.cpp
index 0fc9ec7702a44724339e5a530d19af5f71de52ae..c3fd01a81837011293444addf13b61f62b3581e3 100644
(file)
--- a/
tests/unit/test_event_rule.cpp
+++ b/
tests/unit/test_event_rule.cpp
@@
-12,43
+12,51
@@
#include <string.h>
#include <unistd.h>
#include <string.h>
#include <unistd.h>
-#include <tap/tap.h>
-
-#include <common/payload-view.h>
-#include <common/payload.h>
+#include <common/payload-view.hpp>
+#include <common/payload.hpp>
#include <lttng/domain.h>
#include <lttng/domain.h>
-#include <lttng/event-rule/jul-logging-internal.h>
+#include <lttng/event-rule/jul-logging-internal.h
pp
>
#include <lttng/event-rule/jul-logging.h>
#include <lttng/event-rule/jul-logging.h>
-#include <lttng/event-rule/kernel-kprobe-internal.h>
+#include <lttng/event-rule/kernel-kprobe-internal.h
pp
>
#include <lttng/event-rule/kernel-kprobe.h>
#include <lttng/event-rule/kernel-kprobe.h>
-#include <lttng/event-rule/kernel-syscall-internal.h>
+#include <lttng/event-rule/kernel-syscall-internal.h
pp
>
#include <lttng/event-rule/kernel-syscall.h>
#include <lttng/event-rule/kernel-syscall.h>
-#include <lttng/event-rule/python-logging-internal.h>
+#include <lttng/event-rule/python-logging-internal.h
pp
>
#include <lttng/event-rule/python-logging.h>
#include <lttng/event-rule/python-logging.h>
-#include <lttng/event-rule/kernel-tracepoint-internal.h>
+#include <lttng/event-rule/kernel-tracepoint-internal.h
pp
>
#include <lttng/event-rule/kernel-tracepoint.h>
#include <lttng/event-rule/kernel-tracepoint.h>
-#include <lttng/event-rule/kernel-uprobe-internal.h>
+#include <lttng/event-rule/kernel-uprobe-internal.h
pp
>
#include <lttng/event-rule/kernel-uprobe.h>
#include <lttng/event-rule/kernel-uprobe.h>
-#include <lttng/event-rule/user-tracepoint-internal.h>
+#include <lttng/event-rule/user-tracepoint-internal.h
pp
>
#include <lttng/event-rule/user-tracepoint.h>
#include <lttng/event.h>
#include <lttng/event-rule/user-tracepoint.h>
#include <lttng/event.h>
-#include <lttng/kernel-probe-internal.h>
+#include <lttng/kernel-probe-internal.h
pp
>
#include <lttng/kernel-probe.h>
#include <lttng/kernel-probe.h>
-#include <lttng/userspace-probe-internal.h>
+#include <lttng/userspace-probe-internal.h
pp
>
#include <lttng/userspace-probe.h>
#include <lttng/userspace-probe.h>
-#include "bin/lttng/loglevel.h"
+#include "bin/lttng/loglevel.hpp"
+
+#include <tap/tap.h>
/* For error.h. */
int lttng_opt_quiet = 1;
int lttng_opt_verbose;
int lttng_opt_mi;
/* For error.h. */
int lttng_opt_quiet = 1;
int lttng_opt_verbose;
int lttng_opt_mi;
-#define NUM_TESTS 212
+#ifdef __linux__
+#define UPROBE_NUM_TESTS 9
+#else /* __linux__ */
+#define UPROBE_NUM_TESTS 0
+#endif /* __linux__ */
+
+#define NUM_TESTS (203 + UPROBE_NUM_TESTS)
+namespace {
struct tracepoint_test {
enum lttng_domain_type type;
bool support_name_pattern_exclusion;
};
struct tracepoint_test {
enum lttng_domain_type type;
bool support_name_pattern_exclusion;
};
+} /* namespace */
typedef const char *(*log_level_name_getter)(int log_level);
typedef const char *(*log_level_name_getter)(int log_level);
@@
-444,6
+452,7
@@
void test_event_rule_python_logging(void)
lttng_log_level_rule_destroy(log_level_rule);
}
lttng_log_level_rule_destroy(log_level_rule);
}
+#ifdef __linux__
static void test_event_rule_userspace_probe(void)
{
struct lttng_event_rule *uprobe = NULL;
static void test_event_rule_userspace_probe(void)
{
struct lttng_event_rule *uprobe = NULL;
@@
-459,6
+468,7
@@
static void test_event_rule_userspace_probe(void)
struct lttng_payload payload;
diag("Event rule uprobe.");
struct lttng_payload payload;
diag("Event rule uprobe.");
+ lttng_payload_init(&payload);
lookup_method = lttng_userspace_probe_location_lookup_method_function_elf_create();
if (!lookup_method) {
lookup_method = lttng_userspace_probe_location_lookup_method_function_elf_create();
if (!lookup_method) {
@@
-520,6
+530,9
@@
end:
lttng_userspace_probe_location_destroy(probe_location);
lttng_userspace_probe_location_lookup_method_destroy(lookup_method);
}
lttng_userspace_probe_location_destroy(probe_location);
lttng_userspace_probe_location_lookup_method_destroy(lookup_method);
}
+#else
+static void test_event_rule_userspace_probe(void) {}
+#endif
static void test_event_rule_kernel_probe_by_location(
const struct lttng_kernel_probe_location *location)
static void test_event_rule_kernel_probe_by_location(
const struct lttng_kernel_probe_location *location)
@@
-811,7
+824,7
@@
static void test_event_rule_log_level_python(void)
NULL, 0);
}
NULL, 0);
}
-int main(
int argc, const char *argv[]
)
+int main(
void
)
{
plan_tests(NUM_TESTS);
test_event_rule_kernel_tracepoint();
{
plan_tests(NUM_TESTS);
test_event_rule_kernel_tracepoint();
This page took
0.025607 seconds
and
4
git commands to generate.