Merge remote-tracking branch 'fourplusone/fix/windows-tests'

This commit is contained in:
J. David Ibáñez
2016-10-13 12:26:19 +02:00
2 changed files with 21 additions and 13 deletions

View File

@@ -4,13 +4,15 @@ configuration: Release
environment: environment:
matrix: matrix:
- ARCH: 32 - ARCH: 32
GENERATOR: '"Visual Studio 11"' GENERATOR: 'Visual Studio 11'
PYTHON: '"C:\Python35\python.exe"' PYTHON: 'C:\Python35\python.exe'
PIP: '"C:\Python35\Scripts\pip.exe"' PIP: 'C:\Python35\Scripts\pip.exe'
- ARCH: 64 - ARCH: 64
GENERATOR: '"Visual Studio 11 Win64"' GENERATOR: 'Visual Studio 11 Win64'
PYTHON: '"C:\Python35-x64\python.exe"' PYTHON: 'C:\Python35-x64\python.exe'
PIP: '"C:\Python35-x64\Scripts\pip.exe"' PIP: 'C:\Python35-x64\Scripts\pip.exe'
init:
- cmd: '%PIP% install nose wheel'
build_script: build_script:
- cmd: | - cmd: |
set LIBGIT2=%APPVEYOR_BUILD_FOLDER%\build\libgit2 set LIBGIT2=%APPVEYOR_BUILD_FOLDER%\build\libgit2
@@ -18,15 +20,19 @@ build_script:
mkdir build mkdir build
cd build cd build
cmake -DSTDCALL=OFF -DBUILD_CLAR=OFF -DCMAKE_INSTALL_PREFIX=%LIBGIT2% ../libgit2 -G %GENERATOR% cmake -DSTDCALL=OFF -DBUILD_CLAR=OFF -DCMAKE_INSTALL_PREFIX="%LIBGIT2%" ../libgit2 -G "%GENERATOR%"
cmake --build . --config Release --target install cmake --build . --config Release --target install
cd .. cd ..
%PIP% install wheel "%PYTHON%" setup.py bdist_wheel
%PYTHON% setup.py bdist_wheel "%PIP%" install .
%PIP% install .
test_script: test_script:
- cmd: '%PYTHON% setup.py test' - ps: |
cp build\Release\git2.dll .
try { & $env:PYTHON setup.py nosetests --with-xunit } catch {}
# upload results to AppVeyor
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/xunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nosetests.xml))
artifacts: artifacts:
- path: dist\*.whl - path: dist\*.whl

View File

@@ -35,6 +35,7 @@ import tarfile
import tempfile import tempfile
import unittest import unittest
import hashlib import hashlib
import gc
import pygit2 import pygit2
@@ -94,6 +95,7 @@ class NoRepoTestCase(unittest.TestCase):
def tearDown(self): def tearDown(self):
del self.repo del self.repo
gc.collect()
rmtree(self._temp_dir) rmtree(self._temp_dir)
def assertRaisesAssign(self, exc_class, instance, name, value): def assertRaisesAssign(self, exc_class, instance, name, value):
@@ -132,8 +134,8 @@ class AutoRepoTestCase(NoRepoTestCase):
self.repo = pygit2.Repository(self.repo_path) self.repo = pygit2.Repository(self.repo_path)
def tearDown(self): def tearDown(self):
self.repo_ctxtmgr.__exit__(None, None, None)
super(AutoRepoTestCase, self).tearDown() super(AutoRepoTestCase, self).tearDown()
self.repo_ctxtmgr.__exit__(None, None, None)
class BareRepoTestCase(AutoRepoTestCase): class BareRepoTestCase(AutoRepoTestCase):