2019-04-10 15:02:45 +01:00
|
|
|
"""
|
|
|
|
Runs functional tests for common crypto functions (e.g., fips202, sha2, aes).
|
2019-07-29 09:38:25 +01:00
|
|
|
|
|
|
|
Doesn't currently need isolation for parallelisation
|
2019-04-10 15:02:45 +01:00
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
|
|
|
|
import helpers
|
|
|
|
|
|
|
|
|
2019-07-29 09:38:25 +01:00
|
|
|
def pytest_generate_tests(metafunc):
|
|
|
|
argvalues = []
|
2019-07-26 09:26:14 +01:00
|
|
|
for d in os.listdir('test_common'):
|
2019-04-10 15:34:44 +01:00
|
|
|
primitive = re.sub(r"\.c$", "", d)
|
2019-07-29 09:38:25 +01:00
|
|
|
argvalues.append(primitive)
|
|
|
|
metafunc.parametrize('primitive', argvalues)
|
2019-04-10 15:42:28 +01:00
|
|
|
|
|
|
|
|
2019-07-29 09:38:25 +01:00
|
|
|
@helpers.skip_windows()
|
|
|
|
@helpers.filtered_test
|
|
|
|
def test_common(primitive):
|
2019-04-11 08:54:52 +01:00
|
|
|
binname = os.path.join('..', 'bin', 'test_common_'+primitive)
|
2019-04-10 15:42:28 +01:00
|
|
|
helpers.make(binname)
|
|
|
|
helpers.run_subprocess([binname])
|
2019-04-10 15:02:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2019-07-29 09:38:25 +01:00
|
|
|
import pytest
|
|
|
|
import sys
|
|
|
|
pytest.main(sys.argv)
|