2019-02-27 14:50:25 +00:00
|
|
|
import pqclean
|
2019-03-06 16:24:02 +00:00
|
|
|
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):
|
2019-03-06 16:24:02 +00:00
|
|
|
ensure_available('astyle')
|
2019-03-05 13:35:19 +00:00
|
|
|
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()
|