From 3fbc2b538f758de3c4f28f8541a2a08037e7b0fc Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Wed, 6 Jul 2016 07:45:04 +0300 Subject: [PATCH 1/5] configure: conditional creation of Makefiles in test subdir. --- configure.ac | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index b3ef4fbf6f..936e916be7 100644 --- a/configure.ac +++ b/configure.ac @@ -274,14 +274,17 @@ AC_CONFIG_FILES([\ doc/Makefile \ src/Makefile \ others/Makefile \ - test/Makefile \ - test/benchmark/Makefile \ - test/fuzzer/Makefile \ examples/Makefile \ examples/simple_example_using_c/Makefile \ examples/multithread_c/Makefile \ ]) +AM_COND_IF([TEST_UTILITIES], + [AC_CONFIG_FILES([test/Makefile test/benchmark/Makefile])]) + +AM_COND_IF([AFL_FUZZER], + [AC_CONFIG_FILES([test/fuzzer/Makefile])]) + AC_CONFIG_HEADERS([src/config.h]) From 34e0284d078ebfe6246fca72bcfdc9e744d73447 Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Wed, 6 Jul 2016 07:49:45 +0300 Subject: [PATCH 2/5] automake: include all needed files into "make dist" target. --- others/Makefile.am | 6 ++++++ src/Makefile.am | 15 ++++++++++++++- test/Makefile.am | 6 ++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/others/Makefile.am b/others/Makefile.am index e9211f1cc5..99d413217c 100644 --- a/others/Makefile.am +++ b/others/Makefile.am @@ -4,3 +4,9 @@ libinjection_la_SOURCES = \ libinjection/src/libinjection_html5.c \ libinjection/src/libinjection_sqli.c \ libinjection/src/libinjection_xss.c + +pkginclude_HEADERS = libinjection/src/libinjection.h \ + libinjection/src/libinjection_html5.h \ + libinjection/src/libinjection_sqli.h \ + libinjection/src/libinjection_sqli_data.h \ + libinjection/src/libinjection_xss.h diff --git a/src/Makefile.am b/src/Makefile.am index 8ffd39bf27..f5ace2cee1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -41,7 +41,20 @@ pkginclude_HEADERS = \ ../headers/modsecurity/modsecurity.h \ ../headers/modsecurity/rule.h \ ../headers/modsecurity/rules.h \ - ../headers/modsecurity/rules_properties.h + ../headers/modsecurity/rules_properties.h \ + actions/*.h \ + actions/transformations/*.h \ + audit_log/*.h \ + audit_log/writer/*.h \ + collection/backend/*.h \ + operators/*.h \ + parser/*.h \ + request_body_processor/*.h \ + utils/*.h \ + utils/mbedtls/*.h \ + variables/*.h \ + variables/variations/*.h \ + *.h libmodsecurity_includesub_HEADERS = \ diff --git a/test/Makefile.am b/test/Makefile.am index 6c5ab3b55a..6e47809bbe 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -25,9 +25,15 @@ noinst_PROGRAMS = noinst_PROGRAMS += unit_tests unit_tests_SOURCES = \ + common/modsecurity_test.cc \ unit/unit.cc \ unit/unit_test.cc +pkginclude_HEADERS = \ + common/*.h \ + unit/*.h \ + regression/*.h + unit_tests_LDADD = \ $(GLOBAL_LDADD) \ $(top_builddir)/src/.libs/libmodsecurity.a \ From 8c05b42fc62a0a48ac0e6099f3171fee41558236 Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Wed, 6 Jul 2016 08:34:10 +0300 Subject: [PATCH 3/5] fixed build of unit tests (broken by 34e0284) --- test/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index 6e47809bbe..6494de91cd 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -25,11 +25,11 @@ noinst_PROGRAMS = noinst_PROGRAMS += unit_tests unit_tests_SOURCES = \ - common/modsecurity_test.cc \ unit/unit.cc \ unit/unit_test.cc pkginclude_HEADERS = \ + common/modsecurity_test.cc \ common/*.h \ unit/*.h \ regression/*.h From 0d3b47be31a804515b4e2cc5b2f9d59b463f8e16 Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Wed, 6 Jul 2016 09:03:02 +0300 Subject: [PATCH 4/5] exclude build-time required headers from install target --- others/Makefile.am | 2 +- src/Makefile.am | 19 ++++++++++--------- test/Makefile.am | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/others/Makefile.am b/others/Makefile.am index 99d413217c..87f510cdf7 100644 --- a/others/Makefile.am +++ b/others/Makefile.am @@ -5,7 +5,7 @@ libinjection_la_SOURCES = \ libinjection/src/libinjection_sqli.c \ libinjection/src/libinjection_xss.c -pkginclude_HEADERS = libinjection/src/libinjection.h \ +noinst_HEADERS = libinjection/src/libinjection.h \ libinjection/src/libinjection_html5.h \ libinjection/src/libinjection_sqli.h \ libinjection/src/libinjection_sqli_data.h \ diff --git a/src/Makefile.am b/src/Makefile.am index f5ace2cee1..08190491a6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -41,7 +41,16 @@ pkginclude_HEADERS = \ ../headers/modsecurity/modsecurity.h \ ../headers/modsecurity/rule.h \ ../headers/modsecurity/rules.h \ - ../headers/modsecurity/rules_properties.h \ + ../headers/modsecurity/rules_properties.h + + +libmodsecurity_includesub_HEADERS = \ + ../headers/modsecurity/collection/collection.h \ + ../headers/modsecurity/collection/collections.h \ + ../headers/modsecurity/collection/variable.h + + +noinst_HEADERS = \ actions/*.h \ actions/transformations/*.h \ audit_log/*.h \ @@ -57,14 +66,6 @@ pkginclude_HEADERS = \ *.h -libmodsecurity_includesub_HEADERS = \ - ../headers/modsecurity/collection/collection.h \ - ../headers/modsecurity/collection/collections.h \ - ../headers/modsecurity/collection/variable.h - - - - VARIABLES = \ variables/duration.cc \ variables/env.cc \ diff --git a/test/Makefile.am b/test/Makefile.am index 6494de91cd..a114f8670d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -28,7 +28,7 @@ unit_tests_SOURCES = \ unit/unit.cc \ unit/unit_test.cc -pkginclude_HEADERS = \ +noinst_HEADERS = \ common/modsecurity_test.cc \ common/*.h \ unit/*.h \ From 76d806c4478b8e1e291639ca8675f69600254eaa Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Wed, 6 Jul 2016 09:22:38 +0300 Subject: [PATCH 5/5] include test cases into the distribution --- test/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/Makefile.am b/test/Makefile.am index a114f8670d..a5791893a8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -20,6 +20,9 @@ MAINTAINERCLEANFILES = \ bin_PROGRAMS = noinst_PROGRAMS = +EXTRA_DIST = \ + test-cases/* + # unit_tests