1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-22 23:48:58 +00:00
pqcrypto/test/test_common.py
Thom Wiggers 78a65d6ec9 Parallel tests (#206)
* 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
2019-07-29 10:38:25 +02:00

33 lines
698 B
Python

"""
Runs functional tests for common crypto functions (e.g., fips202, sha2, aes).
Doesn't currently need isolation for parallelisation
"""
import os
import re
import helpers
def pytest_generate_tests(metafunc):
argvalues = []
for d in os.listdir('test_common'):
primitive = re.sub(r"\.c$", "", d)
argvalues.append(primitive)
metafunc.parametrize('primitive', argvalues)
@helpers.skip_windows()
@helpers.filtered_test
def test_common(primitive):
binname = os.path.join('..', 'bin', 'test_common_'+primitive)
helpers.make(binname)
helpers.run_subprocess([binname])
if __name__ == '__main__':
import pytest
import sys
pytest.main(sys.argv)