pqc/test/test_format.py

33 linhas
804 B
Python
Original Visão normal Histórico

import shutil
import unittest
2019-02-27 14:50:25 +00:00
import pqclean
from helpers import run_subprocess
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):
if shutil.which('astyle') is None:
raise unittest.SkipTest("AStyle is not installed")
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()