mirror of
https://github.com/henrydcase/pqc.git
synced 2024-11-22 23:48:58 +00:00
78a65d6ec9
* Do tests with pytest to run them in parallel * attempt to handle merge commits better for PR test path Similar to how we solved this for travis * Clean up imports * don't run valgrind if not specified slow_test * Fix functest after initializer rename * upload tests results as junit * Upload test-common files since #200 got merged * Catch test results upload failure
34 lines
732 B
Python
34 lines
732 B
Python
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)
|