Revision 81a0bf97e2012c369f800f26e2e3d3651cde7a35 authored by Matthias J. Kannwischer on 29 July 2021, 07:22:18 UTC, committed by Matthias J. Kannwischer on 02 August 2021, 03:06:46 UTC
1 parent 819f906
test_api_h.py
import os
import re
import pytest
import helpers
import pqclean
pattern = re.compile(r'^\s*#include\s*"')
@pytest.mark.parametrize(
'implementation',
pqclean.Scheme.all_implementations(),
ids=str,
)
@helpers.filtered_test
def test_api_h(implementation: pqclean.Implementation):
apipath = os.path.join(implementation.path(), 'api.h')
errors = []
with open(apipath) as f:
for i, line in enumerate(f):
if pattern.match(line):
errors.append("\n at {}:{}".format(apipath, i+1))
if errors:
raise AssertionError(
"Prohibited external include in api.h" + "".join(errors)
)
if __name__ == '__main__':
import sys
pytest.main(sys.argv)

Computing file changes ...