Added test_utils.h header which contains a testing environment initialization function.

This commit is contained in:
Markus Makela 2015-03-10 15:16:52 +02:00
parent e1a522051a
commit e937947f01
3 changed files with 40 additions and 14 deletions

View File

@ -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)

View File

@ -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,

View 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