From a5f223cb5217326177cb6a0df2f5e761b6239517 Mon Sep 17 00:00:00 2001 From: Eduardo Arias Date: Sat, 17 Aug 2024 22:36:30 +0000 Subject: [PATCH 1/2] Individual test result should not be printed for automake output - Test results output escape characters to highlight whether the test passed or failed. Additionally, the input & output for each test can include non-ASCII characters. These characters break parsing of results (.log & .trs files) with grep, as the files are interpreted to be binary. --- test/unit/unit.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/unit.cc b/test/unit/unit.cc index 7b62e7f7e3..75fec13726 100644 --- a/test/unit/unit.cc +++ b/test/unit/unit.cc @@ -275,10 +275,10 @@ int main(int argc, char **argv) { if (!test.m_automake_output) { std::cout << "Total >> " << total << std::endl; - } - for (const auto t : results) { - std::cout << t->print() << std::endl; + for (const auto t : results) { + std::cout << t->print() << std::endl; + } } const int skp = std::count_if(results.cbegin(), results.cend(), [](const auto &i) From df081af870e2d2e3603ebdbb4390998715134cab Mon Sep 17 00:00:00 2001 From: Eduardo Arias Date: Fri, 16 Aug 2024 05:59:38 -0700 Subject: [PATCH 2/2] Adjusted pthread LDFLAG in examples required for multithreading. - Some versions of gcc/libc require setting the pthread flag when using std::thread, which to implement it. - This was found compiling the library in a Debian (bullseye) container. --- examples/reading_logs_via_rule_message/Makefile.am | 1 + examples/reading_logs_with_offset/Makefile.am | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/reading_logs_via_rule_message/Makefile.am b/examples/reading_logs_via_rule_message/Makefile.am index 55d3a93f5e..210edef3bc 100644 --- a/examples/reading_logs_via_rule_message/Makefile.am +++ b/examples/reading_logs_via_rule_message/Makefile.am @@ -21,6 +21,7 @@ simple_request_LDFLAGS = \ -L$(top_builddir)/src/.libs/ \ $(GEOIP_LDFLAGS) \ -lmodsecurity \ + -lpthread \ -lm \ -lstdc++ \ $(LMDB_LDFLAGS) \ diff --git a/examples/reading_logs_with_offset/Makefile.am b/examples/reading_logs_with_offset/Makefile.am index f845c5837a..3ecda10cbb 100644 --- a/examples/reading_logs_with_offset/Makefile.am +++ b/examples/reading_logs_with_offset/Makefile.am @@ -21,7 +21,6 @@ read_LDFLAGS = \ -L$(top_builddir)/src/.libs/ \ $(GEOIP_LDFLAGS) \ -lmodsecurity \ - -lpthread \ -lm \ -lstdc++ \ $(LMDB_LDFLAGS) \