mirror of
https://github.com/henrydcase/pqc.git
synced 2024-11-22 23:48:58 +00:00
65d43df241
This way we can properly raise skiptest
32 lines
738 B
Python
32 lines
738 B
Python
import helpers
|
|
import pqclean
|
|
|
|
|
|
def test_formatting():
|
|
for scheme in pqclean.Scheme.all_schemes():
|
|
for implementation in scheme.implementations:
|
|
yield check_format, implementation
|
|
|
|
|
|
@helpers.filtered_test
|
|
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))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
try:
|
|
import nose2
|
|
nose2.main()
|
|
except ImportError:
|
|
import nose
|
|
nose.runmodule()
|