run_tests.py 627 B

1234567891011121314151617181920212223
  1. import os
  2. singletypepath = 'tests/singletype'
  3. mixedtypepath = 'tests/mixedtype'
  4. def test_file(filepath):
  5. return os.system("./pocketpy " + filepath) == 0
  6. #return os.system("python3 " + filepath) == 0
  7. def test_dir(path):
  8. print("=" * 50)
  9. for filename in os.listdir(path):
  10. if filename.endswith('.py'):
  11. filepath = os.path.join(path, filename)
  12. code = test_file(filepath)
  13. if not code:
  14. print("[x] " + filepath)
  15. else:
  16. print("[√] " + filepath)
  17. if __name__ == '__main__':
  18. test_dir(singletypepath)
  19. test_dir(mixedtypepath)