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.

32 lines
738 B

  1. import helpers
  2. import pqclean
  3. def test_formatting():
  4. for scheme in pqclean.Scheme.all_schemes():
  5. for implementation in scheme.implementations:
  6. yield check_format, implementation
  7. @helpers.filtered_test
  8. def check_format(implementation: pqclean.Implementation):
  9. helpers.ensure_available('astyle')
  10. cfiles = implementation.cfiles()
  11. hfiles = implementation.hfiles()
  12. result = helpers.run_subprocess(
  13. ['astyle',
  14. '--dry-run',
  15. '--options=../.astylerc',
  16. *cfiles,
  17. *hfiles])
  18. assert(not('Formatted' in result))
  19. if __name__ == "__main__":
  20. try:
  21. import nose2
  22. nose2.main()
  23. except ImportError:
  24. import nose
  25. nose.runmodule()