From cea87f40859901a7b438c6dc8b7f8251d24fd53d Mon Sep 17 00:00:00 2001 From: b1v1r Date: Tue, 27 Apr 2010 09:33:56 +0000 Subject: [PATCH] Fixed test/test-gregression build targets. --- Makefile.am | 10 ++- Makefile.in | 32 ++++----- apache2/Makefile.am | 22 +++--- apache2/Makefile.in | 24 ++++--- build/find_lua.m4 | 3 + configure | 41 +++++++----- configure.ac | 6 +- libtool | 2 +- mlogc/Makefile.in | 2 + tests/Makefile.am | 158 ++++++++++---------------------------------- tests/msc_test.c | 4 +- tools/Makefile.in | 2 + 12 files changed, 123 insertions(+), 183 deletions(-) diff --git a/Makefile.am b/Makefile.am index b7fd793e..a78c322a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,2 +1,10 @@ ACLOCAL_AMFLAGS = -I acinclude -SUBDIRS = @TOPLEVEL_SUBDIRS@ +SUBDIRS = @TOPLEVEL_SUBDIRS@ tests + +# Alias for "check" +test: check + +test-regression: + (cd tests && $(MAKE) test-regression) + +.PHONY: test diff --git a/Makefile.in b/Makefile.in index ef8e4805..3eff8249 100644 --- a/Makefile.in +++ b/Makefile.in @@ -38,13 +38,9 @@ host_triplet = @host@ DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/modsecurity_config.h.in \ $(top_srcdir)/build/apxs-wrapper.in $(top_srcdir)/configure \ - $(top_srcdir)/tests/csv_rx-pm.pl.in \ - $(top_srcdir)/tests/gen_rx-pm.pl.in \ $(top_srcdir)/tests/regression/server_root/conf/httpd.conf.in \ - $(top_srcdir)/tests/run-regression-tests.pl.in \ - $(top_srcdir)/tests/run-unit-tests.pl.in build/compile \ - build/config.guess build/config.sub build/depcomp \ - build/install-sh build/ltmain.sh build/missing + build/compile build/config.guess build/config.sub \ + build/depcomp build/install-sh build/ltmain.sh build/missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude/libtool.m4 \ @@ -64,9 +60,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = modsecurity_config.h -CONFIG_CLEAN_FILES = build/apxs-wrapper tests/run-unit-tests.pl \ - tests/run-regression-tests.pl tests/gen_rx-pm.pl \ - tests/csv_rx-pm.pl \ +CONFIG_CLEAN_FILES = build/apxs-wrapper \ tests/regression/server_root/conf/httpd.conf SOURCES = DIST_SOURCES = @@ -178,9 +172,11 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LUA_CFLAGS = @LUA_CFLAGS@ +LUA_CONFIG = @LUA_CONFIG@ LUA_CPPFLAGS = @LUA_CPPFLAGS@ LUA_LDADD = @LUA_LDADD@ LUA_LDFLAGS = @LUA_LDFLAGS@ +LUA_VERSION = @LUA_VERSION@ MAKEINFO = @MAKEINFO@ MODSEC_APXS_EXTRA_CFLAGS = @MODSEC_APXS_EXTRA_CFLAGS@ MODSEC_EXTRA_CFLAGS = @MODSEC_EXTRA_CFLAGS@ @@ -266,7 +262,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ ACLOCAL_AMFLAGS = -I acinclude -SUBDIRS = @TOPLEVEL_SUBDIRS@ +SUBDIRS = @TOPLEVEL_SUBDIRS@ tests all: modsecurity_config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -323,14 +319,6 @@ distclean-hdr: -rm -f modsecurity_config.h stamp-h1 build/apxs-wrapper: $(top_builddir)/config.status $(top_srcdir)/build/apxs-wrapper.in cd $(top_builddir) && $(SHELL) ./config.status $@ -tests/run-unit-tests.pl: $(top_builddir)/config.status $(top_srcdir)/tests/run-unit-tests.pl.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -tests/run-regression-tests.pl: $(top_builddir)/config.status $(top_srcdir)/tests/run-regression-tests.pl.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -tests/gen_rx-pm.pl: $(top_builddir)/config.status $(top_srcdir)/tests/gen_rx-pm.pl.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -tests/csv_rx-pm.pl: $(top_builddir)/config.status $(top_srcdir)/tests/csv_rx-pm.pl.in - cd $(top_builddir) && $(SHELL) ./config.status $@ tests/regression/server_root/conf/httpd.conf: $(top_builddir)/config.status $(top_srcdir)/tests/regression/server_root/conf/httpd.conf.in cd $(top_builddir) && $(SHELL) ./config.status $@ @@ -714,6 +702,14 @@ uninstall-info: uninstall-info-recursive mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-info-am + +# Alias for "check" +test: check + +test-regression: + (cd tests && $(MAKE) test-regression) + +.PHONY: test # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/apache2/Makefile.am b/apache2/Makefile.am index c44bd988..cd5d5f5c 100644 --- a/apache2/Makefile.am +++ b/apache2/Makefile.am @@ -1,25 +1,25 @@ pkglibdir = $(prefix)/lib pkglib_LTLIBRARIES = mod_security2.la #include_HEADERS = re.h modsecurity.h msc_logging.h msc_multipart.h \ -# msc_parsers.h msc_pcre.h msc_util.h msc_xml.h \ -# persist_dbm.h apache2.h msc_geo.h acmp.h utf8tables.h \ -# msc_lua.h msc_release.h +# msc_parsers.h msc_pcre.h msc_util.h msc_xml.h \ +# persist_dbm.h apache2.h msc_geo.h acmp.h utf8tables.h \ +# msc_lua.h msc_release.h mod_security2_la_SOURCES = mod_security2.c \ - apache2_config.c apache2_io.c apache2_util.c \ + apache2_config.c apache2_io.c apache2_util.c \ re.c re_operators.c re_actions.c re_tfns.c \ - re_variables.c msc_logging.c msc_xml.c \ - msc_multipart.c modsecurity.c msc_parsers.c \ - msc_util.c msc_pcre.c persist_dbm.c msc_reqbody.c \ - msc_geo.c acmp.c msc_lua.c msc_release.c + re_variables.c msc_logging.c msc_xml.c \ + msc_multipart.c modsecurity.c msc_parsers.c \ + msc_util.c msc_pcre.c persist_dbm.c msc_reqbody.c \ + msc_geo.c acmp.c msc_lua.c msc_release.c mod_security2_la_CFLAGS = @APXS_CFLAGS@ @APR_CFLAGS@ @APU_CFLAGS@ \ - @LIBXML2_CFLAGS@ @LUA_CFLAGS@ + @LIBXML2_CFLAGS@ @LUA_CFLAGS@ mod_security2_la_CPPFLAGS = @APR_CPPFLAGS@ @LIBXML2_CPPFLAGS@ @LUA_CPPFLAGS@ mod_security2_la_LIBADD = @APR_LDADD@ @APU_LDADD@ @LIBXML2_LDADD@ @LUA_LDADD@ mod_security2_la_LDFLAGS = -no-undefined -module -avoid-version \ - @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ - @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ + @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ + @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ install-exec-hook: $(pkglib_LTLIBRARIES) @echo "Removing unused static libraries..."; \ diff --git a/apache2/Makefile.in b/apache2/Makefile.in index dcf55626..3a33da1c 100644 --- a/apache2/Makefile.in +++ b/apache2/Makefile.in @@ -185,9 +185,11 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LUA_CFLAGS = @LUA_CFLAGS@ +LUA_CONFIG = @LUA_CONFIG@ LUA_CPPFLAGS = @LUA_CPPFLAGS@ LUA_LDADD = @LUA_LDADD@ LUA_LDFLAGS = @LUA_LDFLAGS@ +LUA_VERSION = @LUA_VERSION@ MAKEINFO = @MAKEINFO@ MODSEC_APXS_EXTRA_CFLAGS = @MODSEC_APXS_EXTRA_CFLAGS@ MODSEC_EXTRA_CFLAGS = @MODSEC_EXTRA_CFLAGS@ @@ -274,25 +276,25 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ pkglib_LTLIBRARIES = mod_security2.la #include_HEADERS = re.h modsecurity.h msc_logging.h msc_multipart.h \ -# msc_parsers.h msc_pcre.h msc_util.h msc_xml.h \ -# persist_dbm.h apache2.h msc_geo.h acmp.h utf8tables.h \ -# msc_lua.h msc_release.h +# msc_parsers.h msc_pcre.h msc_util.h msc_xml.h \ +# persist_dbm.h apache2.h msc_geo.h acmp.h utf8tables.h \ +# msc_lua.h msc_release.h mod_security2_la_SOURCES = mod_security2.c \ - apache2_config.c apache2_io.c apache2_util.c \ + apache2_config.c apache2_io.c apache2_util.c \ re.c re_operators.c re_actions.c re_tfns.c \ - re_variables.c msc_logging.c msc_xml.c \ - msc_multipart.c modsecurity.c msc_parsers.c \ - msc_util.c msc_pcre.c persist_dbm.c msc_reqbody.c \ - msc_geo.c acmp.c msc_lua.c msc_release.c + re_variables.c msc_logging.c msc_xml.c \ + msc_multipart.c modsecurity.c msc_parsers.c \ + msc_util.c msc_pcre.c persist_dbm.c msc_reqbody.c \ + msc_geo.c acmp.c msc_lua.c msc_release.c mod_security2_la_CFLAGS = @APXS_CFLAGS@ @APR_CFLAGS@ @APU_CFLAGS@ \ - @LIBXML2_CFLAGS@ @LUA_CFLAGS@ + @LIBXML2_CFLAGS@ @LUA_CFLAGS@ mod_security2_la_CPPFLAGS = @APR_CPPFLAGS@ @LIBXML2_CPPFLAGS@ @LUA_CPPFLAGS@ mod_security2_la_LIBADD = @APR_LDADD@ @APU_LDADD@ @LIBXML2_LDADD@ @LUA_LDADD@ mod_security2_la_LDFLAGS = -no-undefined -module -avoid-version \ - @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ - @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ + @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ + @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ all: all-am diff --git a/build/find_lua.m4 b/build/find_lua.m4 index e7280181..af805cf3 100644 --- a/build/find_lua.m4 +++ b/build/find_lua.m4 @@ -169,6 +169,7 @@ else LUA_LDADD="-l${lua_lib_name}" LUA_LDFLAGS="-L${lua_lib_path}" else + LUA_VERSION="" AC_MSG_RESULT([no]) fi fi @@ -177,6 +178,8 @@ if test -n "${LUA_LIBS}"; then LUA_CPPFLAGS="-DWITH_LUA" fi +AC_SUBST(LUA_CONFIG) +AC_SUBST(LUA_VERSION) AC_SUBST(LUA_CFLAGS) AC_SUBST(LUA_CPPFLAGS) AC_SUBST(LUA_LDADD) diff --git a/configure b/configure index 254ced04..3f98f647 100755 --- a/configure +++ b/configure @@ -752,6 +752,8 @@ LUA_LDFLAGS LUA_LDADD LUA_CPPFLAGS LUA_CFLAGS +LUA_VERSION +LUA_CONFIG LIBXML2_LDFLAGS LIBXML2_LDADD LIBXML2_CPPFLAGS @@ -4603,13 +4605,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4606: $ac_compile\"" >&5) + (eval echo "\"\$as_me:4608: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4609: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:4611: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4612: output\"" >&5) + (eval echo "\"\$as_me:4614: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5815,7 +5817,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5818 "configure"' > conftest.$ac_ext + echo '#line 5820 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7344,11 +7346,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7347: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7349: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7351: \$? = $ac_status" >&5 + echo "$as_me:7353: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7683,11 +7685,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7686: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7688: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7690: \$? = $ac_status" >&5 + echo "$as_me:7692: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7788,11 +7790,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7791: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7793: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7795: \$? = $ac_status" >&5 + echo "$as_me:7797: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7843,11 +7845,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7846: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7848: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7850: \$? = $ac_status" >&5 + echo "$as_me:7852: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10226,7 +10228,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10229 "configure" +#line 10231 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10322,7 +10324,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10325 "configure" +#line 10327 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12092,7 +12094,7 @@ done # Some directories MSC_BASE_DIR=`pwd` MSC_PKGBASE_DIR="$MSC_BASE_DIR/.." -MSC_TEST_DIR="$MSC_BASE_DIR/t" +MSC_TEST_DIR="$MSC_BASE_DIR/tests" MSC_REGRESSION_DIR="$MSC_TEST_DIR/regression" MSC_REGRESSION_SERVERROOT_DIR="$MSC_REGRESSION_DIR/server_root" MSC_REGRESSION_CONF_DIR="$MSC_REGRESSION_SERVERROOT_DIR/conf" @@ -13137,6 +13139,7 @@ $as_echo "${lua_lib_path} ${lua_inc_path}" >&6; } LUA_LDADD="-l${lua_lib_name}" LUA_LDFLAGS="-L${lua_lib_path}" else + LUA_VERSION="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -13151,6 +13154,8 @@ fi + + if test "${with_path}" != "no"; then if test -z "${LUA_VERSION}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: optional lua library not found" >&5 @@ -13162,6 +13167,9 @@ $as_echo "$as_me: using lua v${LUA_VERSION}" >&6;} fi fi +if test -n "$LUA_VERSION"; then + LUA_CFLAGS="-DWITH_LUA $LUA_CFLAGS" +fi if test "$build_mlogc" -ne 0; then @@ -13304,6 +13312,8 @@ if test "$build_mlogc" -ne 0; then ac_config_files="$ac_config_files mlogc/Makefile" fi +ac_config_files="$ac_config_files tests/Makefile" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -14288,6 +14298,7 @@ do "tests/regression/server_root/conf/httpd.conf") CONFIG_FILES="$CONFIG_FILES tests/regression/server_root/conf/httpd.conf" ;; "tools/rules-updater.pl") CONFIG_FILES="$CONFIG_FILES tools/rules-updater.pl" ;; "mlogc/Makefile") CONFIG_FILES="$CONFIG_FILES mlogc/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.ac b/configure.ac index 4b085998..2e02b410 100644 --- a/configure.ac +++ b/configure.ac @@ -50,7 +50,7 @@ AC_CHECK_FUNCS([atexit getcwd memmove memset strcasecmp strchr strdup strerror s # Some directories MSC_BASE_DIR=`pwd` MSC_PKGBASE_DIR="$MSC_BASE_DIR/.." -MSC_TEST_DIR="$MSC_BASE_DIR/t" +MSC_TEST_DIR="$MSC_BASE_DIR/tests" MSC_REGRESSION_DIR="$MSC_TEST_DIR/regression" MSC_REGRESSION_SERVERROOT_DIR="$MSC_REGRESSION_DIR/server_root" MSC_REGRESSION_CONF_DIR="$MSC_REGRESSION_SERVERROOT_DIR/conf" @@ -486,6 +486,9 @@ CHECK_APU() fi CHECK_LIBXML2() CHECK_LUA() +if test -n "$LUA_VERSION"; then + LUA_CFLAGS="-DWITH_LUA $LUA_CFLAGS" +fi if test "$build_mlogc" -ne 0; then CHECK_CURL() fi @@ -512,5 +515,6 @@ fi if test "$build_mlogc" -ne 0; then AC_CONFIG_FILES([mlogc/Makefile]) fi +AC_CONFIG_FILES([tests/Makefile]) AC_OUTPUT diff --git a/libtool b/libtool index e848b6c7..f236540c 100755 --- a/libtool +++ b/libtool @@ -86,7 +86,7 @@ NM="/usr/bin/nm -B" LN_S="ln -s" # What is the maximum length of a command? -max_cmd_len=3458764513820540925 +max_cmd_len=1572864 # Object file suffix (normally "o"). objext=o diff --git a/mlogc/Makefile.in b/mlogc/Makefile.in index 59abc114..ada54415 100644 --- a/mlogc/Makefile.in +++ b/mlogc/Makefile.in @@ -170,9 +170,11 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LUA_CFLAGS = @LUA_CFLAGS@ +LUA_CONFIG = @LUA_CONFIG@ LUA_CPPFLAGS = @LUA_CPPFLAGS@ LUA_LDADD = @LUA_LDADD@ LUA_LDFLAGS = @LUA_LDFLAGS@ +LUA_VERSION = @LUA_VERSION@ MAKEINFO = @MAKEINFO@ MODSEC_APXS_EXTRA_CFLAGS = @MODSEC_APXS_EXTRA_CFLAGS@ MODSEC_EXTRA_CFLAGS = @MODSEC_EXTRA_CFLAGS@ diff --git a/tests/Makefile.am b/tests/Makefile.am index 0bfcd8b8..20dbcb0f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,127 +1,39 @@ -# Makefile for ModSecurity +check_PROGRAMS = msc_test +msc_test_SOURCES = msc_test.c \ + $(top_srcdir)/apache2/re.c \ + $(top_srcdir)/apache2/re_operators.c \ + $(top_srcdir)/apache2/re_actions.c \ + $(top_srcdir)/apache2/re_tfns.c \ + $(top_srcdir)/apache2/re_variables.c \ + $(top_srcdir)/apache2/msc_logging.c \ + $(top_srcdir)/apache2/msc_xml.c \ + $(top_srcdir)/apache2/msc_multipart.c \ + $(top_srcdir)/apache2/modsecurity.c \ + $(top_srcdir)/apache2/msc_parsers.c \ + $(top_srcdir)/apache2/msc_util.c \ + $(top_srcdir)/apache2/msc_pcre.c \ + $(top_srcdir)/apache2/persist_dbm.c \ + $(top_srcdir)/apache2/msc_reqbody.c \ + $(top_srcdir)/apache2/msc_geo.c \ + $(top_srcdir)/apache2/acmp.c \ + $(top_srcdir)/apache2/msc_lua.c \ + $(top_srcdir)/apache2/msc_release.c +msc_test_CFLAGS = @APXS_CFLAGS@ @APR_CFLAGS@ @APU_CFLAGS@ \ + @PCRE_CFLAGS@ @LIBXML2_CFLAGS@ @LUA_CFLAGS@ +msc_test_CPPFLAGS = -I$(top_srcdir)/apache2 \ + @APR_CPPFLAGS@ @LIBXML2_CPPFLAGS@ \ + @PCRE_CPPFLAGS@ @LUA_CPPFLAGS@ +msc_test_LDADD = @APR_LDADD@ @APU_LDADD@ \ + @PCRE_LDADD@ @LIBXML2_LDADD@ @LUA_LDADD@ +msc_test_LDFLAGS = @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ + @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ -MOD_SECURITY2 = mod_security2 apache2_config apache2_io apache2_util \ - re re_operators re_actions re_tfns re_variables \ - msc_logging msc_xml msc_multipart modsecurity msc_parsers msc_util msc_pcre \ - persist_dbm msc_reqbody msc_geo acmp msc_lua msc_release +check_SCRIPTS = run-unit-tests.pl +TESTS = $(check_SCRIPTS) -MSC_TEST = re re_operators re_actions re_tfns re_variables \ - msc_logging msc_xml msc_multipart modsecurity \ - msc_parsers msc_util msc_pcre persist_dbm \ - msc_reqbody msc_geo acmp msc_lua msc_release +test: check -MOD_SECURITY2_H = re.h modsecurity.h msc_logging.h msc_multipart.h msc_parsers.h \ - msc_pcre.h msc_util.h msc_xml.h persist_dbm.h apache2.h \ - msc_geo.h acmp.h utf8tables.h msc_lua.h msc_release.h +test-regression: run-regression-tests.pl + $(PERL) run-regression-tests.pl -CC = @APXS_CC@ -LIBTOOL = @APXS_LIBTOOL@ -PERL = @PERL@ -EXTRA_CFLAGS = @EXTRA_CFLAGS@ -MODSEC_EXTRA_CFLAGS = @MODSEC_EXTRA_CFLAGS@ - -### Note: must be in APXS format: -Wc,-flag -APXS_EXTRA_CFLAGS = @APXS_EXTRA_CFLAGS@ -MODSEC_APXS_EXTRA_CFLAGS = @MODSEC_APXS_EXTRA_CFLAGS@ - -APXS = @APXS@ -APXS_WRAPPER = @APXS_WRAPPER@ -APXS_INCLUDEDIR = @APXS_INCLUDEDIR@ -APXS_INCLUDES = @APXS_INCLUDES@ -APXS_CFLAGS = @APXS_CFLAGS@ -APXS_LDFLAGS = @APXS_LDFLAGS@ -APXS_LIBS = @APXS_LIBS@ - -PCRE_CFLAGS = @PCRE_CFLAGS@ -PCRE_LIBS = @PCRE_LIBS@ - -LUA_CFLAGS = @LUA_CFLAGS@ -LUA_LIBS = @LUA_LIBS@ - -LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ -LIBXML2_LIBS = @LIBXML2_LIBS@ - -APR_CFLAGS = @APR_CFLAGS@ -APR_LDFLAGS = @APR_LDFLAGS@ -APR_LIBS = @APR_LIBS@ -APR_LINK_LD = @APR_LINK_LD@ - -APU_CFLAGS = @APU_CFLAGS@ -APU_LDFLAGS = @APU_LDFLAGS@ -APU_LIBS = @APU_LIBS@ -APU_LINK_LD = @APU_LINK_LD@ - -CPPFLAGS = @CPPFLAGS@ $(PCRE_CFLAGS) $(LIBXML2_CFLAGS) $(LUA_CFLAGS) -LIBS = @LIBS@ $(PCRE_LIBS) $(LIBXML2_LIBS) $(LUA_LIBS) -LDFLAGS = @LDFLAGS@ -CFLAGS = @CFLAGS@ - -COMPILE_APACHE_MOD = $(APXS_WRAPPER) -c $(CPPFLAGS) $(LDFLAGS) $(LIBS) - -INSTALL_MOD_SHARED = $(APXS_WRAPPER) -i - -all: mod_security2.la - -install: install-mods - -clean-extras: - @for dir in mlogc-src; do \ - if test -d $$dir; then \ - (cd $$dir && $(MAKE) clean); \ - fi; \ - done - @rm -rf ../tools/mlogc ../tools/mlogc-batch-load.pl - -clean: clean-extras - @rm -rf *.la *.lo *.loT *.o *.slo .libs msc_test msc-test-debug.log - -distclean: clean - @rm -rf Makefile mlogc-src/Makefile mlogc-src/mlogc-batch-load.pl ../tools/*.pl t/run-unit-tests.pl t/run-regression-tests.pl t/gen_rx-pm.pl t/csv_rx-pm.pl t/run-tests.pl t/regression/server_root/conf/httpd.conf t/regression/server_root/conf/*.t_*.conf t/regression/server_root/tmp/* t/regression/server_root/logs/*.log t/regression/server_root/logs/audit/* t/regression/server_root/upload/* t/regression/server_root/data/* config config.log config.status build/apxs-wrapper - -maintainer-clean: distclean - @rm -rf config config.log config.status configure mod_security2_config.h autoscan.log configure.scan build/libtool.m4 build/config.guess build/config.sub build/ltmain.sh - -install-mods: mod_security2.la - $(INSTALL_MOD_SHARED) mod_security2.la - -${MOD_SECURITY2:=.slo}: $(MOD_SECURITY2_H) -${MOD_SECURITY2:=.lo}: $(MOD_SECURITY2_H) -${MOD_SECURITY2:=.o}: $(MOD_SECURITY2_H}) - -mod_security2.la: $(MOD_SECURITY2_H) *.c - @src=""; \ - for f in $(MOD_SECURITY2); do \ - src="$$src $$f.c"; \ - done; \ - rm -f msc_test msc_test.o msc_test.lo msc_test.slo; \ - $(COMPILE_APACHE_MOD) $(APXS_EXTRA_CFLAGS) $(MODSEC_APXS_EXTRA_CFLAGS) $$src - -### MLogC -mlogc: - @(cd mlogc-src && $(MAKE) mlogc) \ - && cp -p mlogc-src/mlogc ../tools \ - && cp -p mlogc-src/mlogc-batch-load.pl ../tools \ - && echo \ - && echo "Successfully built \"mlogc\" in ../tools." \ - && echo "See: mlogc-src/INSTALL" \ - && echo - -### Experimental Test Framework (*NIX only right now) -msc_test.lo: msc_test.c - $(LIBTOOL) --mode=compile $(CC) $(APXS_INCLUDES) $(APXS_CFLAGS) $(CPPFLAGS) $(APR_CFLAGS) $(APU_CFLAGS) -o msc_test.lo -c msc_test.c - -msc_test: $(TESTOBJS) $(MOD_SECURITY2_H}) msc_test.lo - objs=""; \ - for f in $(MSC_TEST); do \ - objs="$$objs $$f.lo"; \ - done; \ - $(LIBTOOL) --mode=link $(CC) $$objs -o msc_test msc_test.lo $(LDFLAGS) $(LIBS) $(APR_LINK_LD) $(APU_LINK_LD) - -test: t/run-unit-tests.pl msc_test - @rm -f msc-test-debug.log; \ - $(PERL) t/run-unit-tests.pl - -test-regression: t/run-regression-tests.pl - @$(PERL) t/run-regression-tests.pl - -.PHONY: all install clean-extras clean maintainer-clean distclean install-mods test test-regression +.PHONY: test test-regression diff --git a/tests/msc_test.c b/tests/msc_test.c index 6240ab35..f8cf6750 100644 --- a/tests/msc_test.c +++ b/tests/msc_test.c @@ -295,7 +295,7 @@ static int init_op(op_data_t *data, const char *name, const char *param, unsigne data->input = input; data->input_len = input_len; - if ( apr_filepath_merge(&conf_fn, NULL, "t/unit-test.conf", APR_FILEPATH_TRUENAME, g_mp) != APR_SUCCESS) { + if ( apr_filepath_merge(&conf_fn, NULL, "unit-test.conf", APR_FILEPATH_TRUENAME, g_mp) != APR_SUCCESS) { *errmsg = apr_psprintf(g_mp, "Failed to build a conf filename."); return -1; } @@ -388,7 +388,7 @@ static int init_action(action_data_t *data, const char *name, const char *param, return -1; } - if ( apr_filepath_merge(&conf_fn, NULL, "t/unit-test.conf", APR_FILEPATH_TRUENAME, g_mp) != APR_SUCCESS) { + if ( apr_filepath_merge(&conf_fn, NULL, "unit-test.conf", APR_FILEPATH_TRUENAME, g_mp) != APR_SUCCESS) { *errmsg = apr_psprintf(g_mp, "Failed to build a conf filename."); return -1; } diff --git a/tools/Makefile.in b/tools/Makefile.in index d6c18970..cdbfcdd2 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -150,9 +150,11 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LUA_CFLAGS = @LUA_CFLAGS@ +LUA_CONFIG = @LUA_CONFIG@ LUA_CPPFLAGS = @LUA_CPPFLAGS@ LUA_LDADD = @LUA_LDADD@ LUA_LDFLAGS = @LUA_LDFLAGS@ +LUA_VERSION = @LUA_VERSION@ MAKEINFO = @MAKEINFO@ MODSEC_APXS_EXTRA_CFLAGS = @MODSEC_APXS_EXTRA_CFLAGS@ MODSEC_EXTRA_CFLAGS = @MODSEC_EXTRA_CFLAGS@