/*
- * test_bin_info.c
+ * SPDX-License-Identifier: GPL-2.0-only
*
- * Babeltrace SO info tests
- *
- * Copyright (c) 2015 EfficiOS Inc. and Linux Foundation
- * Copyright (c) 2015 Antoine Busque <abusque@efficios.com>
- * Copyright (c) 2019 Michael Jeanson <mjeanson@efficios.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; under version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * Copyright (C) 2015 EfficiOS Inc. and Linux Foundation
+ * Copyright (C) 2015 Antoine Busque <abusque@efficios.com>
+ * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * Babeltrace SO info tests
*/
#define BT_LOG_OUTPUT_LEVEL BT_LOG_WARNING
int ret;
GError *error = NULL;
GOptionContext *context;
+ int status;
+
+ plan_tests(NR_TESTS);
context = g_option_context_new("- bin info test");
g_option_context_add_main_entries(context, entries, NULL);
if (!g_option_context_parse(context, &argc, &argv, &error)) {
fprintf(stderr, "option parsing failed: %s\n", error->message);
- exit(EXIT_FAILURE);
+ status = EXIT_FAILURE;
+ goto end;
}
g_snprintf(func_foo_printf_name, FUNC_FOO_NAME_LEN,
if (build_id_to_bin()) {
fprintf(stderr, "Failed to parse / missing build id\n");
- exit(EXIT_FAILURE);
+ status = EXIT_FAILURE;
+ goto end;
}
- plan_tests(NR_TESTS);
-
ret = bin_info_init(BT_LOG_OUTPUT_LEVEL, NULL);
ok(ret == 0, "bin_info_init successful");
test_bin_info_build_id(opt_debug_info_dir);
test_bin_info_debug_link(opt_debug_info_dir);
- return EXIT_SUCCESS;
+ status = exit_status();
+
+end:
+ g_option_context_free(context);
+
+ return status;
}