Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

69 lignes
1.8 KiB

  1. #!/usr/bin/env python3
  2. """Read all test files for a particular file format using a single
  3. importer instance. Read them again in reversed order. This is used
  4. to verify that a loader does proper cleanup and can be called
  5. repeatedly."""
  6. import sys
  7. import os
  8. import subprocess
  9. # hack-load utils.py and settings.py from ../regression
  10. sys.path.append(os.path.join('..','regression'))
  11. import utils
  12. import settings
  13. def process_dir(thisdir):
  14. """Process /thisdir/ recursively"""
  15. res = []
  16. shellparams = {'stdin':subprocess.PIPE,'stdout':sys.stdout,'shell':True}
  17. command = [utils.assimp_bin_path,"testbatchload"]
  18. for f in os.listdir(thisdir):
  19. if os.path.splitext(f)[-1] in settings.exclude_extensions:
  20. continue
  21. fullpath = os.path.join(thisdir, f)
  22. if os.path.isdir(fullpath):
  23. if f != ".svn":
  24. res += process_dir(fullpath)
  25. continue
  26. # import twice, importing the same file again introduces extra risk
  27. # to crash due to garbage data lying around in the importer.
  28. command.append(fullpath)
  29. command.append(fullpath)
  30. if len(command)>2:
  31. # testbatchload returns always 0 if more than one file in the list worked.
  32. # however, if it should segfault, the OS will return something not 0.
  33. command += reversed(command[2:])
  34. if subprocess.call(command, **shellparams):
  35. res.append(thisdir)
  36. return res
  37. def main():
  38. """Run the test on all registered test repositories"""
  39. utils.find_assimp_or_die()
  40. res = []
  41. for tp in settings.model_directories:
  42. res += process_dir(tp)
  43. [print(f) for f in res]
  44. return 0
  45. if __name__ == '__main__':
  46. res = main()
  47. input('All done, waiting for keystroke ')
  48. sys.exit(res)
  49. # vim: ai ts=4 sts=4 et sw=4