Run AStyle if it is installed
Also try to install it on AppVeyor
This commit is contained in:
parent
7e9cabdee2
commit
ff186b3dd6
@ -12,7 +12,12 @@ environment:
|
|||||||
|
|
||||||
init:
|
init:
|
||||||
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%BITS%.bat"
|
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%BITS%.bat"
|
||||||
- set PATH="C:\\Python37";%PATH%
|
- set PATH="C:\\Python37";"C:\\Python37\Scripts";"C:\\tmp\\tools";%PATH%
|
||||||
|
- mkdir "C:\tmp\tools"
|
||||||
|
# Download AStyle 3.1: first enable strong crypto in Invoke-WebRequest
|
||||||
|
- ps: Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319" -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
|
||||||
|
- ps: Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319" -Name "SchUseStrongCrypto" -Value '1' -Type DWord
|
||||||
|
- ps: Invoke-WebRequest -OutFile "C:\tmp\tools\AStyle.exe" "https://rded.nl/pqclean/AStyle.exe"
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- python -m pip install -r requirements.txt
|
- python -m pip install -r requirements.txt
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import os
|
import shutil
|
||||||
from glob import glob
|
import unittest
|
||||||
|
|
||||||
import pqclean
|
import pqclean
|
||||||
from helpers import run_subprocess, skip_windows
|
from helpers import run_subprocess
|
||||||
|
|
||||||
|
|
||||||
def test_formatting():
|
def test_formatting():
|
||||||
@ -11,11 +11,11 @@ def test_formatting():
|
|||||||
yield check_format, implementation
|
yield check_format, implementation
|
||||||
|
|
||||||
|
|
||||||
@skip_windows(message="This test needs to be amended to work with Windows "
|
|
||||||
"installations of astyle")
|
|
||||||
def check_format(implementation: pqclean.Implementation):
|
def check_format(implementation: pqclean.Implementation):
|
||||||
cfiles = glob(os.path.join(implementation.path(), '*.c'))
|
if shutil.which('astyle') is None:
|
||||||
hfiles = glob(os.path.join(implementation.path(), '*.h'))
|
raise unittest.SkipTest("AStyle is not installed")
|
||||||
|
cfiles = implementation.cfiles()
|
||||||
|
hfiles = implementation.hfiles()
|
||||||
run_subprocess(['astyle',
|
run_subprocess(['astyle',
|
||||||
'--dry-run',
|
'--dry-run',
|
||||||
'--options=../.astylerc',
|
'--options=../.astylerc',
|
||||||
|
Loading…
Reference in New Issue
Block a user