Move test_utils.h to server/core/test
This commit is contained in:
36
server/core/test/test_utils.h
Normal file
36
server/core/test/test_utils.h
Normal file
@ -0,0 +1,36 @@
|
||||
#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/bsl.
|
||||
*
|
||||
* Change Date: 2019-07-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/poll.h>
|
||||
#include <maxscale/dcb.h>
|
||||
#include <maxscale/housekeeper.h>
|
||||
#include <maxscale/maxscale_test.h>
|
||||
#include <maxscale/log_manager.h>
|
||||
#include <maxscale/statistics.h>
|
||||
|
||||
void init_test_env(char *path)
|
||||
{
|
||||
int argc = 3;
|
||||
|
||||
const char* logdir = path ? path : TEST_LOG_DIR;
|
||||
|
||||
ts_stats_init();
|
||||
mxs_log_init(NULL, logdir, MXS_LOG_TARGET_DEFAULT);
|
||||
poll_init();
|
||||
hkinit();
|
||||
}
|
||||
|
||||
#endif
|
@ -35,8 +35,8 @@
|
||||
#include <errno.h>
|
||||
#include <maxscale/poll.h>
|
||||
#include <maxscale/dcb.h>
|
||||
#include <maxscale/test_utils.h>
|
||||
#include <maxscale/listener.h>
|
||||
#include "test_utils.h"
|
||||
|
||||
/**
|
||||
* test1 Allocate a service and do lots of other things
|
||||
|
@ -39,9 +39,9 @@ extern int debug_check_fail;
|
||||
#include <errno.h>
|
||||
#include <maxscale/queuemanager.h>
|
||||
#include <maxscale/random_jkiss.h>
|
||||
#include <maxscale/test_utils.h>
|
||||
#include <maxscale/hk_heartbeat.h>
|
||||
#include <maxscale/alloc.h>
|
||||
#include "test_utils.h"
|
||||
|
||||
/**
|
||||
* test1 Allocate a queue and do lots of other things
|
||||
|
@ -33,10 +33,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <maxscale/maxscale_test.h>
|
||||
#include <maxscale/test_utils.h>
|
||||
#include <maxscale/service.h>
|
||||
#include <maxscale/gwdirs.h>
|
||||
#include <maxscale/alloc.h>
|
||||
#include "test_utils.h"
|
||||
|
||||
/**
|
||||
* test1 Allocate a service and do lots of other things
|
||||
|
@ -2330,7 +2330,8 @@ diagnostic(FILTER *instance, void *fsession, DCB *dcb)
|
||||
}
|
||||
|
||||
#ifdef BUILD_RULE_PARSER
|
||||
#include <test_utils.h>
|
||||
// TODO: Not ok to include file from other component's test directory.
|
||||
#include "../../../core/test/test_utils.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
Reference in New Issue
Block a user