47 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| #pragma once
 | |
| #ifndef TEST_UTILS_H
 | |
| #define TEST_UTILS_H
 | |
| /*
 | |
|  * Copyright (c) 2016 MariaDB Corporation Ab
 | |
|  *
 | |
|  * Use of this software is governed by the Business Source License included
 | |
|  * in the LICENSE.TXT file and at www.mariadb.com/bsl11.
 | |
|  *
 | |
|  * Change Date: 2020-01-01
 | |
|  *
 | |
|  * On the date above, in accordance with the Business Source License, use
 | |
|  * of this software will be governed by version 2 or later of the General
 | |
|  * Public License.
 | |
|  */
 | |
| 
 | |
| #include <maxscale/cdefs.h>
 | |
| #include <maxscale/dcb.h>
 | |
| #include <maxscale/housekeeper.h>
 | |
| #include <maxscale/maxscale_test.h>
 | |
| #include <maxscale/log_manager.h>
 | |
| #include <maxscale/config.h>
 | |
| 
 | |
| #include "../maxscale/poll.h"
 | |
| #include "../maxscale/statistics.h"
 | |
| #include "../maxscale/worker.hh"
 | |
| 
 | |
| 
 | |
| void init_test_env(char *path)
 | |
| {
 | |
|     int argc = 3;
 | |
| 
 | |
|     const char* logdir = path ? path : TEST_LOG_DIR;
 | |
| 
 | |
|     config_get_global_options()->n_threads = 1;
 | |
| 
 | |
|     ts_stats_init();
 | |
|     mxs_log_init(NULL, logdir, MXS_LOG_TARGET_DEFAULT);
 | |
|     dcb_global_init();
 | |
|     poll_init();
 | |
|     maxscale::MessageQueue::init();
 | |
|     maxscale::Worker::init();
 | |
|     hkinit();
 | |
| }
 | |
| 
 | |
| #endif
 | 
