1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-30 03:11:43 +00:00
pqcrypto/test/test_format.py

32 lines
738 B
Python
Raw Normal View History

import helpers
2019-02-27 14:50:25 +00:00
import pqclean
def test_formatting():
for scheme in pqclean.Scheme.all_schemes():
for implementation in scheme.implementations:
yield check_format, implementation
2019-02-27 14:50:25 +00:00
@helpers.filtered_test
2019-02-27 14:50:25 +00:00
def check_format(implementation: pqclean.Implementation):
helpers.ensure_available('astyle')
cfiles = implementation.cfiles()
hfiles = implementation.hfiles()
result = helpers.run_subprocess(
['astyle',
'--dry-run',
'--options=../.astylerc',
*cfiles,
*hfiles])
assert(not('Formatted' in result))
2019-02-27 14:50:25 +00:00
if __name__ == "__main__":
try:
import nose2
nose2.main()
except ImportError:
import nose
nose.runmodule()