__main__.py 899 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python
  2. #
  3. # Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
  4. # Copyright (c) 2018-2024 The Uncertainty Quantification Foundation.
  5. # License: 3-clause BSD. The full license text is available at:
  6. # - https://github.com/uqfoundation/dill/blob/master/LICENSE
  7. import glob
  8. import os
  9. import sys
  10. import subprocess as sp
  11. python = sys.executable
  12. try:
  13. import pox
  14. python = pox.which_python(version=True) or python
  15. except ImportError:
  16. pass
  17. shell = sys.platform[:3] == 'win'
  18. suite = os.path.dirname(__file__) or os.path.curdir
  19. tests = glob.glob(suite + os.path.sep + 'test_*.py')
  20. if __name__ == '__main__':
  21. failed = 0
  22. for test in tests:
  23. p = sp.Popen([python, test], shell=shell).wait()
  24. if p:
  25. print('F', end='', flush=True)
  26. failed = 1
  27. else:
  28. print('.', end='', flush=True)
  29. print('')
  30. exit(failed)