Skip to content

Commit

Permalink
Merge b91a6ae into c1a8460
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Nov 1, 2020
2 parents c1a8460 + b91a6ae commit b9162a2
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 13 deletions.
14 changes: 14 additions & 0 deletions .ci/azure_pipelines/cmake-test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@echo off

C:\x64.bat

dir

mkdir build
cd build

cmake ../project/cmake
cmake --build .
ctest -V --output-on-failure

exit /b 0
35 changes: 35 additions & 0 deletions .ci/azure_pipelines/template-cmake-docker-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# optional cmake test steps template

parameters:
container_target: 'gcc_10'
cmake_options: ''
ctest_options: ''
apt_get: false

steps:
- script: |
echo test | docker login
displayName: 'docker login check'

- script: |
mkdir build && cd build && cmake ../projects/cmake ${{ parameters.cmake_options }}
target:
container: ${{ parameters.container_target }}
displayName: 'generate'

- script: |
cd build && cmake --build .
target:
container: ${{ parameters.container_target }}
displayName: 'build'

- script: |
cd build && ctest ${{ parameters.ctest_options }} -V --output-on-failure
target:
container: ${{ parameters.container_target }}
displayName: 'test'

- task: Docker@2
inputs:
command: stop
container: ${{ parameters.container_target }}
2 changes: 1 addition & 1 deletion .ci/azure_pipelines/template-configcheck-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

parameters:
target: ''
vmImage: 'ubuntu 16.04'
vmImage: 'ubuntu-latest'

# target
# sh 'make disable_feature_param'
Expand Down
2 changes: 1 addition & 1 deletion .ci/azure_pipelines/template-make-disabled-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
parameters:
name: ''
options: ''
vmImage: 'ubuntu 16.04'
vmImage: 'ubuntu-latest'

jobs:
- job: ${{ parameters.name }}
Expand Down
2 changes: 1 addition & 1 deletion .ci/azure_pipelines/template-make-mix-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
parameters:
name: ''
options: ''
vmImage: 'ubuntu 16.04'
vmImage: 'ubuntu-latest'

jobs:
- job: ${{ parameters.name }}
Expand Down
2 changes: 1 addition & 1 deletion .ci/azure_pipelines/template-make-nofeature-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
parameters:
name: ''
options: ''
vmImage: 'ubuntu 16.04'
vmImage: 'ubuntu-latest'

jobs:
- job: ${{ parameters.name }}
Expand Down
2 changes: 1 addition & 1 deletion .ci/azure_pipelines/template-make-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
parameters:
name: ''
options: ''
vmImage: 'ubuntu 16.04'
vmImage: 'ubuntu-latest'

jobs:
- job: ${{ parameters.name }}
Expand Down
41 changes: 39 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pr:
- develop
- azure-pipelines/*
- azurepipelines/*
- azp/*
paths:
exclude:
- "*.md"
Expand Down Expand Up @@ -76,13 +77,25 @@ pr:
- .travis.yml
- wercker.yml

resources:
containers:
- container: gcc_10
image: rikorose/gcc-cmake:gcc-10
options: "--name ci-container"
- container: wine_msvc
image: madduci/docker-wine-msvc:16.7-2019
options: "-u root --name ci-container"

stages:
- stage: Precheck
jobs:
- job: syntax_test
pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-latest
steps:
# - script: |
# echo test | docker login
# displayName: 'docker login check'
- script: make -C test -j4 syntax_tests_run
displayName: 'syntax test'
- stage: Test
Expand Down Expand Up @@ -127,6 +140,30 @@ stages:
generator_name: Visual Studio 16 2019
platform: x64
cmake_options: "${CMAKE_OPTIONS}"
- stage: DockerContaierTest
dependsOn: Precheck
jobs:
- job: gcc
pool:
vmImage: ubuntu-latest
steps:
- template: .ci/azure_pipelines/template-cmake-docker-steps.yml
parameters:
container_target: gcc_10
- job: wine_msvc
pool:
vmImage: ubuntu-latest
steps:
- script: |
echo launch
target:
container: wine_msvc
displayName: 'launch'
- script: |
ln -sf $(Build.SourcesDirectory)/iutet /home/wine/.wine/drive_c/iutest
/usr/bin/docker exec -t -u wine ci-container bash -c "wine64 dir"
/usr/bin/docker exec -t -u wine ci-container bash -c "wine64 ./iutest/.ci/azure_pipelines/cmake-test.bat"
displayName: 'cmake test'
# - stage: CodeQL
# dependsOn: Precheck
# variables:
Expand All @@ -135,7 +172,7 @@ stages:
# - template: .ci/azure_pipelines/template-codeql-job.yml
# parameters:
# github_access_token: "$(GITHUB_AUTH_TOKEN)"
# - stage: Publish
# - stage: Publish
# dependsOn:
# Test
# ConfigDisabledTest
Expand Down
2 changes: 1 addition & 1 deletion test/cxx_feature_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ IUTEST(Optional, Compare)
IUTEST_EXPECT_EQ(::std::nullopt, opt);
}
{
::std::optional<int> opt = ::std::nullopt;
static const ::std::optional<int> opt = ::std::nullopt;
IUTEST_EXPECT_FALSE(opt);
IUTEST_EXPECT_NONFATAL_FAILURE(IUTEST_EXPECT_EQ(1234, opt), "1234");
}
Expand Down
9 changes: 9 additions & 0 deletions test/spi_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class SPITest : public ::iutest::Test
const ::std::string sa2;
TestObjectX ox;
TestObjectX oy;
#if IUTEST_HAS_CXX_HDR_VARIANT
const ::std::variant<int, float, ::std::string> v;
#endif

SPITest()
: null_str(NULL)
Expand All @@ -57,6 +60,9 @@ class SPITest : public ::iutest::Test
, sb("b")
, ox(0, 1, 2)
, oy(0, 0, 0)
#if IUTEST_HAS_CXX_HDR_VARIANT
, v(1)
#endif
{
const char ac_[5] = { 0, 0, 2, 3, 5 };
for( int i=0; i < 5; ++i )
Expand Down Expand Up @@ -86,6 +92,9 @@ const float fa = static_cast<float>(a);
const double da = static_cast<double>(a);
const TestObjectX ox(0, 1, 2);
const TestObjectX oy(0, 0, 0);
#if IUTEST_HAS_CXX_HDR_VARIANT
const ::std::variant<int, float, ::std::string> v = 1;
#endif
#endif

void SPITest::FatalFailure_Sub(int& count)
Expand Down
7 changes: 2 additions & 5 deletions test/spi_tests_decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,8 @@
#endif

#if IUTEST_HAS_CXX_HDR_VARIANT
{
::std::variant<int, float, ::std::string> v = 1;
FAILURE_MACRO( FLAVOR(_EQ)(v, 0), "Which is: 1" );
FAILURE_MACRO( FLAVOR(_EQ)(0.1f, v), "Actual: 1" );
}
FAILURE_MACRO( FLAVOR(_EQ)(v, 0), "Which is: 1" );
FAILURE_MACRO( FLAVOR(_EQ)(0.1f, v), "Actual: 1" );
#endif

#undef FLAVOR
Expand Down

0 comments on commit b9162a2

Please sign in to comment.