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:
parent
e244787e87
commit
15bd2d4fb4
@ -26,7 +26,7 @@ build_script:
|
||||
- git fetch --all
|
||||
- git checkout %APPVEYOR_REPO_BRANCH%
|
||||
- git reset --hard %APPVEYOR_REPO_COMMIT%
|
||||
- git diff ..origin/master
|
||||
- git diff --name-only origin/master
|
||||
- python -m pip install -r requirements.txt
|
||||
- cd test
|
||||
# Download Astyle to local folder because putting it in PATH doesn't work
|
||||
|
@ -145,12 +145,13 @@ def permit_test(testname, thing, *args, **kwargs):
|
||||
|
||||
if 'PQCLEAN_ONLY_DIFF' in os.environ:
|
||||
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
|
||||
branch_result = subprocess.run(
|
||||
['git', 'status', '--porcelain=2', '--branch'],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT
|
||||
stderr=subprocess.STDOUT,
|
||||
cwd="..",
|
||||
)
|
||||
# ensure we're in a working directory
|
||||
if branch_result.returncode != 0:
|
||||
@ -167,11 +168,14 @@ def permit_test(testname, thing, *args, **kwargs):
|
||||
stdout=subprocess.PIPE,
|
||||
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():
|
||||
# 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')):
|
||||
logging.info("Running all tests as there are changes outside of schemes")
|
||||
if (not diff_line.startswith('crypto_kem') and
|
||||
not diff_line.startswith('crypto_sign')):
|
||||
logging.info("Running all tests as there are changes "
|
||||
"outside of schemes")
|
||||
return True
|
||||
# do test if the scheme in question has been changed
|
||||
if diff_line.startswith(thing.path(base='')):
|
||||
|
@ -9,7 +9,7 @@ import unittest
|
||||
import yaml
|
||||
|
||||
|
||||
def skipped_test(*args, **kwargs):
|
||||
def _skipped_test(*args, **kwargs):
|
||||
raise unittest.SkipTest("Skipped consistency check")
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ def test_duplicate_consistency():
|
||||
for implementation in scheme.implementations:
|
||||
if not helpers.permit_test('duplicate_consistency',
|
||||
implementation):
|
||||
yield skipped_test, implementation
|
||||
yield _skipped_test, implementation
|
||||
continue
|
||||
|
||||
if os.path.isfile(
|
||||
|
Loading…
Reference in New Issue
Block a user