1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-26 09:21:28 +00:00

another attempt at fixing appveyor

This commit is contained in:
Thom Wiggers 2019-04-18 10:42:09 +02:00
parent e244787e87
commit 15bd2d4fb4
No known key found for this signature in database
GPG Key ID: 001BB0A7CE26E363
3 changed files with 12 additions and 8 deletions

View File

@ -26,7 +26,7 @@ build_script:
- git fetch --all - git fetch --all
- git checkout %APPVEYOR_REPO_BRANCH% - git checkout %APPVEYOR_REPO_BRANCH%
- git reset --hard %APPVEYOR_REPO_COMMIT% - git reset --hard %APPVEYOR_REPO_COMMIT%
- git diff ..origin/master - git diff --name-only origin/master
- python -m pip install -r requirements.txt - python -m pip install -r requirements.txt
- cd test - cd test
# Download Astyle to local folder because putting it in PATH doesn't work # Download Astyle to local folder because putting it in PATH doesn't work

View File

@ -145,12 +145,13 @@ def permit_test(testname, thing, *args, **kwargs):
if 'PQCLEAN_ONLY_DIFF' in os.environ: if 'PQCLEAN_ONLY_DIFF' in os.environ:
if shutil.which('git') is not None: if shutil.which('git') is not None:
# if we're on a non-master branch, and the only changes are in schemes, # if we're on a non-master branch, and the only changes are in schemes,
# only run tests on those schemes # only run tests on those schemes
branch_result = subprocess.run( branch_result = subprocess.run(
['git', 'status', '--porcelain=2', '--branch'], ['git', 'status', '--porcelain=2', '--branch'],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT stderr=subprocess.STDOUT,
cwd="..",
) )
# ensure we're in a working directory # ensure we're in a working directory
if branch_result.returncode != 0: if branch_result.returncode != 0:
@ -167,11 +168,14 @@ def permit_test(testname, thing, *args, **kwargs):
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT stderr=subprocess.STDOUT
) )
assert(diff_result.returncode == 0), "Got unexpected return code {}".format(diff_result.returncode) assert diff_result.returncode == 0, \
"Got unexpected return code {}".format(diff_result.returncode)
for diff_line in diff_result.stdout.decode('utf-8').splitlines(): for diff_line in diff_result.stdout.decode('utf-8').splitlines():
# don't skip test if there are any changes outside schemes # don't skip test if there are any changes outside schemes
if not(diff_line.startswith('crypto_kem')) and not (diff_line.startswith('crypto_sign')): if (not diff_line.startswith('crypto_kem') and
logging.info("Running all tests as there are changes outside of schemes") not diff_line.startswith('crypto_sign')):
logging.info("Running all tests as there are changes "
"outside of schemes")
return True return True
# do test if the scheme in question has been changed # do test if the scheme in question has been changed
if diff_line.startswith(thing.path(base='')): if diff_line.startswith(thing.path(base='')):

View File

@ -9,7 +9,7 @@ import unittest
import yaml import yaml
def skipped_test(*args, **kwargs): def _skipped_test(*args, **kwargs):
raise unittest.SkipTest("Skipped consistency check") raise unittest.SkipTest("Skipped consistency check")
@ -18,7 +18,7 @@ def test_duplicate_consistency():
for implementation in scheme.implementations: for implementation in scheme.implementations:
if not helpers.permit_test('duplicate_consistency', if not helpers.permit_test('duplicate_consistency',
implementation): implementation):
yield skipped_test, implementation yield _skipped_test, implementation
continue continue
if os.path.isfile( if os.path.isfile(