On Fri, Mar 07, 2014 at 09:31:44AM -0800, [email protected] wrote: > The addition of the dbus tests requires dbus dev libraries be installed > to run the test suite. This is not always desirable or even possible. > > So make building and running the dbus tests conditional on the > pkg-config info from those libs. If they are not present output a > message about skipping the tests.
I'm okay with this idea; however, the pkg-config command wasn't actually being run, so no matter what, the dbus tests were getting skipped. Secondly, asking pkg-config for settings for a package that isn't installed, the error emitted goes to stderr, e.g.: Package dbus-1 was not found in the pkg-config search path. Perhaps you should add the directory containing `dbus-1.pc' to the PKG_CONFIG_PATH environment variable No package 'dbus-1' found No dbus pkg-config skipping dbus_eavesdrop dbus_message dbus_services tests ... which feels ugly to me, though (thirdly) I would like to see the warning message when dbus devel information cannot be found be more prominent. Anyway, attached is an updated patch which addresses the first two issues (but didn't address the prominence of the warning message). -- Steve Beattie <[email protected]> http://NxNW.org/~steve/
Subject: Make dbus tests be conditionally run based on pkg-config [v2] The addition of the dbus tests requires dbus dev libraries be installed to run the test suite. This is not always desirable or even possible. So make building and running the dbus tests conditional on the pkg-config info from those libs. If they are not present output a message about skipping the tests. Signed-off-by: John Johansen <[email protected]> Signed-off-by: Steve Beattie <[email protected]> --- tests/regression/apparmor/Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) Index: b/tests/regression/apparmor/Makefile =================================================================== --- a/tests/regression/apparmor/Makefile +++ b/tests/regression/apparmor/Makefile @@ -56,9 +56,6 @@ SRC=access.c \ chown.c \ clone.c \ coredump.c \ - dbus_eavesdrop.c \ - dbus_message.c \ - dbus_service.c \ deleted.c \ environ.c \ env_check.c \ @@ -115,6 +112,13 @@ ifneq (,$(findstring $(shell uname -i),i SRC+=syscall_ioperm.c syscall_iopl.c endif +#only do dbus if proper libs are installl +ifneq (,$(shell pkg-config --exists dbus-1 && echo TRUE)) +SRC+=dbus_eavesdrop.c dbus_message.c dbus_service.c +else +$(info No dbus pkg-config skipping dbus_eavesdrop dbus_message dbus_services tests ...) +endif + EXEC=$(SRC:%.c=%) TESTS=access \ @@ -128,9 +132,6 @@ TESTS=access \ chdir \ clone \ coredump \ - dbus_eavesdrop \ - dbus_message \ - dbus_service \ deleted \ environ \ exec \ @@ -169,6 +170,11 @@ TESTS=access \ xattrs\ longpath +#only do dbus if proper libs are installl +ifneq (,$(shell pkg-config --exists dbus-1 && echo TRUE)) +TESTS+=dbus_eavesdrop dbus_message dbus_service +endif + # Tests that can crash the kernel should be placed here RISKY_TESTS=
signature.asc
Description: Digital signature
-- AppArmor mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
