From a591ef6052d9436055e9e0b5d3317eaa8fcbdbe9 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Wed, 20 Mar 2019 00:02:38 +0100 Subject: [PATCH 1/2] Propagate BOOST_CPPFLAGS to tests --- tests/Makefile.am | 102 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 2 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 0136d41..bd2df58 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -38,6 +38,7 @@ api_CXXFLAGS = \ $(END) api_CPPFLAGS = \ + @BOOST_CPPFLAGS@ \ -I$(top_srcdir)/include \ -I$(top_srcdir)/rpc \ -I$(top_srcdir)/src \ @@ -140,6 +141,104 @@ core_CXXFLAGS = \ $(END) core_CPPFLAGS = \ + @BOOST_CPPFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/rpc \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/externals/hermes/include \ + -D__NORNS_DEBUG__ \ + $(END) + +api_SOURCES = \ + catch.hpp \ + api-main.cpp \ + api-namespace-register.cpp \ + api-namespace-unregister.cpp \ + api-copy-local-data.cpp \ + api-copy-remote-data.cpp \ + api-remove-local-data.cpp \ + api-job-register.cpp \ + api-job-update.cpp \ + api-job-unregister.cpp \ + api-process-add.cpp \ + api-process-remove.cpp \ + api-resource-init.cpp \ + api-task-init.cpp \ + api-task-submit.cpp \ + api-task-status.cpp \ + api-send-command.cpp \ + api-ctl-copy-local-data.cpp \ + api-ctl-task-init.cpp \ + api-ctl-task-submit.cpp \ + api-ctl-task-status.cpp \ + api-ctl-copy-remote-data.cpp \ + api-ctl-remove-local-data.cpp \ + compare-files.cpp \ + compare-files.hpp \ + config-template.cpp \ + config-template.hpp \ + fake-daemon.cpp \ + fake-daemon.hpp \ + test-env.cpp \ + test-env.hpp \ + $(END) + +api_LDFLAGS = \ + @BOOST_ASIO_LIB@ \ + @BOOST_LDFLAGS@ \ + @BOOST_FILESYSTEM_LIB@ \ + @BOOST_PROGRAM_OPTIONS_LIB@ \ + @BOOST_SYSTEM_LIB@ \ + @BOOST_THREAD_LIB@ \ + @BOOST_REGEX_LIB@ \ + @PROTOBUF_LIBS@ \ + -no-install \ + -Wl,-rpath,$(top_builddir)/lib/.libs \ + $(top_builddir)/src/liburd_aux.la \ + $(top_builddir)/lib/libnorns_debug.la \ + $(top_builddir)/lib/libnornsctl_debug.la \ + $(END) + +EXTRA_api_DEPENDENCIES = \ + $(top_builddir)/src/liburd_aux.la \ + $(top_builddir)/lib/libnorns_debug.la \ + $(top_builddir)/lib/libnornsctl_debug.la \ + $(END) + +BUILT_SOURCES = \ + config-template.cpp + +edit = $(SED) \ + -e 's|\"|\\"|g' \ + -e 's|^| "|g' \ + -e 's|$$|\\n"|g' + +config-template.cpp: Makefile $(top_srcdir)/etc/norns.conf.in + @( echo "/* This file autogenerated by Makefile */"; \ + echo "#include \"config-template.hpp\""; \ + echo ""; \ + echo "const std::string config_file::cftemplate = "; \ + $(edit) $(top_srcdir)/etc/norns.conf.in ; \ + echo ";"; \ + ) > $@ + +# The following produces a version of the api tests where the urd daemon +# is not started automatically by the test, so that a running daemon can be +# tested interactively +api_interactive_CXXFLAGS = \ + $(api_CXXFLAGS) +api_interactive_CPPFLAGS = \ + $(api_CPPFLAGS) \ + -DUSE_REAL_DAEMON \ + -D__NORNS_DEBUG__ +api_interactive_SOURCES = \ + $(api_SOURCES) +api_interactive_LDFLAGS = \ + $(api_LDFLAGS) +EXTRA_api_interactive_DEPENDENCIES = \ + $(EXTRA_api_DEPENDENCIES) + + -I$(top_srcdir)/include \ -I$(top_srcdir)/src/externals/hermes/include \ -I$(top_srcdir)/rpc \ @@ -160,14 +259,13 @@ core_SOURCES = \ core_LDFLAGS = \ -no-install \ - -fsanitize=address \ - -fno-omit-frame-pointer \ @BOOST_ASIO_LIB@ \ @BOOST_LDFLAGS@ \ @BOOST_FILESYSTEM_LIB@ \ @BOOST_PROGRAM_OPTIONS_LIB@ \ @BOOST_SYSTEM_LIB@ \ @BOOST_THREAD_LIB@ \ + @BOOST_REGEX_LIB@ \ @PROTOBUF_LIBS@ \ $(top_builddir)/src/liburd_aux.la \ $(top_builddir)/lib/libnorns_debug.la \ -- GitLab From 54aae36cc5d8c0f2256ccd3a26263c5c5530a1ac Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Wed, 20 Mar 2019 12:38:04 +0100 Subject: [PATCH 2/2] Remove redundant code and add missing sources --- tests/Makefile.am | 152 +++++++++------------------------------------- 1 file changed, 28 insertions(+), 124 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index bd2df58..bf3a90b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -33,43 +33,7 @@ check_PROGRAMS = $(TESTS) api_interactive END = -api_CXXFLAGS = \ - -Wall -Wextra \ - $(END) - -api_CPPFLAGS = \ - @BOOST_CPPFLAGS@ \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/rpc \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/externals/hermes/include \ - -D__NORNS_DEBUG__ \ - $(END) - -api_SOURCES = \ - catch.hpp \ - api-main.cpp \ - api-namespace-register.cpp \ - api-namespace-unregister.cpp \ - api-copy-local-data.cpp \ - api-copy-remote-data.cpp \ - api-remove-local-data.cpp \ - api-job-register.cpp \ - api-job-update.cpp \ - api-job-unregister.cpp \ - api-process-add.cpp \ - api-process-remove.cpp \ - api-resource-init.cpp \ - api-task-init.cpp \ - api-task-submit.cpp \ - api-task-status.cpp \ - api-send-command.cpp \ - api-ctl-copy-local-data.cpp \ - api-ctl-task-init.cpp \ - api-ctl-task-submit.cpp \ - api-ctl-task-status.cpp \ - api-ctl-copy-remote-data.cpp \ - api-ctl-remove-local-data.cpp \ +COMMON_SOURCES = \ compare-files.cpp \ compare-files.hpp \ config-template.cpp \ @@ -80,67 +44,11 @@ api_SOURCES = \ test-env.hpp \ $(END) -api_LDFLAGS = \ - @BOOST_ASIO_LIB@ \ - @BOOST_LDFLAGS@ \ - @BOOST_FILESYSTEM_LIB@ \ - @BOOST_PROGRAM_OPTIONS_LIB@ \ - @BOOST_SYSTEM_LIB@ \ - @BOOST_THREAD_LIB@ \ - @BOOST_REGEX_LIB@ \ - @PROTOBUF_LIBS@ \ - -no-install \ - -Wl,-rpath,$(top_builddir)/lib/.libs \ - $(top_builddir)/src/liburd_aux.la \ - $(top_builddir)/lib/libnorns_debug.la \ - $(top_builddir)/lib/libnornsctl_debug.la \ - $(END) - -EXTRA_api_DEPENDENCIES = \ - $(top_builddir)/src/liburd_aux.la \ - $(top_builddir)/lib/libnorns_debug.la \ - $(top_builddir)/lib/libnornsctl_debug.la \ - $(END) - -BUILT_SOURCES = \ - config-template.cpp - -edit = $(SED) \ - -e 's|\"|\\"|g' \ - -e 's|^| "|g' \ - -e 's|$$|\\n"|g' - -config-template.cpp: Makefile $(top_srcdir)/etc/norns.conf.in - @( echo "/* This file autogenerated by Makefile */"; \ - echo "#include \"config-template.hpp\""; \ - echo ""; \ - echo "const std::string config_file::cftemplate = "; \ - $(edit) $(top_srcdir)/etc/norns.conf.in ; \ - echo ";"; \ - ) > $@ - -# The following produces a version of the api tests where the urd daemon -# is not started automatically by the test, so that a running daemon can be -# tested interactively -api_interactive_CXXFLAGS = \ - $(api_CXXFLAGS) -api_interactive_CPPFLAGS = \ - $(api_CPPFLAGS) \ - -DUSE_REAL_DAEMON \ - -D__NORNS_DEBUG__ -api_interactive_SOURCES = \ - $(api_SOURCES) -api_interactive_LDFLAGS = \ - $(api_LDFLAGS) -EXTRA_api_interactive_DEPENDENCIES = \ - $(EXTRA_api_DEPENDENCIES) - - -core_CXXFLAGS = \ +api_CXXFLAGS = \ -Wall -Wextra \ $(END) -core_CPPFLAGS = \ +api_CPPFLAGS = \ @BOOST_CPPFLAGS@ \ -I$(top_srcdir)/include \ -I$(top_srcdir)/rpc \ @@ -173,24 +81,17 @@ api_SOURCES = \ api-ctl-task-status.cpp \ api-ctl-copy-remote-data.cpp \ api-ctl-remove-local-data.cpp \ - compare-files.cpp \ - compare-files.hpp \ - config-template.cpp \ - config-template.hpp \ - fake-daemon.cpp \ - fake-daemon.hpp \ - test-env.cpp \ - test-env.hpp \ + $(COMMON_SOURCES) \ $(END) api_LDFLAGS = \ - @BOOST_ASIO_LIB@ \ + @BOOST_ASIO_LIB@ \ @BOOST_LDFLAGS@ \ @BOOST_FILESYSTEM_LIB@ \ - @BOOST_PROGRAM_OPTIONS_LIB@ \ - @BOOST_SYSTEM_LIB@ \ - @BOOST_THREAD_LIB@ \ - @BOOST_REGEX_LIB@ \ + @BOOST_PROGRAM_OPTIONS_LIB@ \ + @BOOST_SYSTEM_LIB@ \ + @BOOST_THREAD_LIB@ \ + @BOOST_REGEX_LIB@ \ @PROTOBUF_LIBS@ \ -no-install \ -Wl,-rpath,$(top_builddir)/lib/.libs \ @@ -215,11 +116,11 @@ edit = $(SED) \ config-template.cpp: Makefile $(top_srcdir)/etc/norns.conf.in @( echo "/* This file autogenerated by Makefile */"; \ - echo "#include \"config-template.hpp\""; \ - echo ""; \ - echo "const std::string config_file::cftemplate = "; \ - $(edit) $(top_srcdir)/etc/norns.conf.in ; \ - echo ";"; \ + echo "#include \"config-template.hpp\""; \ + echo ""; \ + echo "const std::string config_file::cftemplate = "; \ + $(edit) $(top_srcdir)/etc/norns.conf.in ; \ + echo ";"; \ ) > $@ # The following produces a version of the api tests where the urd daemon @@ -239,11 +140,17 @@ EXTRA_api_interactive_DEPENDENCIES = \ $(EXTRA_api_DEPENDENCIES) +core_CXXFLAGS = \ + -Wall -Wextra \ + $(END) + +core_CPPFLAGS = \ + @BOOST_CPPFLAGS@ \ -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/externals/hermes/include \ -I$(top_srcdir)/rpc \ -I$(top_srcdir)/src \ - -DUSE_REAL_DAEMON \ + -I$(top_srcdir)/src/externals/hermes/include \ + -D__NORNS_DEBUG__ \ $(END) core_SOURCES = \ @@ -251,21 +158,18 @@ core_SOURCES = \ api-main.cpp \ utils-path-normalize.cpp \ utils-tar.cpp \ - test-env.cpp \ - test-env.hpp \ - compare-files.cpp \ - compare-files.hpp \ + $(COMMON_SOURCES) \ $(END) core_LDFLAGS = \ -no-install \ - @BOOST_ASIO_LIB@ \ + @BOOST_ASIO_LIB@ \ @BOOST_LDFLAGS@ \ @BOOST_FILESYSTEM_LIB@ \ - @BOOST_PROGRAM_OPTIONS_LIB@ \ - @BOOST_SYSTEM_LIB@ \ - @BOOST_THREAD_LIB@ \ - @BOOST_REGEX_LIB@ \ + @BOOST_PROGRAM_OPTIONS_LIB@ \ + @BOOST_SYSTEM_LIB@ \ + @BOOST_THREAD_LIB@ \ + @BOOST_REGEX_LIB@ \ @PROTOBUF_LIBS@ \ $(top_builddir)/src/liburd_aux.la \ $(top_builddir)/lib/libnorns_debug.la \ -- GitLab