run-hid-tools-tests.sh 758 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0
  3. # Runs tests for the HID subsystem
  4. KSELFTEST_SKIP_TEST=4
  5. if ! command -v python3 > /dev/null 2>&1; then
  6. echo "hid-tools: [SKIP] python3 not installed"
  7. exit $KSELFTEST_SKIP_TEST
  8. fi
  9. if ! python3 -c "import pytest" > /dev/null 2>&1; then
  10. echo "hid: [SKIP] pytest module not installed"
  11. exit $KSELFTEST_SKIP_TEST
  12. fi
  13. if ! python3 -c "import pytest_tap" > /dev/null 2>&1; then
  14. echo "hid: [SKIP] pytest_tap module not installed"
  15. exit $KSELFTEST_SKIP_TEST
  16. fi
  17. if ! python3 -c "import hidtools" > /dev/null 2>&1; then
  18. echo "hid: [SKIP] hid-tools module not installed"
  19. exit $KSELFTEST_SKIP_TEST
  20. fi
  21. TARGET=${TARGET:=.}
  22. echo TAP version 13
  23. python3 -u -m pytest $PYTEST_XDIST ./tests/$TARGET --tap-stream --udevd