version: build{build}
image: Visual Studio 2017

environment:
  matrix:
    - platform: x86
      configuration: Debug
      OPENSSLDIR: C:\OpenSSL-v11-Win32
    - platform: x64
      configuration: Debug
      OPENSSL64DIR: C:\OpenSSL-v11-Win64
    - platform: x86
      configuration: Release
      OPENSSLDIR: C:\OpenSSL-v11-Win32
    - platform: x64
      configuration: Release
      OPENSSL64DIR: C:\OpenSSL-v11-Win64
matrix:
  allow_failures:
    # For some reason linking picoquicdemo.lib fails with
    # cifra.lib(chash.obj) : error LNK2001: unresolved external symbol __CheckForDebuggerJustMyCode [C:\projects\picoquic\picoquicfirst\picoquicfirst.vcxproj]
    - platform: x64
      configuration: Debug
      OPENSSL64DIR: C:\OpenSSL-v11-Win64

build:
  parallel: true
  project: picoquic.sln

before_build:
  - ps: ci\build_picotls.ps1

test_script:
 - ps: if ($Env:Platform -eq "x64") { cd x64 }
 - ps: cd "$Env:Configuration"
 - ps: vstest.console /logger:Appveyor UnitTest1.dll
 # Alternative to UnitTest1 (apparently running the same tests):
 - ps: .\picoquic_t -n

deploy: off

#on_finish:
#  - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
