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