mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2025-12-20 04:20:04 +01:00
tests: Return 77 when skipping tests
77 is the special value meaning that the test was skipped. Both meson make check will display the information correctly. Note that the test is currently executed directly in check-local. So add a workaround to ignore the 77 error code and exit 0 instead in that case.
This commit is contained in:
parent
fbbcb0c03f
commit
46ed299451
2 changed files with 6 additions and 4 deletions
|
|
@ -105,7 +105,9 @@ if UP_BUILD_TESTS
|
|||
check-local: upowerd
|
||||
# To launch a single test
|
||||
# env GI_TYPELIB_PATH=$(top_builddir)/libupower-glib:$(GI_TYPELIB_PATH) LD_LIBRARY_PATH=$(top_builddir)/libupower-glib/.libs:$(LD_LIBRARY_PATH) top_builddir=$(top_builddir) $(srcdir)/linux/integration-test -v Tests.test_bluetooth_le_mouse
|
||||
env GI_TYPELIB_PATH=$(top_builddir)/libupower-glib:$(GI_TYPELIB_PATH) LD_LIBRARY_PATH=$(top_builddir)/libupower-glib/.libs:$(LD_LIBRARY_PATH) top_builddir=$(top_builddir) $(srcdir)/linux/integration-test -v
|
||||
env GI_TYPELIB_PATH=$(top_builddir)/libupower-glib:$(GI_TYPELIB_PATH) LD_LIBRARY_PATH=$(top_builddir)/libupower-glib/.libs:$(LD_LIBRARY_PATH) top_builddir=$(top_builddir) $(srcdir)/linux/integration-test -v; \
|
||||
res=$$?; test $$res -eq 77 && res=0; \
|
||||
exit $$res
|
||||
endif
|
||||
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -34,20 +34,20 @@ try:
|
|||
from gi.repository import UPowerGlib
|
||||
except ImportError as e:
|
||||
sys.stderr.write('Skipping tests, PyGobject not available for Python 3, or missing GI typelibs: %s\n' % str(e))
|
||||
sys.exit(0)
|
||||
sys.exit(77)
|
||||
|
||||
try:
|
||||
gi.require_version('UMockdev', '1.0')
|
||||
from gi.repository import UMockdev
|
||||
except ImportError:
|
||||
sys.stderr.write('Skipping tests, umockdev not available (https://github.com/martinpitt/umockdev)\n')
|
||||
sys.exit(0)
|
||||
sys.exit(77)
|
||||
|
||||
try:
|
||||
import dbusmock
|
||||
except ImportError:
|
||||
sys.stderr.write('Skipping tests, python-dbusmock not available (http://pypi.python.org/pypi/python-dbusmock).\n')
|
||||
sys.exit(0)
|
||||
sys.exit(77)
|
||||
|
||||
|
||||
UP = 'org.freedesktop.UPower'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue