test: Makes the unit tests to work again

The unit tests was not working due to lack update. This patch adds
the necessary stuff to have it work again.
This commit is contained in:
Felipe Zimmerle 2013-12-04 18:15:20 -08:00
parent ad330a44bf
commit cc982ae42e
2 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,7 @@
check_PROGRAMS = msc_test
msc_test_SOURCES = msc_test.c \
$(top_srcdir)/standalone/server.c \
$(top_srcdir)/standalone/regex.c \
$(top_srcdir)/apache2/re.c \
$(top_srcdir)/apache2/re_operators.c \
$(top_srcdir)/apache2/re_actions.c \
@ -16,6 +18,7 @@ msc_test_SOURCES = msc_test.c \
$(top_srcdir)/apache2/persist_dbm.c \
$(top_srcdir)/apache2/msc_reqbody.c \
$(top_srcdir)/apache2/msc_crypt.c \
$(top_srcdir)/apache2/msc_json.c \
$(top_srcdir)/apache2/msc_tree.c \
$(top_srcdir)/apache2/msc_geo.c \
$(top_srcdir)/apache2/msc_gsb.c \
@ -24,14 +27,17 @@ msc_test_SOURCES = msc_test.c \
$(top_srcdir)/apache2/msc_release.c \
$(top_srcdir)/apache2/libinjection/libinjection_sqli.c
msc_test_CFLAGS = @APXS_CFLAGS@ @APR_CFLAGS@ @APU_CFLAGS@ \
@PCRE_CFLAGS@ @LIBXML2_CFLAGS@ @MODSEC_EXTRA_CFLAGS@ @LUA_CFLAGS@
@PCRE_CFLAGS@ @LIBXML2_CFLAGS@ @MODSEC_EXTRA_CFLAGS@ @LUA_CFLAGS@ \
@YAJL_CFLAGS@
msc_test_CPPFLAGS = -I$(top_srcdir)/apache2 \
@APR_CPPFLAGS@ @LIBXML2_CPPFLAGS@ \
@PCRE_CPPFLAGS@
msc_test_LDADD = @APR_LDADD@ @APU_LDADD@ \
@PCRE_LDADD@ @LIBXML2_LDADD@ @LUA_LDADD@
@PCRE_LDADD@ @LIBXML2_LDADD@ @LUA_LDADD@ \
@YAJL_LDADD@
msc_test_LDFLAGS = @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \
@PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@
@PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ \
@YAJL_LDFLAGS@
check_SCRIPTS = run-unit-tests.pl
TESTS = $(check_SCRIPTS)

View File

@ -178,7 +178,8 @@ void msr_log_warn(modsec_rec *msr, const char *text, ...) {
va_end(ap);
}
const char *ap_get_remote_host(conn_rec *conn, void *dir_config, int type, int *str_is_ip) {
#define ap_get_remote_host(a, b, c, d) test_ap_get_remote_host(a, b, c, d)
const char *test_ap_get_remote_host(conn_rec *conn, void *dir_config, int type, int *str_is_ip) {
return "FAKE-REMOTE-HOST";
}