Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
windows tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
spirit1317 committed Dec 3, 2020
1 parent 22563dc commit 25012e9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
18 changes: 17 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ init:
- cmd: if /I %platform%==win32 7z -y x libtango_%cpptango_version%_%MSVCVERSION%_x86.zip -oC:\projects\libtango\
- cmd: if /I %platform%==x64 7z -y x libtango_%cpptango_version%_%MSVCVERSION%_x64.zip -oC:\projects\libtango\

# TangoTest
- cmd: cd "C:\projects\"
- cmd: md tango_test
- cmd: cd "C:\projects\tango_test"
- appveyor DownloadFile https://github.com/spirit1317/tango-test-exe/raw/main/TangoTest.exe
- cmd: path=C:\projects\tango_test;%path%

# boost
- cmd: cd "C:\projects\"
- appveyor DownloadFile %boost_download_base%/%boost_version%/boost-python-%boost_version%_%ARCH%_py%PYTHON_VER%.zip
Expand Down Expand Up @@ -124,8 +131,17 @@ build_script:
- cmd: cd C:/projects/pytango
- cmake --build ./ -j 4 --config Release

test_script:
- "%PYTHON_ROOT%/Scripts/pip.exe install gevent pytest psutil six numpy"
- cmd: if %PYTHON_VER%==27 "%PYTHON_ROOT%/Scripts/pip.exe" install enum34 futures trollius zipp
- cmd: cd "C:\projects\pytango"
- cmd: nul > pytest_empty_config.txt
- "%PYTHON_ROOT%/Scripts/pytest.exe -c pytest_empty_config.txt --collect-only -q -q tests"
- cmd: cd "C:\projects\pytango\tests"
- cmd: path=%PYTHON_ROOT%\Scripts;%path%
- cmd: run_tests_win.bat

after_build:
after_test:
- cmd: cd C:/projects/pytango/dist
- cmd: dir
- cmd: cd C:/projects/pytango
Expand Down
19 changes: 19 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,23 @@

from tango.test_utils import state, typed_values, server_green_mode

import pytest

import sys
import os
import json

__all__ = ('state', 'typed_values', 'server_green_mode')

@pytest.hookimpl()
def pytest_sessionfinish(session):
""" collets all tests to be run and outputs to bat script """
if '--collect-only' in sys.argv and '-q' in sys.argv and 'nt' in os.name:
print("Generating windows test script...")
script_path = os.path.join(os.path.dirname(__file__),'run_tests_win.bat')
with open(script_path,"w") as f:
f.write("REM this script will run all tests separately.")
for item in session.items:
f.write("\n")
f.write("pytest -c ../pytest_empty_config.txt ")#this empty file is created by appveyor
f.write(item.nodeid)

0 comments on commit 25012e9

Please sign in to comment.