• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <stdint.h>
17 #include "common_def.h"
18 #include "test_suite_channel.h"
19 #include "test_suite_console.h"
20 #include "test_suite_log.h"
21 #include "test_suite_task.h"
22 #include "test_suite_functions_processor.h"
23 
24 #if defined(CONFIG_TESTSUITE_IPC)
25 #include "test_suite_ipc.h"
26 #elif defined(CONFIG_TESTSUITE_UART)
27 #include "test_suite_uart.h"
28 #endif
29 #include "test_suite.h"
30 
uapi_test_suite_init(void)31 void uapi_test_suite_init(void)
32 {
33 #if defined(CONFIG_TESTSUITE_IPC)
34     test_suite_channel_init(test_suite_ipc_funcs_get());
35 #elif defined(CONFIG_TESTSUITE_UART)
36     test_suite_channel_init(test_suite_uart_funcs_get());
37 #endif
38     test_suite_console_init();
39     test_suite_log_get_channel_funcs();
40     test_suite_function_init();
41     test_suite_task_init();
42 }
43 
uapi_test_suite_deinit(void)44 void uapi_test_suite_deinit(void)
45 {
46     test_suite_console_disable();
47     test_suite_channel_deinit();
48     test_suite_function_deinit();
49     test_suite_task_destroy();
50 }
51 
uapi_test_suite_add_function(char * name,char * description,test_suite_function_callback_t func)52 errcode_t uapi_test_suite_add_function(char *name, char *description, test_suite_function_callback_t func)
53 {
54     return test_suite_function_add_func(name, description, func);
55 }
56