1 /*
2  * Copyright (c) 2021 Nordic Semiconductor
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include "bstests.h"
8 #include "mesh_test.h"
9 
10 #if defined(CONFIG_SETTINGS)
11 extern struct bst_test_list *test_persistence_install(struct bst_test_list *tests);
12 extern struct bst_test_list *test_rpc_install(struct bst_test_list *tests);
13 extern struct bst_test_list *test_provision_pst_install(struct bst_test_list *tests);
14 extern struct bst_test_list *test_dfu_install(struct bst_test_list *test);
15 extern struct bst_test_list *test_blob_pst_install(struct bst_test_list *test);
16 extern struct bst_test_list *test_lcd_install(struct bst_test_list *test);
17 extern struct bst_test_list *test_sar_pst_install(struct bst_test_list *test);
18 extern struct bst_test_list *test_brg_install(struct bst_test_list *test);
19 #if (CONFIG_BT_MESH_GATT_PROXY && CONFIG_BT_MESH_PROXY_SOLICITATION)
20 extern struct bst_test_list *test_proxy_sol_install(struct bst_test_list *test);
21 #endif
22 #elif defined(CONFIG_BT_MESH_GATT_PROXY)
23 extern struct bst_test_list *test_adv_install(struct bst_test_list *test);
24 extern struct bst_test_list *test_suspend_install(struct bst_test_list *test);
25 extern struct bst_test_list *test_beacon_install(struct bst_test_list *tests);
26 #elif defined(CONFIG_BT_CTLR_LOW_LAT)
27 extern struct bst_test_list *test_transport_install(struct bst_test_list *tests);
28 extern struct bst_test_list *test_friendship_install(struct bst_test_list *tests);
29 extern struct bst_test_list *test_suspend_install(struct bst_test_list *test);
30 extern struct bst_test_list *test_adv_install(struct bst_test_list *test);
31 #else
32 extern struct bst_test_list *test_transport_install(struct bst_test_list *tests);
33 extern struct bst_test_list *test_friendship_install(struct bst_test_list *tests);
34 extern struct bst_test_list *test_provision_install(struct bst_test_list *tests);
35 extern struct bst_test_list *test_beacon_install(struct bst_test_list *tests);
36 extern struct bst_test_list *test_scanner_install(struct bst_test_list *test);
37 extern struct bst_test_list *test_heartbeat_install(struct bst_test_list *test);
38 extern struct bst_test_list *test_access_install(struct bst_test_list *test);
39 extern struct bst_test_list *test_ivi_install(struct bst_test_list *test);
40 extern struct bst_test_list *test_adv_install(struct bst_test_list *test);
41 extern struct bst_test_list *test_suspend_install(struct bst_test_list *test);
42 extern struct bst_test_list *test_blob_install(struct bst_test_list *test);
43 extern struct bst_test_list *test_op_agg_install(struct bst_test_list *test);
44 extern struct bst_test_list *test_sar_install(struct bst_test_list *test);
45 extern struct bst_test_list *test_cdp1_install(struct bst_test_list *test);
46 extern struct bst_test_list *test_brg_install(struct bst_test_list *test);
47 #endif
48 
49 bst_test_install_t test_installers[] = {
50 #if defined(CONFIG_SETTINGS)
51 	test_persistence_install,
52 	test_rpc_install,
53 	test_provision_pst_install,
54 	test_dfu_install,
55 	test_blob_pst_install,
56 	test_lcd_install,
57 	test_sar_pst_install,
58 	test_brg_install,
59 #if (CONFIG_BT_MESH_GATT_PROXY && CONFIG_BT_MESH_PROXY_SOLICITATION)
60 	test_proxy_sol_install,
61 #endif
62 #elif defined(CONFIG_BT_MESH_GATT_PROXY)
63 	test_adv_install, test_suspend_install, test_beacon_install,
64 #elif defined(CONFIG_BT_CTLR_LOW_LAT)
65 	test_transport_install, test_friendship_install, test_suspend_install, test_adv_install,
66 #else
67 	test_transport_install,
68 	test_friendship_install,
69 	test_provision_install,
70 	test_beacon_install,
71 	test_scanner_install,
72 	test_heartbeat_install,
73 	test_access_install,
74 	test_ivi_install,
75 	test_adv_install,
76 	test_suspend_install,
77 	test_blob_install,
78 	test_op_agg_install,
79 	test_sar_install,
80 	test_cdp1_install,
81 	test_brg_install,
82 #endif
83 	NULL};
84 
85 static struct k_thread bsim_mesh_thread;
86 static K_KERNEL_STACK_DEFINE(bsim_mesh_thread_stack, 4096);
87 
bsim_mesh_entry_point(void * unused1,void * unused2,void * unused3)88 static void bsim_mesh_entry_point(void *unused1, void *unused2, void *unused3)
89 {
90 	bst_main();
91 }
92 
main(void)93 int main(void)
94 {
95 	k_thread_create(&bsim_mesh_thread, bsim_mesh_thread_stack,
96 			K_KERNEL_STACK_SIZEOF(bsim_mesh_thread_stack), bsim_mesh_entry_point, NULL,
97 			NULL, NULL, K_PRIO_COOP(1), 0, K_NO_WAIT);
98 	k_thread_name_set(&bsim_mesh_thread, "BabbleSim BLE Mesh tests");
99 
100 	return 0;
101 }
102