mirror of
https://github.com/boostorg/predef.git
synced 2025-07-30 11:57:12 +02:00
Move to AZP for testing.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ boost-build.jam
|
||||
project-config.jam
|
||||
*.pyc
|
||||
.vscode/settings.json
|
||||
.vscode/ipch
|
||||
|
129
.travis.yml
129
.travis.yml
@ -1,129 +0,0 @@
|
||||
# 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-2018.
|
||||
|
||||
# Setting up notifications like this is optional as the default behavior
|
||||
# of Travis is to notify the commiter of problems. But setting a specific
|
||||
# recipient this way ensures you get all the communications about the
|
||||
# builds.
|
||||
notifications:
|
||||
email:
|
||||
recipients:
|
||||
- grafikrobot@gmail.com
|
||||
|
||||
# We specify a generic language instead of C++ as Travis sets up
|
||||
# additional environment vars that point to its default toolset
|
||||
# instead of the one we install. The extra env doesn't interfere,
|
||||
# but at the same time it's misleading. So to avoid confusion and
|
||||
# possible unseen side effects we stick with no C++ default setup.
|
||||
language: generic
|
||||
|
||||
# Speficy the default as Linux here, to avoid duplication in the matrix
|
||||
# below. We use Trusty as that's the latest we can use. And it's better
|
||||
# supported by the whole range of C++ toolsets we like to test on.
|
||||
dist: trusty
|
||||
os: linux
|
||||
|
||||
# Because we install our own toolsets and other software we need
|
||||
# to run the sudo support.
|
||||
sudo: required
|
||||
|
||||
# Travis has a long standing bug with their rather complicated
|
||||
# build matrix evaluation that causes empty jobs to be created.
|
||||
# This global matrix entry in combination with the exclusion
|
||||
# below works around that bug. This is the suggested fix from
|
||||
# the Travis support people.
|
||||
env:
|
||||
matrix:
|
||||
- TRAVIS_EMPTY_JOB_WORKAROUND=true
|
||||
|
||||
# This lists all the toolsets we will test with the Boost CI
|
||||
# scripts. Predef needs to check all of them as its job is to
|
||||
# distiguish between all of them. For other libraries you would
|
||||
# want to limit the list to the toolsets that are important
|
||||
# for that.
|
||||
matrix:
|
||||
exclude:
|
||||
- env: TRAVIS_EMPTY_JOB_WORKAROUND=true
|
||||
include:
|
||||
# Check CMake project use support.
|
||||
- env: TEST_CMAKE
|
||||
# Skip all the unneeded steps from the normal unit test jobs
|
||||
install: true
|
||||
before_script: true
|
||||
before_cache: true
|
||||
before_cache: true
|
||||
after_success: true
|
||||
after_failure: true
|
||||
after_script: true
|
||||
# Build CMake simple test project that uses Predef.
|
||||
script:
|
||||
- mkdir __build__ && cd __build__
|
||||
- cmake ../test/test_cmake
|
||||
- cmake --build .
|
||||
|
||||
|
||||
- env: TOOLSET=clang-3.4
|
||||
- env: TOOLSET=clang-3.5
|
||||
- env: TOOLSET=clang-3.6
|
||||
- env: TOOLSET=clang-3.7
|
||||
- env: TOOLSET=clang-3.8
|
||||
- env: TOOLSET=clang-3.9
|
||||
- env: TOOLSET=clang-4.0
|
||||
- env: TOOLSET=clang-5.0
|
||||
- env: TOOLSET=gcc-4.7
|
||||
- env: TOOLSET=gcc-4.8
|
||||
- env: TOOLSET=gcc-4.9
|
||||
- env: TOOLSET=gcc-5
|
||||
- env: TOOLSET=gcc-6
|
||||
- env: TOOLSET=gcc-7
|
||||
- env: TOOLSET=gcc-8
|
||||
- env: TOOLSET=gcc-8 CXXFLAGS=-std=c++03
|
||||
- env: TOOLSET=gcc-8 CXXFLAGS=-std=c++11
|
||||
- env: TOOLSET=gcc-8 CXXFLAGS=-std=c++14
|
||||
- env: TOOLSET=gcc-8 CXXFLAGS=-std=c++17
|
||||
- env: TOOLSET=gcc-8 CXXFLAGS=-std=c++2a
|
||||
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++03
|
||||
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++11
|
||||
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++14
|
||||
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++17
|
||||
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++2a
|
||||
- env: TOOLSET=xcode-6.1
|
||||
os: osx
|
||||
- env: TOOLSET=xcode-6.4
|
||||
os: osx
|
||||
osx_image: xcode6.4
|
||||
- env: TOOLSET=xcode-7.3
|
||||
os: osx
|
||||
osx_image: xcode7.3
|
||||
- env: TOOLSET=xcode-8.3
|
||||
os: osx
|
||||
osx_image: xcode8.3
|
||||
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++03
|
||||
os: osx
|
||||
osx_image: xcode9.4
|
||||
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++11
|
||||
os: osx
|
||||
osx_image: xcode9.4
|
||||
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++14
|
||||
os: osx
|
||||
osx_image: xcode9.4
|
||||
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++17
|
||||
os: osx
|
||||
osx_image: xcode9.4
|
||||
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++2a
|
||||
os: osx
|
||||
osx_image: xcode9.4
|
||||
- env: TOOLSET=xcode-10.0
|
||||
os: osx
|
||||
osx_image: xcode10.0
|
||||
|
||||
install: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" install
|
||||
before_script: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" before_script
|
||||
script: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" script
|
||||
before_cache: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" before_cache
|
||||
after_success: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_success
|
||||
after_failure: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_failure
|
||||
after_script: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_script
|
149
appveyor.yml
149
appveyor.yml
@ -1,149 +0,0 @@
|
||||
# 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-2016.
|
||||
|
||||
# Set up notifications so that the maintainers of the library get
|
||||
# build status messages.
|
||||
notifications:
|
||||
- provider: Email
|
||||
to:
|
||||
- grafikrobot@gmail.com
|
||||
on_build_status_changed: true
|
||||
|
||||
# This lists all the toolsets we will test with the Boost CI
|
||||
# scripts. Predef needs to check all of them as its job is to
|
||||
# distiguish between all of them. For other libraries you would
|
||||
# want to limit the list to the toolsets that are important
|
||||
# for that.
|
||||
#
|
||||
# This also includes setting up how to create the cache. We
|
||||
# opt for slightly better compression and solid archives.
|
||||
# As we have a lot of files in the boost tree which is what
|
||||
# we are putting in the cache.
|
||||
environment:
|
||||
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma2 -mx=3
|
||||
matrix:
|
||||
- TOOLSET: vs-2008
|
||||
platform: 32
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: vs-2010
|
||||
platform: 32
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: vs-2012
|
||||
platform: 32
|
||||
- TOOLSET: vs-2012
|
||||
COMMENT: UWP DESKTOP
|
||||
CXXFLAGS: /D_WIN32_WINNT=0x0602 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
|
||||
platform: 32
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: vs-2012
|
||||
COMMENT: UWP STORE
|
||||
CXXFLAGS: /D_WIN32_WINNT=0x0602 /DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
||||
platform: 32
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: vs-2013
|
||||
platform: 32
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: vs-2013
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: vs-2013
|
||||
COMMENT: UWP DESKTOP
|
||||
CXXFLAGS: /D_WIN32_WINNT=0x0603 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: vs-2013
|
||||
COMMENT: UWP PHONE
|
||||
CXXFLAGS: /D_WIN32_WINNT=0x0603 /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: vs-2013
|
||||
COMMENT: UWP STORE
|
||||
CXXFLAGS: /D_WIN32_WINNT=0x0603 /DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: vs-2015
|
||||
platform: 32
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: vs-2015
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: vs-2017
|
||||
platform: 32
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- TOOLSET: vs-2017
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- TOOLSET: vs-2017
|
||||
CXXFLAGS: /std:c++14
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- TOOLSET: vs-2017
|
||||
CXXFLAGS: /std:c++latest
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- TOOLSET: vs-2017
|
||||
COMMENT: UWP DESKTOP
|
||||
CXXFLAGS: /D_WIN32_WINNT=0x0A00 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- TOOLSET: vs-2017
|
||||
COMMENT: UWP PHONE
|
||||
CXXFLAGS: /D_WIN32_WINNT=0x0A00 /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- TOOLSET: vs-2017
|
||||
COMMENT: UWP STORE
|
||||
CXXFLAGS: /D_WIN32_WINNT=0x0A00 /DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- TOOLSET: vs-2017
|
||||
COMMENT: UWP SERVER
|
||||
CXXFLAGS: /D_WIN32_WINNT=0x0A00 /DWINAPI_FAMILY=WINAPI_FAMILY_SERVER
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- TOOLSET: vs-2017
|
||||
COMMENT: UWP SYSTEM
|
||||
CXXFLAGS: /D_WIN32_WINNT=0x0A00 /DWINAPI_FAMILY=WINAPI_FAMILY_SYSTEM
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- TOOLSET: mingw-5
|
||||
platform: 32
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: mingw64-6
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: mingw64-6
|
||||
COMMENT: UWP DESKTOP
|
||||
CXXFLAGS: -D_WIN32_WINNT=0x0602 -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: mingw64-6
|
||||
COMMENT: UWP STORE
|
||||
CXXFLAGS: -D_WIN32_WINNT=0x0602 -DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
||||
platform: 64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
|
||||
# We can also set up configurations for testing which map to
|
||||
# the b2 build variants.
|
||||
configuration:
|
||||
- debug
|
||||
- release
|
||||
|
||||
# No need to test PR branch as the PR itself is already tested.
|
||||
skip_branch_with_pr: true
|
||||
|
||||
init:
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
install: python tools/ci/library_test.py install
|
||||
before_build: python tools/ci/library_test.py before_build
|
||||
build_script: python tools/ci/library_test.py build_script
|
||||
after_build: python tools/ci/library_test.py after_build
|
||||
before_test: python tools/ci/library_test.py before_test
|
||||
test_script: python tools/ci/library_test.py test_script
|
||||
after_test: python tools/ci/library_test.py after_test
|
||||
on_success: python tools/ci/library_test.py on_success
|
||||
on_failure: python tools/ci/library_test.py on_failure
|
||||
on_finish: python tools/ci/library_test.py on_finish
|
203
azure-pipelines.yml
Normal file
203
azure-pipelines.yml
Normal file
@ -0,0 +1,203 @@
|
||||
# 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 2019.
|
||||
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- develop
|
||||
- master
|
||||
- feature/*
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- develop
|
||||
|
||||
variables:
|
||||
AZP: 1
|
||||
AZP_REPO_DIR: $(Build.Repository.LocalPath)
|
||||
AZP_BRANCH: $(Build.SourceBranch)
|
||||
AZP_COMMIT: $(Build.SourceVersion)
|
||||
AZP_REPO: $(Build.Repository.Name)
|
||||
AZP_PULL_REQUEST: $(System.PullRequest.PullRequestNumber)
|
||||
|
||||
jobs:
|
||||
|
||||
- job: 'Linux'
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
strategy:
|
||||
matrix:
|
||||
GCC 8 (GNU):
|
||||
TOOLSET: gcc-8
|
||||
CXXSTD: 03,11,14,17,2a
|
||||
CXXDIALECT: gnu
|
||||
GCC 8 (ISO):
|
||||
TOOLSET: gcc-8
|
||||
CXXSTD: 03,11,14,17,2a
|
||||
GCC 7:
|
||||
TOOLSET: gcc-7
|
||||
GCC 6:
|
||||
TOOLSET: gcc-6
|
||||
GCC 5:
|
||||
TOOLSET: gcc-5
|
||||
GCC 4.9:
|
||||
TOOLSET: gcc-4.9
|
||||
GCC 4.8:
|
||||
TOOLSET: gcc-4.8
|
||||
GCC 4.7:
|
||||
TOOLSET: gcc-4.7
|
||||
Clang 8:
|
||||
TOOLSET: clang-8
|
||||
Clang 7:
|
||||
TOOLSET: clang-7
|
||||
Clang 6:
|
||||
TOOLSET: clang-6.0
|
||||
Clang 5:
|
||||
TOOLSET: clang-5.0
|
||||
Clang 4:
|
||||
TOOLSET: clang-4.0
|
||||
Clang 3.9:
|
||||
TOOLSET: clang-3.9
|
||||
Clang 3.8:
|
||||
TOOLSET: clang-3.8
|
||||
Clang 3.7:
|
||||
TOOLSET: clang-3.7
|
||||
Clang 3.6:
|
||||
TOOLSET: clang-3.6
|
||||
Clang 3.5:
|
||||
TOOLSET: clang-3.5
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
- script: python tools/ci/library_test.py install
|
||||
failOnStderr: false
|
||||
displayName: Install
|
||||
- script: python tools/ci/library_test.py script
|
||||
failOnStderr: false
|
||||
displayName: Test
|
||||
|
||||
- job: 'macOS'
|
||||
strategy:
|
||||
matrix:
|
||||
Xcode 10.1:
|
||||
TOOLSET: xcode-10.1
|
||||
XCODE_APP: /Applications/Xcode_10.1.app
|
||||
VM_IMAGE: 'macOS-10.14'
|
||||
Xcode 10.0:
|
||||
TOOLSET: xcode-10.0
|
||||
XCODE_APP: /Applications/Xcode_10.app
|
||||
VM_IMAGE: 'macOS-10.14'
|
||||
Xcode 9.4.1:
|
||||
TOOLSET: xcode-9.4.1
|
||||
XCODE_APP: /Applications/Xcode_9.4.1.app
|
||||
VM_IMAGE: 'macOS-10.13'
|
||||
Xcode 9.4:
|
||||
TOOLSET: xcode-9.4
|
||||
XCODE_APP: /Applications/Xcode_9.4.app
|
||||
VM_IMAGE: 'macOS-10.13'
|
||||
Xcode 9.3.1:
|
||||
TOOLSET: xcode-9.3.1
|
||||
XCODE_APP: /Applications/Xcode_9.3.1.app
|
||||
VM_IMAGE: 'macOS-10.13'
|
||||
Xcode 9.3:
|
||||
TOOLSET: xcode-9.3
|
||||
XCODE_APP: /Applications/Xcode_9.3.app
|
||||
VM_IMAGE: 'macOS-10.13'
|
||||
Xcode 9.2:
|
||||
TOOLSET: xcode-9.2
|
||||
XCODE_APP: /Applications/Xcode_9.2.app
|
||||
VM_IMAGE: 'macOS-10.13'
|
||||
Xcode 9.1:
|
||||
TOOLSET: xcode-9.1
|
||||
XCODE_APP: /Applications/Xcode_9.1.app
|
||||
VM_IMAGE: 'macOS-10.13'
|
||||
Xcode 9.0.1:
|
||||
TOOLSET: xcode-9.0.1
|
||||
XCODE_APP: /Applications/Xcode_9.0.1.app
|
||||
VM_IMAGE: 'macOS-10.13'
|
||||
Xcode 9.0:
|
||||
TOOLSET: xcode-9.0
|
||||
XCODE_APP: /Applications/Xcode_9.app
|
||||
VM_IMAGE: 'macOS-10.13'
|
||||
Xcode 8.3.3:
|
||||
TOOLSET: xcode-8.3
|
||||
XCODE_APP: /Applications/Xcode_8.3.3.app
|
||||
VM_IMAGE: 'macOS-10.13'
|
||||
pool:
|
||||
vmImage: $(VM_IMAGE)
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
- script: sudo xcode-select -switch ${XCODE_APP}
|
||||
failOnStderr: false
|
||||
displayName: Xcode Select
|
||||
- script: python tools/ci/library_test.py install
|
||||
failOnStderr: false
|
||||
displayName: Install
|
||||
- script: python tools/ci/library_test.py script
|
||||
failOnStderr: false
|
||||
displayName: Test
|
||||
|
||||
- job: 'Windows'
|
||||
strategy:
|
||||
matrix:
|
||||
VS 2019:
|
||||
TOOLSET: vs-2019
|
||||
ADDRESS_MODEL: 32,64
|
||||
CXXSTD: 14,latest
|
||||
VM_IMAGE: 'windows-2019'
|
||||
VS 2019 (UWP DESKTOP):
|
||||
TOOLSET: vs-2019
|
||||
ADDRESS_MODEL: 64
|
||||
CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
|
||||
VM_IMAGE: 'windows-2019'
|
||||
VS 2019 (UWP PHONE):
|
||||
TOOLSET: vs-2019
|
||||
ADDRESS_MODEL: 64
|
||||
CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
|
||||
VM_IMAGE: 'windows-2019'
|
||||
VS 2019 (UWP STORE):
|
||||
TOOLSET: vs-2019
|
||||
ADDRESS_MODEL: 64
|
||||
CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_PC_APP
|
||||
VM_IMAGE: 'windows-2019'
|
||||
VS 2019 (UWP SERVER):
|
||||
TOOLSET: vs-2019
|
||||
ADDRESS_MODEL: 64
|
||||
CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_SERVER
|
||||
VM_IMAGE: 'windows-2019'
|
||||
VS 2019 (UWP SYSTEM):
|
||||
TOOLSET: vs-2019
|
||||
ADDRESS_MODEL: 64
|
||||
CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_SYSTEM
|
||||
VM_IMAGE: 'windows-2019'
|
||||
VS 2017:
|
||||
TOOLSET: vs-2017
|
||||
VM_IMAGE: 'vs2017-win2016'
|
||||
VS 2015:
|
||||
TOOLSET: vs-2015
|
||||
VM_IMAGE: 'vs2015-win2012r2'
|
||||
VS 2013:
|
||||
TOOLSET: vs-2013
|
||||
VM_IMAGE: 'vs2015-win2012r2'
|
||||
MinGW 8.1.0:
|
||||
TOOLSET: mingw-8
|
||||
VM_IMAGE: 'vs2017-win2016'
|
||||
MinGW 8.1.0 (UWP DESKTOP):
|
||||
TOOLSET: mingw-8
|
||||
CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
|
||||
VM_IMAGE: 'vs2017-win2016'
|
||||
MinGW 8.1.0 (UWP STORE):
|
||||
TOOLSET: mingw-8
|
||||
CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_PC_APP
|
||||
VM_IMAGE: 'vs2017-win2016'
|
||||
pool:
|
||||
vmImage: $(VM_IMAGE)
|
||||
steps:
|
||||
- script: python tools/ci/library_test.py install
|
||||
failOnStderr: false
|
||||
displayName: Install
|
||||
- script: python tools/ci/library_test.py script
|
||||
failOnStderr: false
|
||||
displayName: Test
|
@ -1,9 +1,10 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Copyright 2008 Rene Rivera
|
||||
# Copyright 2008-2019 Rene Rivera
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import re
|
||||
import optparse
|
||||
import time
|
||||
@ -12,7 +13,8 @@ import xml.dom.pulldom
|
||||
from xml.sax.saxutils import unescape, escape
|
||||
import os.path
|
||||
from pprint import pprint
|
||||
from __builtin__ import exit
|
||||
from sys import exit
|
||||
|
||||
|
||||
class BuildOutputXMLParsing(object):
|
||||
'''
|
||||
@ -63,14 +65,17 @@ class BuildOutputXMLParsing(object):
|
||||
if n.hasAttribute('id'):
|
||||
found = found and n.getAttribute('id') == id
|
||||
else:
|
||||
found = found and n.hasAttribute('id') and n.getAttribute('id') == id
|
||||
found = found and n.hasAttribute(
|
||||
'id') and n.getAttribute('id') == id
|
||||
if name and found:
|
||||
found = found and n.hasAttribute('name') and n.getAttribute('name') == name
|
||||
found = found and n.hasAttribute(
|
||||
'name') and n.getAttribute('name') == name
|
||||
if found:
|
||||
return n
|
||||
n = n.nextSibling
|
||||
return None
|
||||
|
||||
|
||||
class BuildOutputProcessor(BuildOutputXMLParsing):
|
||||
|
||||
def __init__(self, inputs):
|
||||
@ -113,7 +118,7 @@ class BuildOutputProcessor(BuildOutputXMLParsing):
|
||||
suffix = '_'+c.nodeName.replace('-', '_').replace('#', '_')
|
||||
node = c
|
||||
names.append('x')
|
||||
names = map(lambda x: x+suffix,names)
|
||||
names = [x+suffix for x in names]
|
||||
if node:
|
||||
for name in names:
|
||||
if hasattr(self, name):
|
||||
@ -128,7 +133,7 @@ class BuildOutputProcessor(BuildOutputXMLParsing):
|
||||
test_node = node
|
||||
test_name = test_node.getAttribute('name')
|
||||
test_target = self.get_child_data(test_node, tag='target', strip=True)
|
||||
## print ">>> %s %s" %(test_name,test_target)
|
||||
# print ">>> %s %s" %(test_name,test_target)
|
||||
self.test[test_name] = {
|
||||
'library': "/".join(test_name.split('/')[0:-1]),
|
||||
'test-name': test_name.split('/')[-1],
|
||||
@ -151,14 +156,16 @@ class BuildOutputProcessor(BuildOutputXMLParsing):
|
||||
target_node = node
|
||||
name = self.get_child_data(target_node, tag='name', strip=True)
|
||||
path = self.get_child_data(target_node, tag='path', strip=True)
|
||||
jam_target = self.get_child_data(target_node,tag='jam-target',strip=True)
|
||||
jam_target = self.get_child_data(
|
||||
target_node, tag='jam-target', strip=True)
|
||||
# ~ Map for jam targets to virtual targets.
|
||||
self.target[jam_target] = {
|
||||
'name': name,
|
||||
'path': path
|
||||
}
|
||||
# ~ Create the ancestry.
|
||||
dep_node = self.get_child(self.get_child(target_node,tag='dependencies'),tag='dependency')
|
||||
dep_node = self.get_child(self.get_child(
|
||||
target_node, tag='dependencies'), tag='dependency')
|
||||
while dep_node:
|
||||
child = self.get_data(dep_node, strip=True)
|
||||
child_jam_target = '<p%s>%s' % (path, child.split('//', 1)[1])
|
||||
@ -198,9 +205,9 @@ class BuildOutputProcessor(BuildOutputXMLParsing):
|
||||
# ~ regular build actions and don't need to show up in the
|
||||
# ~ regression results.
|
||||
if not test:
|
||||
##print "??? [%s] %s %s :: %s" %(action_type,name,target,test)
|
||||
# print "??? [%s] %s %s :: %s" %(action_type,name,target,test)
|
||||
return None
|
||||
##print "+++ [%s] %s %s :: %s" %(action_type,name,target,test)
|
||||
# print "+++ [%s] %s %s :: %s" %(action_type,name,target,test)
|
||||
# ~ Collect some basic info about the action.
|
||||
action = {
|
||||
'command': self.get_action_command(action_node, action_type),
|
||||
@ -269,7 +276,7 @@ class BuildOutputProcessor(BuildOutputXMLParsing):
|
||||
test = self.test[lib]
|
||||
else:
|
||||
target_name_ = self.target[target]['name']
|
||||
if self.target_to_test.has_key(target_name_):
|
||||
if target_name_ in self.target_to_test:
|
||||
test = self.test[self.target_to_test[target_name_]]
|
||||
else:
|
||||
test = None
|
||||
@ -299,17 +306,20 @@ class BuildOutputProcessor(BuildOutputXMLParsing):
|
||||
info['time-user'] = action_node.getAttribute('user')
|
||||
info['time-system'] = action_node.getAttribute('system')
|
||||
# ~ Testing properties.
|
||||
test_info_prop = self.get_child_data(self.get_child(action_node,tag='properties'),name='test-info')
|
||||
test_info_prop = self.get_child_data(self.get_child(
|
||||
action_node, tag='properties'), name='test-info')
|
||||
info['always_show_run_output'] = test_info_prop == 'always_show_run_output'
|
||||
# ~ And for compiles some context that may be hidden if using response files.
|
||||
if action_type == 'compile':
|
||||
info['define'] = []
|
||||
define = self.get_child(self.get_child(action_node,tag='properties'),name='define')
|
||||
define = self.get_child(self.get_child(
|
||||
action_node, tag='properties'), name='define')
|
||||
while define:
|
||||
info['define'].append(self.get_data(define, strip=True))
|
||||
define = self.get_sibling(define.nextSibling, name='define')
|
||||
return info
|
||||
|
||||
|
||||
class BuildConsoleSummaryReport(object):
|
||||
|
||||
HEADER = '\033[35m\033[1m'
|
||||
@ -328,10 +338,12 @@ class BuildConsoleSummaryReport(object):
|
||||
'success': 0,
|
||||
'failed': [],
|
||||
}
|
||||
self.header_print("======================================================================")
|
||||
self.header_print(
|
||||
"======================================================================")
|
||||
self.print_test_log()
|
||||
self.print_summary()
|
||||
self.header_print("======================================================================")
|
||||
self.header_print(
|
||||
"======================================================================")
|
||||
|
||||
@property
|
||||
def failed(self):
|
||||
@ -339,12 +351,13 @@ class BuildConsoleSummaryReport(object):
|
||||
|
||||
def print_test_log(self):
|
||||
self.header_print("Tests run..")
|
||||
self.header_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
|
||||
self.header_print(
|
||||
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
|
||||
for k in sorted(self.bop.test.keys()):
|
||||
test = self.bop.test[k]
|
||||
if len(test['actions']) > 0:
|
||||
self.summary_info['total'] += 1
|
||||
##print ">>>> {0}".format(test['test-name'])
|
||||
# print ">>>> {0}".format(test['test-name'])
|
||||
if 'result' in test:
|
||||
succeed = test['result'] == 'succeed'
|
||||
else:
|
||||
@ -370,7 +383,8 @@ class BuildConsoleSummaryReport(object):
|
||||
if output != "":
|
||||
p = self.fail_print if action['result'] == 'fail' else self.p_print
|
||||
self.info_print("")
|
||||
self.info_print("({0}) {1}",action['info']['name'],action['info']['path'])
|
||||
self.info_print(
|
||||
"({0}) {1}", action['info']['name'], action['info']['path'])
|
||||
p("")
|
||||
p("{0}", action['command'].strip())
|
||||
p("")
|
||||
@ -380,31 +394,34 @@ class BuildConsoleSummaryReport(object):
|
||||
def print_summary(self):
|
||||
self.header_print("")
|
||||
self.header_print("Testing summary..")
|
||||
self.header_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
|
||||
self.header_print(
|
||||
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
|
||||
self.p_print("Total: {0}", self.summary_info['total'])
|
||||
self.p_print("Success: {0}", self.summary_info['success'])
|
||||
if self.failed:
|
||||
self.fail_print("Failed: {0}", len(self.summary_info['failed']))
|
||||
for test in self.summary_info['failed']:
|
||||
self.fail_print(" {0}/{1}",test['library'],test['test-name'])
|
||||
self.fail_print(
|
||||
" {0}/{1}", test['library'], test['test-name'])
|
||||
|
||||
def p_print(self, format, *args, **kargs):
|
||||
print format.format(*args,**kargs)
|
||||
print(format.format(*args, **kargs))
|
||||
|
||||
def info_print(self, format, *args, **kargs):
|
||||
print self.INFO+format.format(*args,**kargs)+self.ENDC
|
||||
print(self.INFO+format.format(*args, **kargs)+self.ENDC)
|
||||
|
||||
def header_print(self, format, *args, **kargs):
|
||||
print self.HEADER+format.format(*args,**kargs)+self.ENDC
|
||||
print(self.HEADER+format.format(*args, **kargs)+self.ENDC)
|
||||
|
||||
def ok_print(self, format, *args, **kargs):
|
||||
print self.OK+format.format(*args,**kargs)+self.ENDC
|
||||
print(self.OK+format.format(*args, **kargs)+self.ENDC)
|
||||
|
||||
def warn_print(self, format, *args, **kargs):
|
||||
print self.WARNING+format.format(*args,**kargs)+self.ENDC
|
||||
print(self.WARNING+format.format(*args, **kargs)+self.ENDC)
|
||||
|
||||
def fail_print(self, format, *args, **kargs):
|
||||
print self.FAIL+format.format(*args,**kargs)+self.ENDC
|
||||
print(self.FAIL+format.format(*args, **kargs)+self.ENDC)
|
||||
|
||||
|
||||
class Main(object):
|
||||
|
||||
@ -422,6 +439,7 @@ class Main(object):
|
||||
output.generate()
|
||||
self.failed = output.failed
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
m = Main()
|
||||
if m.failed:
|
||||
|
@ -1,6 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Copyright Rene Rivera 2016
|
||||
# Copyright Rene Rivera 2016-2019
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -19,52 +17,49 @@ import threading
|
||||
|
||||
toolset_info = {
|
||||
'clang-3.4': {
|
||||
'ppa' : ["ppa:h-rayflood/llvm"],
|
||||
'ppa': ["ppa:ubuntu-toolchain-r/test"],
|
||||
'package': 'clang-3.4',
|
||||
'command': 'clang++-3.4',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'clang-3.5': {
|
||||
'ppa' : ["ppa:h-rayflood/llvm"],
|
||||
'ppa': ["ppa:ubuntu-toolchain-r/test"],
|
||||
'package': 'clang-3.5',
|
||||
'command': 'clang++-3.5',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'clang-3.6': {
|
||||
'ppa' : ["ppa:h-rayflood/llvm"],
|
||||
'ppa': ["ppa:ubuntu-toolchain-r/test"],
|
||||
'package': 'clang-3.6',
|
||||
'command': 'clang++-3.6',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'clang-3.7': {
|
||||
'deb' : ["http://apt.llvm.org/trusty/","llvm-toolchain-trusty-3.7","main"],
|
||||
'apt-key' : ['http://apt.llvm.org/llvm-snapshot.gpg.key'],
|
||||
'ppa': ["ppa:ubuntu-toolchain-r/test"],
|
||||
'package': 'clang-3.7',
|
||||
'command': 'clang++-3.7',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'clang-3.8': {
|
||||
'deb' : ["http://apt.llvm.org/trusty/","llvm-toolchain-trusty-3.8","main"],
|
||||
'apt-key' : ['http://apt.llvm.org/llvm-snapshot.gpg.key'],
|
||||
'ppa': ["ppa:ubuntu-toolchain-r/test"],
|
||||
'package': 'clang-3.8',
|
||||
'command': 'clang++-3.8',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'clang-3.9': {
|
||||
'deb' : ["http://apt.llvm.org/trusty/","llvm-toolchain-trusty-3.9","main"],
|
||||
'apt-key' : ['http://apt.llvm.org/llvm-snapshot.gpg.key'],
|
||||
'ppa': ["ppa:ubuntu-toolchain-r/test"],
|
||||
'package': 'clang-3.9',
|
||||
'command': 'clang++-3.9',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'clang-4.0': {
|
||||
'deb' : ["http://apt.llvm.org/trusty/","llvm-toolchain-trusty-4.0","main"],
|
||||
'deb': ["http://apt.llvm.org/xenial/", "llvm-toolchain-xenial-4.0", "main"],
|
||||
'apt-key': ['http://apt.llvm.org/llvm-snapshot.gpg.key'],
|
||||
'package': 'clang-4.0',
|
||||
'command': 'clang++-4.0',
|
||||
@ -72,7 +67,7 @@ toolset_info = {
|
||||
'version': ''
|
||||
},
|
||||
'clang-5.0': {
|
||||
'deb' : ["http://apt.llvm.org/trusty/","llvm-toolchain-trusty-5.0","main"],
|
||||
'deb': ["http://apt.llvm.org/xenial/", "llvm-toolchain-xenial-5.0", "main"],
|
||||
'apt-key': ['http://apt.llvm.org/llvm-snapshot.gpg.key'],
|
||||
'package': 'clang-5.0',
|
||||
'command': 'clang++-5.0',
|
||||
@ -80,7 +75,23 @@ toolset_info = {
|
||||
'version': ''
|
||||
},
|
||||
'clang-6.0': {
|
||||
'deb' : ["http://apt.llvm.org/trusty/","llvm-toolchain-trusty-6.0","main"],
|
||||
'deb': ["http://apt.llvm.org/xenial/", "llvm-toolchain-xenial-6.0", "main"],
|
||||
'apt-key': ['http://apt.llvm.org/llvm-snapshot.gpg.key'],
|
||||
'package': 'clang-6.0',
|
||||
'command': 'clang++-6.0',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'clang-7': {
|
||||
'deb': ["http://apt.llvm.org/xenial/", "llvm-toolchain-xenial-7", "main"],
|
||||
'apt-key': ['http://apt.llvm.org/llvm-snapshot.gpg.key'],
|
||||
'package': 'clang-6.0',
|
||||
'command': 'clang++-6.0',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'clang-8': {
|
||||
'deb': ["http://apt.llvm.org/xenial/", "llvm-toolchain-xenial-8", "main"],
|
||||
'apt-key': ['http://apt.llvm.org/llvm-snapshot.gpg.key'],
|
||||
'package': 'clang-6.0',
|
||||
'command': 'clang++-6.0',
|
||||
@ -144,14 +155,9 @@ toolset_info = {
|
||||
'toolset': 'gcc',
|
||||
'version': ''
|
||||
},
|
||||
'mingw-5' : {
|
||||
'mingw-8': {
|
||||
'toolset': 'gcc',
|
||||
'command' : 'C:\\\\MinGW\\\\bin\\\\g++.exe',
|
||||
'version' : ''
|
||||
},
|
||||
'mingw64-6' : {
|
||||
'toolset' : 'gcc',
|
||||
'command' : 'C:\\\\mingw-w64\\\\x86_64-6.3.0-posix-seh-rt_v5-rev1\\\\mingw64\\\\bin\\\\g++.exe',
|
||||
'command': 'g++.exe',
|
||||
'version': ''
|
||||
},
|
||||
'vs-2008': {
|
||||
@ -184,6 +190,11 @@ toolset_info = {
|
||||
'command': '',
|
||||
'version': '14.1'
|
||||
},
|
||||
'vs-2019': {
|
||||
'toolset': 'msvc',
|
||||
'command': '',
|
||||
'version': '14.2'
|
||||
},
|
||||
'xcode-6.1': {
|
||||
'command': 'clang++',
|
||||
'toolset': 'clang',
|
||||
@ -249,6 +260,11 @@ toolset_info = {
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'xcode-9.0.1': {
|
||||
'command': 'clang++',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'xcode-9.1': {
|
||||
'command': 'clang++',
|
||||
'toolset': 'clang',
|
||||
@ -264,25 +280,43 @@ toolset_info = {
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'xcode-9.3.1': {
|
||||
'command': 'clang++',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'xcode-9.4': {
|
||||
'command': 'clang++',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'xcode-9.4.1': {
|
||||
'command': 'clang++',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'xcode-10.0': {
|
||||
'command': 'clang++',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
'xcode-10.1': {
|
||||
'command': 'clang++',
|
||||
'toolset': 'clang',
|
||||
'version': ''
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
class SystemCallError(Exception):
|
||||
def __init__(self, command, result):
|
||||
self.command = command
|
||||
self.result = result
|
||||
|
||||
def __str__(self, *args, **kwargs):
|
||||
return "'%s' ==> %s" % ("' '".join(self.command), self.result)
|
||||
|
||||
|
||||
class utils:
|
||||
|
||||
call_stats = []
|
||||
@ -294,17 +328,20 @@ class utils:
|
||||
result = subprocess.call(command, **kargs)
|
||||
t = time.time()-t
|
||||
if result != 0:
|
||||
print "Failed: '%s' ERROR = %s"%("' '".join(command), result)
|
||||
print("Failed: '%s' ERROR = %s" % ("' '".join(command), result))
|
||||
utils.call_stats.append((t, os.getcwd(), command, result))
|
||||
utils.log( "%s> '%s' execution time %s seconds"%(os.getcwd(), "' '".join(command), t) )
|
||||
utils.log("%s> '%s' execution time %s seconds" %
|
||||
(os.getcwd(), "' '".join(command), t))
|
||||
return result
|
||||
|
||||
@staticmethod
|
||||
def print_call_stats():
|
||||
utils.log("================================================================================")
|
||||
utils.log(
|
||||
"================================================================================")
|
||||
for j in sorted(utils.call_stats, reverse=True):
|
||||
utils.log("{:>12.4f}\t{}> {} ==> {}".format(*j))
|
||||
utils.log("================================================================================")
|
||||
utils.log(
|
||||
"================================================================================")
|
||||
|
||||
@staticmethod
|
||||
def check_call(*command, **kargs):
|
||||
@ -323,16 +360,15 @@ class utils:
|
||||
frames = inspect.stack()
|
||||
level = 0
|
||||
for i in frames[3:]:
|
||||
if i[0].f_locals.has_key( '__log__' ):
|
||||
if '__log__' in i[0].f_locals:
|
||||
level = level + i[0].f_locals['__log__']
|
||||
return level
|
||||
|
||||
@staticmethod
|
||||
def log(message):
|
||||
sys.stdout.flush()
|
||||
sys.stderr.flush()
|
||||
sys.stderr.write( '# ' + ' ' * utils.log_level() + message + '\n' )
|
||||
sys.stderr.flush()
|
||||
sys.stdout.write('# ' + ' ' * utils.log_level() + message + '\n')
|
||||
sys.stdout.flush()
|
||||
|
||||
@staticmethod
|
||||
def rmtree(path):
|
||||
@ -349,7 +385,7 @@ class utils:
|
||||
for attempts in range(max_attempts, -1, -1):
|
||||
try:
|
||||
return f()
|
||||
except Exception, msg:
|
||||
except Exception as msg:
|
||||
utils.log('%s failed with message "%s"' % (f.__name__, msg))
|
||||
if attempts == 0:
|
||||
utils.log('Giving up.')
|
||||
@ -374,7 +410,8 @@ class utils:
|
||||
f = open(destination_file, 'wb')
|
||||
while True:
|
||||
data = src.read(16*1024)
|
||||
if len( data ) == 0: break
|
||||
if len(data) == 0:
|
||||
break
|
||||
f.write(data)
|
||||
|
||||
f.close()
|
||||
@ -421,14 +458,14 @@ class utils:
|
||||
|
||||
@staticmethod
|
||||
def make_file(filename, *text):
|
||||
text = string.join( text, '\n' )
|
||||
text = '\n'.join(text)
|
||||
with codecs.open(filename, 'w', 'utf-8') as f:
|
||||
f.write(text)
|
||||
|
||||
@staticmethod
|
||||
def append_file(filename, *text):
|
||||
with codecs.open(filename, 'a', 'utf-8') as f:
|
||||
f.write( string.join( text, '\n' ) )
|
||||
f.write('\n'.join(text))
|
||||
|
||||
@staticmethod
|
||||
def mem_info():
|
||||
@ -487,9 +524,11 @@ class utils:
|
||||
utils.check_call("git", "submodule", "--quiet", "update",
|
||||
"--quiet", "--init", "--recursive",
|
||||
)
|
||||
utils.check_call("git","submodule","--quiet","foreach","git","fetch")
|
||||
utils.check_call("git", "submodule", "--quiet",
|
||||
"foreach", "git", "fetch")
|
||||
return repo_dir
|
||||
|
||||
|
||||
class parallel_call(threading.Thread):
|
||||
'''
|
||||
Runs a synchronous command in a thread waiting for it to complete.
|
||||
@ -509,11 +548,13 @@ class parallel_call(threading.Thread):
|
||||
if self.result != 0:
|
||||
raise(SystemCallError(self.command, self.result))
|
||||
|
||||
|
||||
def set_arg(args, k, v=None):
|
||||
if not args.get(k):
|
||||
args[k] = v
|
||||
return args[k]
|
||||
|
||||
|
||||
class script_common(object):
|
||||
'''
|
||||
Main script to run continuous integration.
|
||||
@ -546,7 +587,7 @@ class script_common(object):
|
||||
set_arg(kargs, 'pull_request', None)
|
||||
|
||||
#~ Defaults
|
||||
for (k,v) in kargs.iteritems():
|
||||
for (k, v) in kargs.items():
|
||||
setattr(self, k, v)
|
||||
(_opt_, self.actions) = opt.parse_args(None, self)
|
||||
if not self.actions or self.actions == []:
|
||||
@ -565,9 +606,11 @@ class script_common(object):
|
||||
self.command_info()
|
||||
self.main()
|
||||
utils.print_call_stats()
|
||||
except:
|
||||
except Exception as e:
|
||||
utils.print_call_stats()
|
||||
raise
|
||||
# raise
|
||||
utils.log(str(e))
|
||||
exit(1)
|
||||
|
||||
def init(self, opt, kargs):
|
||||
return kargs
|
||||
@ -626,6 +669,7 @@ class script_common(object):
|
||||
def command_after_success(self):
|
||||
pass
|
||||
|
||||
|
||||
class ci_cli(object):
|
||||
'''
|
||||
This version of the script provides a way to do manual building. It sets up
|
||||
@ -670,6 +714,7 @@ class ci_cli(object):
|
||||
def command_finish(self):
|
||||
exit(self.exit_result)
|
||||
|
||||
|
||||
class ci_travis(object):
|
||||
'''
|
||||
This variant build releases in the context of the Travis-CI service.
|
||||
@ -684,7 +729,7 @@ class ci_travis(object):
|
||||
set_arg(kargs, 'commit', os.getenv("TRAVIS_COMMIT"))
|
||||
set_arg(kargs, 'repo', os.getenv("TRAVIS_REPO_SLUG").split("/")[1])
|
||||
set_arg(kargs, 'pull_request',
|
||||
os.getenv('TRAVIS_PULL_REQUEST') \
|
||||
os.getenv('TRAVIS_PULL_REQUEST')
|
||||
if os.getenv('TRAVIS_PULL_REQUEST') != 'false' else None)
|
||||
return kargs
|
||||
|
||||
@ -706,7 +751,8 @@ class ci_travis(object):
|
||||
utils.make_file('sources.list',
|
||||
"deb %s" % (' '.join(info['deb'])),
|
||||
"deb-src %s" % (' '.join(info['deb'])))
|
||||
utils.check_call('sudo','bash','-c','cat sources.list >> /etc/apt/sources.list')
|
||||
utils.check_call('sudo', 'bash', '-c',
|
||||
'cat sources.list >> /etc/apt/sources.list')
|
||||
if 'apt-key' in info:
|
||||
for key in info['apt-key']:
|
||||
utils.check_call('wget', key, '-O', 'apt.key')
|
||||
@ -752,6 +798,7 @@ class ci_travis(object):
|
||||
def command_after_script(self):
|
||||
pass
|
||||
|
||||
|
||||
class ci_circleci(object):
|
||||
'''
|
||||
This variant build releases in the context of the CircleCI service.
|
||||
@ -761,10 +808,12 @@ class ci_circleci(object):
|
||||
self.script = script
|
||||
|
||||
def init(self, opt, kargs):
|
||||
set_arg(kargs,'repo_dir', os.path.join(os.getenv("HOME"),os.getenv("CIRCLE_PROJECT_REPONAME")))
|
||||
set_arg(kargs, 'repo_dir', os.path.join(
|
||||
os.getenv("HOME"), os.getenv("CIRCLE_PROJECT_REPONAME")))
|
||||
set_arg(kargs, 'branch', os.getenv("CIRCLE_BRANCH"))
|
||||
set_arg(kargs, 'commit', os.getenv("CIRCLE_SHA1"))
|
||||
set_arg(kargs,'repo', os.getenv("CIRCLE_PROJECT_REPONAME").split("/")[1])
|
||||
set_arg(kargs, 'repo', os.getenv(
|
||||
"CIRCLE_PROJECT_REPONAME").split("/")[1])
|
||||
set_arg(kargs, 'pull_request', os.getenv('CIRCLE_PR_NUMBER'))
|
||||
return kargs
|
||||
|
||||
@ -779,7 +828,8 @@ class ci_circleci(object):
|
||||
|
||||
def command_checkout_post(self):
|
||||
os.chdir(self.script.repo_dir)
|
||||
utils.check_call("git","submodule","update","--quiet","--init","--recursive")
|
||||
utils.check_call("git", "submodule", "update",
|
||||
"--quiet", "--init", "--recursive")
|
||||
|
||||
def command_dependencies_pre(self):
|
||||
# Read in .travis.yml for list of packages to install
|
||||
@ -823,6 +873,7 @@ class ci_circleci(object):
|
||||
def command_test_post(self):
|
||||
pass
|
||||
|
||||
|
||||
class ci_appveyor(object):
|
||||
|
||||
def __init__(self, script):
|
||||
@ -835,7 +886,8 @@ class ci_appveyor(object):
|
||||
set_arg(kargs, 'repo', os.getenv("APPVEYOR_REPO_NAME").split("/")[1])
|
||||
set_arg(kargs, 'address_model', os.getenv("PLATFORM", None))
|
||||
set_arg(kargs, 'variant', os.getenv("CONFIGURATION", "debug"))
|
||||
set_arg(kargs,'pull_request', os.getenv('APPVEYOR_PULL_REQUEST_NUMBER'))
|
||||
set_arg(kargs, 'pull_request', os.getenv(
|
||||
'APPVEYOR_PULL_REQUEST_NUMBER'))
|
||||
return kargs
|
||||
|
||||
def finish(self, result):
|
||||
@ -849,7 +901,8 @@ class ci_appveyor(object):
|
||||
|
||||
def command_before_build(self):
|
||||
os.chdir(self.script.repo_dir)
|
||||
utils.check_call("git","submodule","update","--quiet","--init","--recursive")
|
||||
utils.check_call("git", "submodule", "update",
|
||||
"--quiet", "--init", "--recursive")
|
||||
self.script.command_before_build()
|
||||
|
||||
def command_build_script(self):
|
||||
@ -876,6 +929,65 @@ class ci_appveyor(object):
|
||||
def command_on_finish(self):
|
||||
pass
|
||||
|
||||
|
||||
class ci_azp(object):
|
||||
'''
|
||||
This variant build releases in the context of the Azure Pipelines service.
|
||||
'''
|
||||
|
||||
def __init__(self, script):
|
||||
self.script = script
|
||||
|
||||
def init(self, opt, kargs):
|
||||
set_arg(kargs, 'repo_dir', os.getenv("AZP_REPO_DIR"))
|
||||
set_arg(kargs, 'branch', os.getenv("AZP_BRANCH"))
|
||||
set_arg(kargs, 'commit', os.getenv("AZP_COMMIT"))
|
||||
set_arg(kargs, 'repo', os.getenv("AZP_REPO"))
|
||||
set_arg(kargs, 'pull_request', os.getenv('AZP_PULL_REQUEST'))
|
||||
return kargs
|
||||
|
||||
def finish(self, result):
|
||||
exit(result)
|
||||
|
||||
def install_toolset(self, toolset):
|
||||
'''
|
||||
Installs specific toolset on CI system.
|
||||
'''
|
||||
info = toolset_info[toolset]
|
||||
if sys.platform.startswith('linux'):
|
||||
os.chdir(self.script.build_dir)
|
||||
if 'ppa' in info:
|
||||
for ppa in info['ppa']:
|
||||
utils.check_call(
|
||||
'sudo', 'add-apt-repository', '--yes', ppa)
|
||||
if 'deb' in info:
|
||||
utils.check_call(
|
||||
'sudo', '-E', 'apt-add-repository',
|
||||
'deb %s' % (' '.join(info['deb'])))
|
||||
if 'apt-key' in info:
|
||||
for key in info['apt-key']:
|
||||
utils.check_call('wget', key, '-O', 'apt.key')
|
||||
utils.check_call('sudo', '-E', 'apt-key', 'add', 'apt.key')
|
||||
utils.check_call(
|
||||
'sudo', '-E', 'apt-get', 'update')
|
||||
utils.check_call(
|
||||
'sudo', '-E', 'apt-get', '-yq', '--no-install-suggests',
|
||||
'--no-install-recommends', 'install', info['package'])
|
||||
if 'debugpackage' in info and info['debugpackage']:
|
||||
utils.check_call(
|
||||
'sudo', 'apt-get', '-yq', '--no-install-suggests',
|
||||
'--no-install-recommends', 'install', info['debugpackage'])
|
||||
|
||||
def command_install(self):
|
||||
self.script.command_install()
|
||||
self.script.command_before_build()
|
||||
|
||||
def command_script(self):
|
||||
self.script.command_build()
|
||||
self.script.command_before_cache()
|
||||
self.script.command_after_success()
|
||||
|
||||
|
||||
def main(script_klass):
|
||||
if os.getenv('TRAVIS', False):
|
||||
script_klass(ci_travis)
|
||||
@ -883,5 +995,7 @@ def main(script_klass):
|
||||
script_klass(ci_circleci)
|
||||
elif os.getenv('APPVEYOR', False):
|
||||
script_klass(ci_appveyor)
|
||||
elif os.getenv('AZP', False):
|
||||
script_klass(ci_azp)
|
||||
else:
|
||||
script_klass(ci_cli)
|
||||
|
@ -1,11 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Copyright Rene Rivera 2016
|
||||
# Copyright Rene Rivera 2016-2019
|
||||
#
|
||||
# Distributed under 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)
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os.path
|
||||
import shutil
|
||||
import sys
|
||||
@ -13,6 +14,7 @@ from common import toolset_info, main, utils, script_common, ci_cli, set_arg
|
||||
|
||||
__dirname__ = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
class script(script_common):
|
||||
'''
|
||||
Main script to test a Boost C++ Library.
|
||||
@ -22,19 +24,25 @@ class script(script_common):
|
||||
script_common.__init__(self, ci_klass, **kargs)
|
||||
|
||||
def init(self, opt, kargs):
|
||||
opt.add_option( '--toolset',
|
||||
opt.add_option(
|
||||
'--toolset',
|
||||
help="single toolset to test with")
|
||||
opt.add_option( '--target',
|
||||
opt.add_option(
|
||||
'--target',
|
||||
help="test target to build for testing, defaults to TARGET or 'minimal'")
|
||||
opt.add_option( '--address-model',
|
||||
opt.add_option(
|
||||
'--address-model',
|
||||
help="address model to test, ie 64 or 32")
|
||||
opt.add_option( '--variant',
|
||||
opt.add_option(
|
||||
'--variant',
|
||||
help="variant to test, ie debug, release")
|
||||
set_arg(kargs, 'toolset', os.getenv("TOOLSET"))
|
||||
set_arg(kargs, 'target', os.getenv('TARGET', 'minimal'))
|
||||
set_arg(kargs, 'address_model', os.getenv("ADDRESS_MODEL", None))
|
||||
set_arg(kargs, 'variant', os.getenv("VARIANT", "debug"))
|
||||
set_arg(kargs, 'cxxflags', os.getenv("CXXFLAGS",None))
|
||||
set_arg(kargs, 'cxxstd', os.getenv("CXXSTD", None))
|
||||
set_arg(kargs, 'cxxdialect', os.getenv("CXXDIALECT", None))
|
||||
set_arg(kargs, 'cxxdefs', os.getenv("CXXDEFS", None))
|
||||
return kargs
|
||||
|
||||
def start(self):
|
||||
@ -57,26 +65,19 @@ class script(script_common):
|
||||
|
||||
# Create config file for b2 toolset.
|
||||
if not isinstance(self.ci, ci_cli):
|
||||
cxxflags = None
|
||||
if self.cxxflags:
|
||||
cxxflags = self.cxxflags.split()
|
||||
cxxflags = " <cxxflags>".join(cxxflags)
|
||||
utils.make_file(os.path.join(self.repo_dir, 'project-config.jam'),
|
||||
"""
|
||||
using %(toolset)s : %(version)s : %(command)s : %(cxxflags)s ;
|
||||
using python : %(pyversion)s : "%(python)s" ;
|
||||
using %(toolset)s : %(version)s : %(command)s ;
|
||||
""" % {
|
||||
'toolset': toolset_info[self.toolset]['toolset'],
|
||||
'version': toolset_info[self.toolset]['version'],
|
||||
'command': toolset_info[self.toolset]['command'],
|
||||
'cxxflags':"<cxxflags>"+cxxflags if cxxflags else "",
|
||||
'pyversion':"%s.%s"%(sys.version_info[0],sys.version_info[1]),
|
||||
'python':sys.executable.replace("\\","\\\\")
|
||||
})
|
||||
|
||||
# "Convert" boostorg-predef into standalone b2 project.
|
||||
if os.path.exists(os.path.join(self.repo_dir,'build.jam')) and not os.path.exists(os.path.join(self.repo_dir,'project-root.jam')):
|
||||
os.rename(os.path.join(self.repo_dir,'build.jam'), os.path.join(self.repo_dir,'project-root.jam'))
|
||||
# # "Convert" boostorg-predef into standalone b2 project.
|
||||
# if os.path.exists(os.path.join(self.repo_dir, 'build.jam')) and not os.path.exists(os.path.join(self.repo_dir, 'project-root.jam')):
|
||||
# os.rename(os.path.join(self.repo_dir, 'build.jam'),
|
||||
# os.path.join(self.repo_dir, 'project-root.jam'))
|
||||
|
||||
def command_build(self):
|
||||
script_common.command_build(self)
|
||||
@ -105,6 +106,9 @@ using python : %(pyversion)s : "%(python)s" ;
|
||||
toolset_to_test = toolset_info[self.toolset]['toolset']
|
||||
else:
|
||||
toolset_to_test = self.toolset
|
||||
cxxdefs = []
|
||||
if self.cxxdefs:
|
||||
cxxdefs = ['define=%s' % (d) for d in self.cxxdefs.split(',')]
|
||||
self.b2(
|
||||
'-d1',
|
||||
'-p0',
|
||||
@ -114,9 +118,15 @@ using python : %(pyversion)s : "%(python)s" ;
|
||||
'--build-dir=%s' % (self.build_dir),
|
||||
'--out-xml=%s' % (os.path.join(self.build_dir, 'regression.xml')),
|
||||
'' if not toolset_to_test else 'toolset=%s' % (toolset_to_test),
|
||||
'' if not self.address_model else 'address-model=%s'%(self.address_model),
|
||||
'' if not self.address_model else 'address-model=%s' % (
|
||||
self.address_model),
|
||||
'variant=%s' % (self.variant),
|
||||
self.target
|
||||
'' if not self.cxxstd else 'cxxstd=%s' % (
|
||||
self.cxxstd),
|
||||
'' if not self.cxxdialect else 'cxxstd-dialect=%s' % (
|
||||
self.cxxdialect),
|
||||
self.target,
|
||||
*cxxdefs
|
||||
)
|
||||
|
||||
# Generate a readable test report.
|
||||
@ -138,4 +148,5 @@ using python : %(pyversion)s : "%(python)s" ;
|
||||
# utils.check_call("git","submodule","--quiet","foreach","git","clean","-dfqx")
|
||||
# utils.check_call("git","submodule","foreach","git","status","-bs")
|
||||
|
||||
|
||||
main(script)
|
||||
|
Reference in New Issue
Block a user