1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-27 01:41:40 +00:00
pqcrypto/test/test_format.py

29 lines
724 B
Python
Raw Normal View History

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