You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
801 B

  1. #!/usr/bin/env python3
  2. import os
  3. import sys
  4. import subprocess
  5. if len(sys.argv) != 2:
  6. print('usage: run-test <mergerfs-path>\n',file=sys.stderr)
  7. sys.exit(1)
  8. test_path = os.path.realpath(sys.argv[0])
  9. test_path = os.path.dirname(test_path)
  10. for entry in os.scandir(test_path):
  11. if not entry.name.startswith('TEST_'):
  12. continue
  13. try:
  14. print(entry.name + ': ',end='')
  15. fullpath = os.path.join(test_path,entry.name)
  16. args = [fullpath,sys.argv[1]]
  17. rv = subprocess.Popen(args,stdout=subprocess.PIPE)
  18. rv.wait(timeout=10000)
  19. if rv.returncode:
  20. output = rv.stdout.read().decode()
  21. print('FAIL - {}'.format(output))
  22. else:
  23. print('PASS')
  24. except Exception as e:
  25. print('FAIL - {}'.format(e))