mirror of
https://github.com/henrydcase/pqc.git
synced 2024-11-29 19:01:22 +00:00
31 lines
758 B
Python
31 lines
758 B
Python
|
import os
|
||
|
from glob import glob
|
||
|
|
||
|
import pqclean
|
||
|
from helpers import run_subprocess
|
||
|
|
||
|
|
||
|
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):
|
||
|
cfiles = glob(os.path.join(implementation.path(), '*.c'))
|
||
|
hfiles = glob(os.path.join(implementation.path(), '*.h'))
|
||
|
run_subprocess(['astyle',
|
||
|
'--dry-run',
|
||
|
'--options=../.astylerc',
|
||
|
*cfiles,
|
||
|
*hfiles])
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
try:
|
||
|
import nose2
|
||
|
nose2.main()
|
||
|
except ImportError:
|
||
|
import nose
|
||
|
nose.runmodule()
|