configuration:
  - Debug
  - Release

environment:
  CTEST_OUTPUT_ON_FAILURE: TRUE

init:
  - del "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets"

install:
# Initialize git submodules
  - git submodule update --init
# Download and setup Criterion unit testing framework.
  - cd %APPVEYOR_BUILD_FOLDER%
  - mkdir dependencies
  - cd dependencies
  - ps: wget https://github.com/Snaipe/Criterion/releases/download/v2.2.2/criterion-v2.2.2-windows-msvc-x64.tar.bz2 -o criterion.tar.bz2
  - 7z x criterion.tar.bz2
  - 7z x criterion.tar
  - move criterion-v2.2.2\bin .
  - move criterion-v2.2.2\include .
  - move criterion-v2.2.2\lib .
  - set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\dependencies\bin

build_script:
  - cd %APPVEYOR_BUILD_FOLDER%
  - mkdir build
  - cd build
  - cmake ..
  - cmake --build . --config %configuration%
  - ctest
  
configuration:
  - Debug
  - Release

environment:
  CTEST_OUTPUT_ON_FAILURE: TRUE

init:
  - del "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets"

install:
# Initialize git submodules
  - git submodule update --init
# Download and setup Criterion unit testing framework.
  - cd %APPVEYOR_BUILD_FOLDER%
  - mkdir dependencies
  - cd dependencies
  - ps: wget https://github.com/Snaipe/Criterion/releases/download/v2.2.2/criterion-v2.2.2-windows-msvc-x64.tar.bz2 -o criterion.tar.bz2
  - 7z x criterion.tar.bz2
  - 7z x criterion.tar
  - move criterion-v2.2.2\bin .
  - move criterion-v2.2.2\include .
  - move criterion-v2.2.2\lib .
  - set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\dependencies\bin

build_script:
  - cd %APPVEYOR_BUILD_FOLDER%
  - mkdir build
  - cd build
  - cmake ..
  - cmake --build . --config %configuration%
  # Criterion assertions can't be used with the Release configuration, it
  # causes errors. So we only execute `ctest` on other configurations.
  - ps: if($env:configuration -ne "Release") { ctest }
  
Disable `ctest` on Appveyor with Release build
Disable `ctest` on Appveyor with Release build

Criterion assertions can't be used with the Release configuration, it
causes errors. So we only execute `ctest` on other configurations.
