diff --git a/src/linux/Makefile.am b/src/linux/Makefile.am index 446fc0f..1edc31d 100644 --- a/src/linux/Makefile.am +++ b/src/linux/Makefile.am @@ -49,6 +49,13 @@ EXTRA_DIST = $(libupshared_la_SOURCES) libupshared_la_CFLAGS = \ $(WARNINGFLAGS_C) +if UP_BUILD_TESTS +DBUS_LAUNCH=$(shell which dbus-launch) + +check-local: $(top_builddir)/src/upowerd + env top_builddir=$(top_builddir) $(DBUS_LAUNCH) ./integration-test -v +endif + clean-local : rm -f *~ diff --git a/src/linux/integration-test b/src/linux/integration-test index 3a9997f..c4c8f8d 100755 --- a/src/linux/integration-test +++ b/src/linux/integration-test @@ -40,8 +40,9 @@ class Tests(unittest.TestCase): @classmethod def setUpClass(cls): # run from local build tree if we are in one, otherwise use system instance - if os.access (os.path.join('src', 'upowerd'), os.X_OK): - daemon_path = os.path.join('src', 'upowerd') + builddir = os.getenv('top_builddir', '.') + if os.access (os.path.join(builddir, 'src', 'upowerd'), os.X_OK): + daemon_path = os.path.join(builddir, 'src', 'upowerd') print('Testing binaries from local build tree') else: print('Testing installed system binaries')