pqc/test/test_common.py
Thom Wiggers 133a38b890 Move test support files into tests directory (#200)
* Move test support files into tests directory

* Fix common tests dir in test

* Fix Windows Makefile for common tests

* notrandombytes.obj should be in TEST_COMMON_DIR
2019-07-26 10:26:14 +02:00

32 lines
651 B
Python

"""
Runs functional tests for common crypto functions (e.g., fips202, sha2, aes).
"""
import os
import re
import helpers
@helpers.skip_windows()
def test_common():
for d in os.listdir('test_common'):
primitive = re.sub(r"\.c$", "", d)
if helpers.permit_test('common', None):
yield check_common, primitive
def check_common(primitive):
binname = os.path.join('..', 'bin', 'test_common_'+primitive)
helpers.make(binname)
helpers.run_subprocess([binname])
if __name__ == '__main__':
try:
import nose2
nose2.main()
except ImportError:
import nose
nose.runmodule()