# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Copyright Rene Rivera 2015-2019.

branches:
  only:
    - /master.*/
    - /develop.*/
    - /feature\/.*/

environment:
  matrix:
  - TOOLSET: gcc
    APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
    TEST_TOOLSET: gcc
  - TOOLSET: vc141
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
    TEST_TOOLSET: msvc
  - TOOLSET: vc14
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
    TEST_TOOLSET: msvc
  - TOOLSET: vc12
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
    TEST_TOOLSET: msvc
  - TOOLSET: mingw
    CXX: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin\g++.exe
    TEST_TOOLSET: gcc
    CXX_PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw64\bin
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  - TOOLSET: mingw
    CXX: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin\g++.exe
    TEST_TOOLSET: gcc
    CXX_PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  - TOOLSET: mingw
    CXX: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin\g++.exe
    TEST_TOOLSET: gcc
    CXX_PATH: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  - TOOLSET: mingw
    CXX: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin\g++.exe
    TEST_TOOLSET: gcc
    CXX_PATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

configuration:
  - release

install:
  - sh: |
      uname -a
      which g++
      which clang++

build_script:
  - cmd: |
      cd src/engine
      set PATH=%PATH%;%CXX_PATH%
      build.bat %TOOLSET%
      cd ../..
  - sh: |
      cd src/engine
      set PATH=${PATH};${CXX_PATH}
      ./build.sh ${TOOLSET}
      cd ../..

test_script:
  - cmd: |
      cd test
      echo using %TEST_TOOLSET% : : %CXX% ; > %HOME%/user-config.jam
      C:/Python27-x64/python.exe test_all.py %TEST_TOOLSET%
      cd ..
  - sh: |
      cd test
      echo "using ${TEST_TOOLSET} : : ${CXX} ;" > ${HOME}/user-config.jam
      python test_all.py ${TEST_TOOLSET}
      cd ..

after_test:
  - cmd: src\engine\b2.exe --prefix=%HOME%/b2 install
  - sh: src/engine/b2 --prefix=${HOME}/b2 install
