This test willingly makes libbabeltrace2 abort, therefore
`BABELTRACE_EXEC_ON_ABORT` gets executed each time, and we don't want
that in the testing context.
condMain() is the closest to where the abort occurs: this means you may
run `tests/lib/conds/conds-triggers` directly and
`BABELTRACE_EXEC_ON_ABORT` won't impact the program.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I72f21cfcbe2ec8b1f48ec0703c42b3b1d710283c
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11818
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
* Copyright (C) 2020 Philippe Proulx <pproulx@efficios.com>
*/
+#include <glib.h>
#include <stdlib.h>
#include <string.h>
if (strcmp(argv[1], "list") == 0) {
listCondTriggers(condTriggers);
} else if (strcmp(argv[1], "run") == 0) {
+ /*
+ * It's expected that calling `*condTriggers[index]` below
+ * aborts (calls bt_common_abort()). In this testing context, we
+ * don't want any custom abortion command to run.
+ */
+ g_unsetenv("BABELTRACE_EXEC_ON_ABORT");
+
+ /* Call the trigger */
BT_ASSERT(argc >= 3);
const auto index = atoi(argv[2]);