mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 06:49:25 +00:00
appveyor CI script
This commit is contained in:
@@ -4,7 +4,11 @@ import sys
|
||||
sys.path.append('.')
|
||||
|
||||
import example
|
||||
import numpy as np
|
||||
try:
|
||||
import numpy as np
|
||||
except ImportError:
|
||||
print('NumPy missing')
|
||||
exit(0)
|
||||
|
||||
from example import vectorized_func
|
||||
from example import vectorized_func2
|
||||
|
||||
@@ -4,7 +4,12 @@ import sys
|
||||
sys.path.append('.')
|
||||
|
||||
from example import Matrix
|
||||
import numpy as np
|
||||
|
||||
try:
|
||||
import numpy as np
|
||||
except ImportError:
|
||||
print('NumPy missing')
|
||||
exit(0)
|
||||
|
||||
m = Matrix(5, 5)
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@ def sanitize(lines):
|
||||
line = line.strip()
|
||||
if sys.platform == 'win32':
|
||||
lower = line.lower()
|
||||
if 'constructor' in lower or 'destructor' in lower or 'ref' in lower:
|
||||
if 'constructor' in lower or 'destructor' in lower \
|
||||
or 'ref' in lower:
|
||||
line = ""
|
||||
lines[i] = line
|
||||
|
||||
@@ -40,11 +41,16 @@ if path != '':
|
||||
os.chdir(path)
|
||||
|
||||
name = sys.argv[1]
|
||||
output_bytes = subprocess.check_output([sys.executable, name + ".py"])
|
||||
output_bytes = subprocess.check_output([sys.executable, name + ".py"],
|
||||
stderr=subprocess.STDOUT)
|
||||
|
||||
output = sanitize(output_bytes.decode('utf-8'))
|
||||
reference = sanitize(open(name + '.ref', 'r').read())
|
||||
|
||||
if output == reference:
|
||||
if 'NumPy missing' in output:
|
||||
print('Test "%s" could not be run.' % name)
|
||||
exit(0)
|
||||
elif output == reference:
|
||||
print('Test "%s" succeeded.' % name)
|
||||
exit(0)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user