version: "{build}"
platform: x64
environment:
  matrix:
  # MSVC
  - GENERATOR: Visual Studio 15 2017 Win64
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
configuration:
  - Debug
  - Release
clone_folder: C:\projects\uncrustify
branches:
  only:
    - master
clone_depth: 10
skip_tags: true
#init:
#  - echo This is for test only
#  - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

install:
  - "SET PATH=C:/Python35-x64;C:/Python35-x64/Scripts;%PATH%"
before_build:
  - cd c:\projects\uncrustify
  - mkdir build
  - cd build
  - cmake -DUNCRUSTIFY_SEPARATE_TESTS=ON -G "%GENERATOR%" ..
build_script:
  - for /f %%i in ('wmic cpu get NumberOfCores ^| findstr [0-9]') do set CORES=%%i
  - cmake --build . --config %CONFIGURATION% --parallel %CORES%
test_script:
#  - echo This is for test only
#  - C:/projects/uncrustify/build/Debug/uncrustify.exe -c C:/projects/uncrustify/tests/config/mono.cfg -f C:/projects/uncrustify/tests/input/cs/simple.cs -L 66
  - set PYTHONIOENCODING=utf-8
  - for /f %%i in ('wmic cpu get NumberOfCores ^| findstr [0-9]') do set CORES=%%i
  - python ../scripts/run_ctest.py -- -j %CORES% -C %CONFIGURATION%
deploy: off
