Added test_utils.h header which contains a testing environment initialization function.
This commit is contained in:
@ -35,6 +35,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <test_utils.h>
|
||||||
#include <housekeeper.h>
|
#include <housekeeper.h>
|
||||||
#include <buffer.h>
|
#include <buffer.h>
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
@ -47,7 +48,7 @@ int main(int argc, char** argv)
|
|||||||
GWBUF* buf;
|
GWBUF* buf;
|
||||||
regex_t re;
|
regex_t re;
|
||||||
|
|
||||||
hkinit();
|
init_test_env();
|
||||||
home = getenv("MAXSCALE_HOME");
|
home = getenv("MAXSCALE_HOME");
|
||||||
|
|
||||||
if(home == NULL)
|
if(home == NULL)
|
||||||
|
@ -31,11 +31,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <maxscale_test.h>
|
#include <maxscale_test.h>
|
||||||
|
#include <test_utils.h>
|
||||||
#include <service.h>
|
#include <service.h>
|
||||||
#include <poll.h>
|
|
||||||
#include <dcb.h>
|
|
||||||
|
|
||||||
#include "housekeeper.h"
|
|
||||||
|
|
||||||
static bool success = false;
|
static bool success = false;
|
||||||
|
|
||||||
@ -58,17 +56,18 @@ DCB *dcb;
|
|||||||
int result;
|
int result;
|
||||||
int argc = 3;
|
int argc = 3;
|
||||||
|
|
||||||
char* argv[] =
|
init_test_env();
|
||||||
{
|
/* char* argv[] = */
|
||||||
"log_manager",
|
/* { */
|
||||||
"-j",
|
/* "log_manager", */
|
||||||
TEST_LOG_DIR,
|
/* "-j", */
|
||||||
NULL
|
/* TEST_LOG_DIR, */
|
||||||
};
|
/* NULL */
|
||||||
|
/* }; */
|
||||||
|
|
||||||
skygw_logmanager_init(argc,argv);
|
/* skygw_logmanager_init(argc,argv); */
|
||||||
poll_init();
|
/* poll_init(); */
|
||||||
hkinit();
|
/* hkinit(); */
|
||||||
|
|
||||||
/* Service tests */
|
/* Service tests */
|
||||||
ss_dfprintf(stderr,
|
ss_dfprintf(stderr,
|
||||||
|
26
server/include/test_utils.h
Normal file
26
server/include/test_utils.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#ifndef TEST_UTILS_H
|
||||||
|
#define TEST_UTILS_H
|
||||||
|
#include <poll.h>
|
||||||
|
#include <dcb.h>
|
||||||
|
#include <housekeeper.h>
|
||||||
|
#include <maxscale_test.h>
|
||||||
|
#include <log_manager.h>
|
||||||
|
|
||||||
|
void init_test_env()
|
||||||
|
{
|
||||||
|
int argc = 3;
|
||||||
|
|
||||||
|
char* argv[] =
|
||||||
|
{
|
||||||
|
"log_manager",
|
||||||
|
"-j",
|
||||||
|
TEST_LOG_DIR,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
skygw_logmanager_init(argc,argv);
|
||||||
|
poll_init();
|
||||||
|
hkinit();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Reference in New Issue
Block a user