1 /*
2  * Copyright (c) 2024 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/kernel.h>
8 
9 #include "bs_tracing.h"
10 #include "bstests.h"
11 #include "babblekit/testcase.h"
12 
13 extern void entrypoint_dut(void);
14 extern void entrypoint_central(void);
15 extern enum bst_result_t bst_result;
16 
test_end_cb(void)17 static void test_end_cb(void)
18 {
19 	/* This callback will fire right before the executable returns */
20 	if (bst_result != Passed) {
21 		TEST_PRINT("Test has not passed.");
22 	}
23 }
24 
25 static const struct bst_test_instance entrypoints[] = {
26 	{
27 		.test_id = "dut",
28 		.test_delete_f = test_end_cb,
29 		.test_main_f = entrypoint_dut,
30 	},
31 	{
32 		.test_id = "central",
33 		.test_delete_f = test_end_cb,
34 		.test_main_f = entrypoint_central,
35 	},
36 	BSTEST_END_MARKER,
37 };
38 
install(struct bst_test_list * tests)39 static struct bst_test_list *install(struct bst_test_list *tests)
40 {
41 	return bst_add_tests(tests, entrypoints);
42 };
43 
44 bst_test_install_t test_installers[] = {install, NULL};
45 
main(void)46 int main(void)
47 {
48 	bst_main();
49 
50 	return 0;
51 }
52