Unverified Commit 82b1d1da by Patrick Steinhardt Committed by GitHub

Merge pull request #5141 from pks-t/pks/azure-drop-powershell

azure: drop powershell
parents 90858192 415ee616
...@@ -57,6 +57,7 @@ OPTION(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON) ...@@ -57,6 +57,7 @@ OPTION(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON)
OPTION(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON)/HTTPS/Generic" ON) OPTION(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON)/HTTPS/Generic" ON)
OPTION(USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF) OPTION(USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF)
OPTION(USE_STANDALONE_FUZZERS "Enable standalone fuzzers (compatible with gcc)" OFF) OPTION(USE_STANDALONE_FUZZERS "Enable standalone fuzzers (compatible with gcc)" OFF)
OPTION(USE_LEAK_CHECKER "Run tests with leak checker" OFF)
OPTION(VALGRIND "Configure build for valgrind" OFF) OPTION(VALGRIND "Configure build for valgrind" OFF)
OPTION(DEBUG_POOL "Enable debug pool allocator" OFF) OPTION(DEBUG_POOL "Enable debug pool allocator" OFF)
OPTION(ENABLE_WERROR "Enable compilation with -Werror" OFF) OPTION(ENABLE_WERROR "Enable compilation with -Werror" OFF)
......
...@@ -16,8 +16,8 @@ jobs: ...@@ -16,8 +16,8 @@ jobs:
imageName: 'libgit2/trusty-amd64:latest' imageName: 'libgit2/trusty-amd64:latest'
environmentVariables: | environmentVariables: |
CC=gcc CC=gcc
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON CMAKE_GENERATOR=Unix Makefiles
LEAK_CHECK=valgrind CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
- job: linux_amd64_trusty_gcc_mbedtls - job: linux_amd64_trusty_gcc_mbedtls
displayName: 'Linux (amd64; Trusty; GCC; mbedTLS)' displayName: 'Linux (amd64; Trusty; GCC; mbedTLS)'
...@@ -29,8 +29,8 @@ jobs: ...@@ -29,8 +29,8 @@ jobs:
imageName: 'libgit2/trusty-amd64:latest' imageName: 'libgit2/trusty-amd64:latest'
environmentVariables: | environmentVariables: |
CC=gcc CC=gcc
CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON CMAKE_GENERATOR=Unix Makefiles
LEAK_CHECK=valgrind CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
- job: linux_amd64_trusty_clang_openssl - job: linux_amd64_trusty_clang_openssl
displayName: 'Linux (amd64; Trusty; Clang; OpenSSL)' displayName: 'Linux (amd64; Trusty; Clang; OpenSSL)'
...@@ -42,8 +42,8 @@ jobs: ...@@ -42,8 +42,8 @@ jobs:
imageName: 'libgit2/trusty-amd64:latest' imageName: 'libgit2/trusty-amd64:latest'
environmentVariables: | environmentVariables: |
CC=clang CC=clang
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON CMAKE_GENERATOR=Unix Makefiles
LEAK_CHECK=valgrind CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
- job: linux_amd64_trusty_clang_mbedtls - job: linux_amd64_trusty_clang_mbedtls
displayName: 'Linux (amd64; Trusty; Clang; mbedTLS)' displayName: 'Linux (amd64; Trusty; Clang; mbedTLS)'
...@@ -55,73 +55,81 @@ jobs: ...@@ -55,73 +55,81 @@ jobs:
imageName: 'libgit2/trusty-amd64:latest' imageName: 'libgit2/trusty-amd64:latest'
environmentVariables: | environmentVariables: |
CC=clang CC=clang
CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON CMAKE_GENERATOR=Unix Makefiles
LEAK_CHECK=valgrind CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
- job: macos - job: macos
displayName: 'macOS' displayName: 'macOS'
pool: pool:
vmImage: 'macOS 10.13' vmImage: 'macOS 10.13'
steps: steps:
- bash: . '$(Build.SourcesDirectory)/ci/setup-osx.sh' - bash: . '$(Build.SourcesDirectory)/azure-pipelines/setup-osx.sh'
displayName: Setup displayName: Setup
- template: azure-pipelines/bash.yml - template: azure-pipelines/bash.yml
parameters: parameters:
environmentVariables: environmentVariables:
TMPDIR: $(Agent.TempDirectory) TMPDIR: $(Agent.TempDirectory)
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
LEAK_CHECK: leaks CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -G Ninja -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks
SKIP_SSH_TESTS: true SKIP_SSH_TESTS: true
- job: windows_vs_amd64 - job: windows_vs_amd64
displayName: 'Windows (amd64; Visual Studio)' displayName: 'Windows (amd64; Visual Studio)'
pool: Hosted pool: Hosted
steps: steps:
- template: azure-pipelines/powershell.yml - template: azure-pipelines/bash.yml
parameters: parameters:
environmentVariables: environmentVariables:
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -G"Visual Studio 12 2013 Win64" -DDEPRECATE_HARD=ON CMAKE_GENERATOR: Visual Studio 12 2013 Win64
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON
SKIP_SSH_TESTS: true
- job: windows_vs_x86 - job: windows_vs_x86
displayName: 'Windows (x86; Visual Studio)' displayName: 'Windows (x86; Visual Studio)'
pool: Hosted pool: Hosted
steps: steps:
- template: azure-pipelines/powershell.yml - template: azure-pipelines/bash.yml
parameters: parameters:
environmentVariables: environmentVariables:
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -G"Visual Studio 12 2013" -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS CMAKE_GENERATOR: Visual Studio 12 2013
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS
SKIP_SSH_TESTS: true
- job: windows_mingw_amd64 - job: windows_mingw_amd64
displayName: 'Windows (amd64; MinGW)' displayName: 'Windows (amd64; MinGW)'
pool: Hosted pool: Hosted
steps: steps:
- powershell: . '$(Build.SourcesDirectory)\ci\setup-mingw.ps1' - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh'
displayName: Setup displayName: Setup
env: env:
TEMP: $(Agent.TempDirectory) TEMP: $(Agent.TempDirectory)
ARCH: amd64 ARCH: amd64
- template: azure-pipelines/powershell.yml - template: azure-pipelines/bash.yml
parameters: parameters:
environmentVariables: environmentVariables:
CMAKE_OPTIONS: -G"MinGW Makefiles" -DDEPRECATE_HARD=ON BUILD_PATH: $(Agent.TempDirectory)\mingw64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
PATH: $(Agent.TempDirectory)\mingw64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\CMake\bin CMAKE_GENERATOR: MinGW Makefiles
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
SKIP_SSH_TESTS: true
- job: windows_mingw_x86 - job: windows_mingw_x86
displayName: 'Windows (x86; MinGW)' displayName: 'Windows (x86; MinGW)'
pool: Hosted pool: Hosted
steps: steps:
- powershell: . '$(Build.SourcesDirectory)\ci\setup-mingw.ps1' - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh'
displayName: Setup displayName: Setup
workingDirectory: '$(Build.BinariesDirectory)' workingDirectory: '$(Build.BinariesDirectory)'
env: env:
TEMP: $(Agent.TempDirectory) TEMP: $(Agent.TempDirectory)
ARCH: x86 ARCH: x86
- template: azure-pipelines/powershell.yml - template: azure-pipelines/bash.yml
parameters: parameters:
environmentVariables: environmentVariables:
CMAKE_OPTIONS: -G"MinGW Makefiles" -DDEPRECATE_HARD=ON BUILD_PATH: $(Agent.TempDirectory)\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
PATH: $(Agent.TempDirectory)\mingw32\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\CMake\bin CMAKE_GENERATOR: MinGW Makefiles
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
SKIP_SSH_TESTS: true
- job: documentation - job: documentation
displayName: 'Generate Documentation' displayName: 'Generate Documentation'
......
# These are the steps used for building on machines with bash. # These are the steps used for building on machines with bash.
steps: steps:
- bash: . '$(Build.SourcesDirectory)/ci/build.sh' - bash: . '$(Build.SourcesDirectory)/azure-pipelines/build.sh'
displayName: Build displayName: Build
workingDirectory: '$(Build.BinariesDirectory)' workingDirectory: '$(Build.BinariesDirectory)'
env: ${{ parameters.environmentVariables }} env: ${{ parameters.environmentVariables }}
- bash: . '$(Build.SourcesDirectory)/ci/test.sh' - bash: . '$(Build.SourcesDirectory)/azure-pipelines/test.sh'
displayName: Test displayName: Test
workingDirectory: '$(Build.BinariesDirectory)' workingDirectory: '$(Build.BinariesDirectory)'
env: ${{ parameters.environmentVariables }} env: ${{ parameters.environmentVariables }}
......
...@@ -9,7 +9,8 @@ set -e ...@@ -9,7 +9,8 @@ set -e
SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )} SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )}
BUILD_DIR=$(pwd) BUILD_DIR=$(pwd)
CC=${CC:-cc} BUILD_PATH=${BUILD_PATH:=$PATH}
CMAKE=$(which cmake)
indent() { sed "s/^/ /"; } indent() { sed "s/^/ /"; }
...@@ -31,21 +32,24 @@ echo "Kernel version:" ...@@ -31,21 +32,24 @@ echo "Kernel version:"
uname -a 2>&1 | indent uname -a 2>&1 | indent
echo "CMake version:" echo "CMake version:"
cmake --version 2>&1 | indent env PATH="$BUILD_PATH" "$CMAKE" --version 2>&1 | indent
echo "Compiler version:"
$CC --version 2>&1 | indent if test -n "$CC"; then
echo "Compiler version:"
"$CC" --version 2>&1 | indent
fi
echo "" echo ""
echo "##############################################################################" echo "##############################################################################"
echo "## Configuring build environment" echo "## Configuring build environment"
echo "##############################################################################" echo "##############################################################################"
echo cmake ${SOURCE_DIR} -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON ${CMAKE_OPTIONS} echo cmake ${SOURCE_DIR} -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON -G \"${CMAKE_GENERATOR}\" ${CMAKE_OPTIONS}
cmake ${SOURCE_DIR} -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON ${CMAKE_OPTIONS} env PATH="$BUILD_PATH" "$CMAKE" ${SOURCE_DIR} -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON -G "${CMAKE_GENERATOR}" ${CMAKE_OPTIONS}
echo "" echo ""
echo "##############################################################################" echo "##############################################################################"
echo "## Building libgit2" echo "## Building libgit2"
echo "##############################################################################" echo "##############################################################################"
cmake --build . env PATH="$BUILD_PATH" "$CMAKE" --build .
...@@ -18,7 +18,7 @@ jobs: ...@@ -18,7 +18,7 @@ jobs:
envVars: | envVars: |
COVERITY_TOKEN=$(COVERITY_TOKEN) COVERITY_TOKEN=$(COVERITY_TOKEN)
workDir: '/build' workDir: '/build'
containerCommand: '/src/ci/coverity-build.sh' containerCommand: '/src/azure-pipelines/coverity-build.sh'
detached: false detached: false
- task: Docker@0 - task: Docker@0
displayName: Publish displayName: Publish
...@@ -31,6 +31,6 @@ jobs: ...@@ -31,6 +31,6 @@ jobs:
envVars: | envVars: |
COVERITY_TOKEN=$(COVERITY_TOKEN) COVERITY_TOKEN=$(COVERITY_TOKEN)
workDir: '/build' workDir: '/build'
containerCommand: '/src/ci/coverity-publish.sh' containerCommand: '/src/azure-pipelines/coverity-publish.sh'
detached: false detached: false
continueOnError: true continueOnError: true
...@@ -14,7 +14,7 @@ steps: ...@@ -14,7 +14,7 @@ steps:
$(Build.BinariesDirectory):/build $(Build.BinariesDirectory):/build
envVars: ${{ parameters.environmentVariables }} envVars: ${{ parameters.environmentVariables }}
workDir: '/build' workDir: '/build'
containerCommand: '/src/ci/build.sh' containerCommand: '/src/azure-pipelines/build.sh'
detached: false detached: false
- task: docker@0 - task: docker@0
displayName: Test displayName: Test
...@@ -26,7 +26,7 @@ steps: ...@@ -26,7 +26,7 @@ steps:
$(Build.BinariesDirectory):/build $(Build.BinariesDirectory):/build
envVars: ${{ parameters.environmentVariables }} envVars: ${{ parameters.environmentVariables }}
workDir: '/build' workDir: '/build'
containerCommand: '/src/ci/test.sh' containerCommand: '/src/azure-pipelines/test.sh'
detached: false detached: false
- task: publishtestresults@2 - task: publishtestresults@2
displayName: Publish Test Results displayName: Publish Test Results
......
...@@ -12,8 +12,8 @@ jobs: ...@@ -12,8 +12,8 @@ jobs:
imageName: 'libgit2/trusty-amd64:latest' imageName: 'libgit2/trusty-amd64:latest'
environmentVariables: | environmentVariables: |
CC=gcc CC=gcc
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON CMAKE_GENERATOR=Unix Makefiles
LEAK_CHECK=valgrind CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
RUN_INVASIVE_TESTS=true RUN_INVASIVE_TESTS=true
- job: linux_amd64_trusty_gcc_mbedtls - job: linux_amd64_trusty_gcc_mbedtls
...@@ -26,8 +26,8 @@ jobs: ...@@ -26,8 +26,8 @@ jobs:
imageName: 'libgit2/trusty-amd64:latest' imageName: 'libgit2/trusty-amd64:latest'
environmentVariables: | environmentVariables: |
CC=gcc CC=gcc
CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON CMAKE_GENERATOR=Unix Makefiles
LEAK_CHECK=valgrind CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
RUN_INVASIVE_TESTS=true RUN_INVASIVE_TESTS=true
- job: linux_amd64_trusty_clang_openssl - job: linux_amd64_trusty_clang_openssl
...@@ -40,8 +40,8 @@ jobs: ...@@ -40,8 +40,8 @@ jobs:
imageName: 'libgit2/trusty-amd64:latest' imageName: 'libgit2/trusty-amd64:latest'
environmentVariables: | environmentVariables: |
CC=clang CC=clang
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON CMAKE_GENERATOR=Unix Makefiles
LEAK_CHECK=valgrind CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
RUN_INVASIVE_TESTS=true RUN_INVASIVE_TESTS=true
- job: linux_amd64_trusty_clang_mbedtls - job: linux_amd64_trusty_clang_mbedtls
...@@ -54,8 +54,8 @@ jobs: ...@@ -54,8 +54,8 @@ jobs:
imageName: 'libgit2/trusty-amd64:latest' imageName: 'libgit2/trusty-amd64:latest'
environmentVariables: | environmentVariables: |
CC=clang CC=clang
CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON CMAKE_GENERATOR=Unix Makefiles
LEAK_CHECK=valgrind CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
RUN_INVASIVE_TESTS=true RUN_INVASIVE_TESTS=true
- job: macos - job: macos
...@@ -63,15 +63,15 @@ jobs: ...@@ -63,15 +63,15 @@ jobs:
pool: pool:
vmImage: 'macOS 10.13' vmImage: 'macOS 10.13'
steps: steps:
- bash: . '$(Build.SourcesDirectory)/ci/setup-osx.sh' - bash: . '$(Build.SourcesDirectory)/azure-pipelines/setup-osx.sh'
displayName: Setup displayName: Setup
- template: bash.yml - template: bash.yml
parameters: parameters:
environmentVariables: environmentVariables:
TMPDIR: $(Agent.TempDirectory) TMPDIR: $(Agent.TempDirectory)
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
LEAK_CHECK: leaks CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -G Ninja -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks
RUN_INVASIVE_TESTS: true RUN_INVASIVE_TESTS: true
SKIP_SSH_TESTS: true SKIP_SSH_TESTS: true
...@@ -79,54 +79,62 @@ jobs: ...@@ -79,54 +79,62 @@ jobs:
displayName: 'Windows (amd64; Visual Studio)' displayName: 'Windows (amd64; Visual Studio)'
pool: Hosted pool: Hosted
steps: steps:
- template: powershell.yml - template: bash.yml
parameters: parameters:
environmentVariables: environmentVariables:
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -G"Visual Studio 12 2013 Win64" -DDEPRECATE_HARD=ON CMAKE_GENERATOR: Visual Studio 12 2013 Win64
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON
RUN_INVASIVE_TESTS: true RUN_INVASIVE_TESTS: true
SKIP_SSH_TESTS: true
- job: windows_vs_x86 - job: windows_vs_x86
displayName: 'Windows (x86; Visual Studio)' displayName: 'Windows (x86; Visual Studio)'
pool: Hosted pool: Hosted
steps: steps:
- template: powershell.yml - template: bash.yml
parameters: parameters:
environmentVariables: environmentVariables:
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -G"Visual Studio 12 2013" -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS CMAKE_GENERATOR: Visual Studio 12 2013
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS
RUN_INVASIVE_TESTS: true RUN_INVASIVE_TESTS: true
SKIP_SSH_TESTS: true
- job: windows_mingw_amd64 - job: windows_mingw_amd64
displayName: 'Windows (amd64; MinGW)' displayName: 'Windows (amd64; MinGW)'
pool: Hosted pool: Hosted
steps: steps:
- powershell: . '$(Build.SourcesDirectory)\ci\setup-mingw.ps1' - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh'
displayName: Setup displayName: Setup
env: env:
TEMP: $(Agent.TempDirectory) TEMP: $(Agent.TempDirectory)
ARCH: amd64 ARCH: amd64
- template: powershell.yml - template: bash.yml
parameters: parameters:
environmentVariables: environmentVariables:
CMAKE_OPTIONS: -G"MinGW Makefiles" -DDEPRECATE_HARD=ON BUILD_PATH: $(Agent.TempDirectory)\mingw64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
PATH: $(Agent.TempDirectory)\mingw64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\CMake\bin CMAKE_GENERATOR: MinGW Makefiles
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
RUN_INVASIVE_TESTS: true RUN_INVASIVE_TESTS: true
SKIP_SSH_TESTS: true
- job: windows_mingw_x86 - job: windows_mingw_x86
displayName: 'Windows (x86; MinGW)' displayName: 'Windows (x86; MinGW)'
pool: Hosted pool: Hosted
steps: steps:
- powershell: . '$(Build.SourcesDirectory)\ci\setup-mingw.ps1' - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh'
displayName: Setup displayName: Setup
workingDirectory: '$(Build.BinariesDirectory)' workingDirectory: '$(Build.BinariesDirectory)'
env: env:
TEMP: $(Agent.TempDirectory) TEMP: $(Agent.TempDirectory)
ARCH: x86 ARCH: x86
- template: powershell.yml - template: bash.yml
parameters: parameters:
environmentVariables: environmentVariables:
CMAKE_OPTIONS: -G"MinGW Makefiles" -DDEPRECATE_HARD=ON BUILD_PATH: $(Agent.TempDirectory)\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
PATH: $(Agent.TempDirectory)\mingw32\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\CMake\bin CMAKE_GENERATOR: MinGW Makefiles
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
RUN_INVASIVE_TESTS: true RUN_INVASIVE_TESTS: true
SKIP_SSH_TESTS: true
- job: linux_x86_bionic_gcc_openssl - job: linux_x86_bionic_gcc_openssl
displayName: 'Linux (x86; Bionic; GCC; OpenSSL)' displayName: 'Linux (x86; Bionic; GCC; OpenSSL)'
...@@ -139,8 +147,8 @@ jobs: ...@@ -139,8 +147,8 @@ jobs:
imageName: 'libgit2/bionic-x86:latest' imageName: 'libgit2/bionic-x86:latest'
environmentVariables: | environmentVariables: |
CC=gcc CC=gcc
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON CMAKE_GENERATOR=Unix Makefiles
LEAK_CHECK=valgrind CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
RUN_INVASIVE_TESTS=true RUN_INVASIVE_TESTS=true
- job: linux_x86_bionic_clang_openssl - job: linux_x86_bionic_clang_openssl
...@@ -154,8 +162,8 @@ jobs: ...@@ -154,8 +162,8 @@ jobs:
imageName: 'libgit2/bionic-x86:latest' imageName: 'libgit2/bionic-x86:latest'
environmentVariables: | environmentVariables: |
CC=clang CC=clang
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON CMAKE_GENERATOR=Unix Makefiles
LEAK_CHECK=valgrind CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
RUN_INVASIVE_TESTS=true RUN_INVASIVE_TESTS=true
- job: linux_arm32_bionic_gcc_openssl - job: linux_arm32_bionic_gcc_openssl
...@@ -169,6 +177,7 @@ jobs: ...@@ -169,6 +177,7 @@ jobs:
imageName: 'libgit2/bionic-arm32:latest' imageName: 'libgit2/bionic-arm32:latest'
environmentVariables: | environmentVariables: |
CC=gcc CC=gcc
CMAKE_GENERATOR=Unix Makefiles
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON
RUN_INVASIVE_TESTS=true RUN_INVASIVE_TESTS=true
SKIP_PROXY_TESTS=true SKIP_PROXY_TESTS=true
...@@ -184,6 +193,7 @@ jobs: ...@@ -184,6 +193,7 @@ jobs:
imageName: 'libgit2/bionic-arm64:latest' imageName: 'libgit2/bionic-arm64:latest'
environmentVariables: | environmentVariables: |
CC=gcc CC=gcc
CMAKE_GENERATOR=Unix Makefiles
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON
RUN_INVASIVE_TESTS=true RUN_INVASIVE_TESTS=true
SKIP_PROXY_TESTS=true SKIP_PROXY_TESTS=true
# These are the steps used for building on machines with PowerShell.
steps:
- powershell: . '$(Build.SourcesDirectory)\ci\build.ps1'
displayName: Build
workingDirectory: '$(Build.BinariesDirectory)'
env: ${{ parameters.environmentVariables }}
- powershell: . '$(Build.SourcesDirectory)\ci\test.ps1'
displayName: Test
workingDirectory: '$(Build.BinariesDirectory)'
env: ${{ parameters.environmentVariables }}
- task: PublishTestResults@2
displayName: Publish Test Results
condition: succeededOrFailed()
inputs:
testResultsFiles: 'results_*.xml'
searchFolder: '$(Build.BinariesDirectory)'
mergeTestResults: true
#!/bin/sh -e
echo "##############################################################################"
echo "## Downloading mingw"
echo "##############################################################################"
case "$ARCH" in
amd64)
MINGW_URI="https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-x86_64-8.1.0-release-win32-seh-rt_v6-rev0.zip";;
x86)
MINGW_URI="https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-i686-8.1.0-release-win32-sjlj-rt_v6-rev0.zip";;
esac
curl -s -L "$MINGW_URI" -o "$TEMP"/mingw-"$ARCH".zip
unzip -q "$TEMP"/mingw-"$ARCH".zip -d "$TEMP"
...@@ -13,15 +13,12 @@ USER=${USER:-$(whoami)} ...@@ -13,15 +13,12 @@ USER=${USER:-$(whoami)}
SUCCESS=1 SUCCESS=1
VALGRIND="valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions=\"$SOURCE_DIR/libgit2_clar.supp\""
LEAKS="MallocStackLogging=1 MallocScribble=1 MallocLogFile=/dev/null CLAR_AT_EXIT=\"leaks -quiet \$PPID\""
cleanup() { cleanup() {
echo "Cleaning up..." echo "Cleaning up..."
if [ ! -z "$GITDAEMON_DIR" -a -f "${GITDAEMON_DIR}/pid" ]; then if [ ! -z "$GITDAEMON_PID" ]; then
echo "Stopping git daemon..." echo "Stopping git daemon..."
kill $(cat "${GITDAEMON_DIR}/pid") kill $GITDAEMON_PID
fi fi
if [ ! -z "$SSHD_DIR" -a -f "${SSHD_DIR}/pid" ]; then if [ ! -z "$SSHD_DIR" -a -f "${SSHD_DIR}/pid" ]; then
...@@ -32,29 +29,7 @@ cleanup() { ...@@ -32,29 +29,7 @@ cleanup() {
echo "Done." echo "Done."
} }
# Ask ctest what it would run if we were to invoke it directly. This lets
# us manage the test configuration in a single place (tests/CMakeLists.txt)
# instead of running clar here as well. But it allows us to wrap our test
# harness with a leak checker like valgrind. Append the option to write
# JUnit-style XML files.
run_test() { run_test() {
TEST_CMD=$(ctest -N -V -R "^${1}$" | sed -n 's/^[0-9]*: Test command: //p')
if [ -z "$TEST_CMD" ]; then
echo "Could not find tests: $1"
exit 1
fi
TEST_CMD="${TEST_CMD} -r${BUILD_DIR}/results_${1}.xml"
if [ "$LEAK_CHECK" = "valgrind" ]; then
RUNNER="$VALGRIND $TEST_CMD"
elif [ "$LEAK_CHECK" = "leaks" ]; then
RUNNER="$LEAKS $TEST_CMD"
else
RUNNER="$TEST_CMD"
fi
if [[ "$GITTEST_FLAKY_RETRY" > 0 ]]; then if [[ "$GITTEST_FLAKY_RETRY" > 0 ]]; then
ATTEMPTS_REMAIN=$GITTEST_FLAKY_RETRY ATTEMPTS_REMAIN=$GITTEST_FLAKY_RETRY
else else
...@@ -70,7 +45,8 @@ run_test() { ...@@ -70,7 +45,8 @@ run_test() {
fi fi
RETURN_CODE=0 RETURN_CODE=0
eval $RUNNER || RETURN_CODE=$? && true
CLAR_SUMMARY="${BUILD_DIR}/results_${1}.xml" ctest -V -R "^${1}$" || RETURN_CODE=$? && true
if [ "$RETURN_CODE" -eq 0 ]; then if [ "$RETURN_CODE" -eq 0 ]; then
break break
...@@ -97,7 +73,8 @@ if [ -z "$SKIP_GITDAEMON_TESTS" ]; then ...@@ -97,7 +73,8 @@ if [ -z "$SKIP_GITDAEMON_TESTS" ]; then
echo "Starting git daemon..." echo "Starting git daemon..."
GITDAEMON_DIR=`mktemp -d ${TMPDIR}/gitdaemon.XXXXXXXX` GITDAEMON_DIR=`mktemp -d ${TMPDIR}/gitdaemon.XXXXXXXX`
git init --bare "${GITDAEMON_DIR}/test.git" git init --bare "${GITDAEMON_DIR}/test.git"
git daemon --listen=localhost --export-all --enable=receive-pack --pid-file="${GITDAEMON_DIR}/pid" --base-path="${GITDAEMON_DIR}" "${GITDAEMON_DIR}" 2>/dev/null & git daemon --listen=localhost --export-all --enable=receive-pack --base-path="${GITDAEMON_DIR}" "${GITDAEMON_DIR}" 2>/dev/null &
GITDAEMON_PID=$!
fi fi
if [ -z "$SKIP_PROXY_TESTS" ]; then if [ -z "$SKIP_PROXY_TESTS" ]; then
...@@ -256,9 +233,7 @@ if [ -z "$SKIP_FUZZERS" ]; then ...@@ -256,9 +233,7 @@ if [ -z "$SKIP_FUZZERS" ]; then
echo "## Running fuzzers" echo "## Running fuzzers"
echo "##############################################################################" echo "##############################################################################"
for fuzzer in fuzzers/*_fuzzer; do ctest -V -R 'fuzzer'
"${fuzzer}" "${SOURCE_DIR}/fuzzers/corpora/$(basename "${fuzzer%_fuzzer}")" || failure
done
fi fi
cleanup cleanup
......
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
if ($Env:SOURCE_DIR) { $SourceDirectory = $Env:SOURCE_DIR } else { $SourceDirectory = Split-Path (Split-Path $MyInvocation.MyCommand.Path -Parent) -Parent }
$BuildDirectory = $(Get-Location).Path
Write-Host "Source directory: ${SourceDirectory}"
Write-Host "Build directory: ${BuildDirectory}"
Write-Host ""
Write-Host "Operating system version:"
Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, ServicePackMajorVersion, BuildNumber, OSArchitecture | Format-List
Write-Host "PATH: ${Env:PATH}"
Write-Host ""
Write-Host "##############################################################################"
Write-Host "## Configuring build environment"
Write-Host "##############################################################################"
Invoke-Expression "cmake ${SourceDirectory} -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON -DENABLE_WERROR=ON ${Env:CMAKE_OPTIONS}"
if ($LastExitCode -ne 0) { [Environment]::Exit($LastExitCode) }
Write-Host ""
Write-Host "##############################################################################"
Write-Host "## Building libgit2"
Write-Host "##############################################################################"
cmake --build .
if ($LastExitCode -ne 0) { [Environment]::Exit($LastExitCode) }
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem");
Write-Host "##############################################################################"
Write-Host "## Downloading mingw"
Write-Host "##############################################################################"
if ($env:ARCH -eq "amd64") {
$mingw_uri = "https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-x86_64-8.1.0-release-win32-seh-rt_v6-rev0.zip"
$platform = "x86_64"
} else {
$mingw_uri = "https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-i686-8.1.0-release-win32-sjlj-rt_v6-rev0.zip"
$platform = "x86"
}
$wc = New-Object net.webclient
$wc.Downloadfile($mingw_uri, "${Env:TEMP}/mingw-${Env:ARCH}.zip")
[System.IO.Compression.ZipFile]::ExtractToDirectory("${Env:TEMP}/mingw-${Env:ARCH}.zip", $Env:TEMP)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$SourceDir = Split-Path (Split-Path (Get-Variable MyInvocation).Value.MyCommand.Path)
$BuildDir = Get-Location
$global:Success = $true
if ($Env:SKIP_TESTS) { exit }
# Ask ctest what it would run if we were to invoke it directly. This lets
# us manage the test configuration in a single place (tests/CMakeLists.txt)
# instead of running clar here as well. But it allows us to wrap our test
# harness with a leak checker like valgrind. Append the option to write
# JUnit-style XML files.
function run_test {
$TestName = $args[0]
$TestCommand = (ctest -N -V -R "^$TestName$") -join "`n"
if (-Not ($TestCommand -match "(?ms).*\n^[0-9]*: Test command: ")) {
echo "Could not find tests: $TestName"
exit
}
$TestCommand = (ctest -N -V -R "^$TestName$") -join "`n" -replace "(?ms).*\n^[0-9]*: Test command: ","" -replace "\n.*",""
$TestCommand += " -r${BuildDir}\results_${TestName}.xml"
if ($Env:GITTEST_FLAKY_RETRY -gt 0) {
$AttemptsRemain = $Env:GITTEST_FLAKY_RETRY
} else {
$AttemptsRemain = 1
}
$Failed = 0
while ($AttemptsRemain -ne 0) {
if ($Failed -eq 1) {
Write-Host ""
Write-Host "Re-running flaky $TestName tests..."
Write-Host ""
}
Invoke-Expression $TestCommand
if ($LastExitCode -eq 0) {
$Failed = 0
break
} else {
$Failed = 1
}
$AttemptsRemain = $AttemptsRemain - 1
}
if ($Failed -eq 1) { $global:Success = $false }
}
Write-Host "##############################################################################"
Write-Host "## Configuring test environment"
Write-Host "##############################################################################"
if (-not $Env:SKIP_PROXY_TESTS) {
Invoke-WebRequest -Method GET -Uri https://github.com/ethomson/poxyproxy/releases/download/v0.7.0/poxyproxy-0.7.0.jar -OutFile poxyproxy.jar
Write-Host ""
Write-Host "Starting HTTP proxy (Basic)..."
javaw -jar poxyproxy.jar --port 8080 --credentials foo:bar --auth-type basic --quiet
Write-Host ""
Write-Host "Starting HTTP proxy (NTLM)..."
javaw -jar poxyproxy.jar --port 8090 --credentials foo:bar --auth-type ntlm --quiet
}
if (-not $Env:SKIP_OFFLINE_TESTS) {
Write-Host ""
Write-Host "##############################################################################"
Write-Host "## Running (offline) tests"
Write-Host "##############################################################################"
run_test offline
}
if ($Env:RUN_INVASIVE_TESTS) {
Write-Host ""
Write-Host "##############################################################################"
Write-Host "## Running (invasive) tests"
Write-Host "##############################################################################"
$Env:GITTEST_INVASIVE_FS_SIZE=1
$Env:GITTEST_INVASIVE_MEMORY=1
$Env:GITTEST_INVASIVE_SPEED=1
run_test invasive
$Env:GITTEST_INVASIVE_FS_SIZE=$null
$Env:GITTEST_INVASIVE_MEMORY=$null
$Env:GITTEST_INVASIVE_SPEED=$null
}
if (-not $Env:SKIP_ONLINE_TESTS) {
Write-Host ""
Write-Host "##############################################################################"
Write-Host "## Running (online) tests"
Write-Host "##############################################################################"
$Env:GITTEST_FLAKY_RETRY=5
run_test online
$Env:GITTEST_FLAKY_RETRY=0
}
if (-not $Env:SKIP_PROXY_TESTS) {
# Test HTTP Basic authentication
Write-Host ""
Write-Host "Running proxy tests (Basic authentication)"
Write-Host ""
$Env:GITTEST_REMOTE_PROXY_HOST="localhost:8080"
$Env:GITTEST_REMOTE_PROXY_USER="foo"
$Env:GITTEST_REMOTE_PROXY_PASS="bar"
run_test proxy
# Test NTLM authentication
Write-Host ""
Write-Host "Running proxy tests (NTLM authentication)"
Write-Host ""
$Env:GITTEST_REMOTE_PROXY_HOST="localhost:8090"
$Env:GITTEST_REMOTE_PROXY_USER="foo"
$Env:GITTEST_REMOTE_PROXY_PASS="bar"
run_test proxy
$Env:GITTEST_REMOTE_PROXY_HOST=$null
$Env:GITTEST_REMOTE_PROXY_USER=$null
$Env:GITTEST_REMOTE_PROXY_PASS=$null
taskkill /F /IM javaw.exe
}
if (-Not $global:Success) { exit 1 }
...@@ -9,6 +9,8 @@ ENDIF () ...@@ -9,6 +9,8 @@ ENDIF ()
FILE(GLOB SRC_FUZZ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *_fuzzer.c) FILE(GLOB SRC_FUZZ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *_fuzzer.c)
FOREACH(fuzz_target_src ${SRC_FUZZ}) FOREACH(fuzz_target_src ${SRC_FUZZ})
STRING(REPLACE ".c" "" fuzz_target_name ${fuzz_target_src}) STRING(REPLACE ".c" "" fuzz_target_name ${fuzz_target_src})
STRING(REPLACE "_fuzzer" "" fuzz_name ${fuzz_target_name})
SET(${fuzz_target_name}_SOURCES ${fuzz_target_src} ${LIBGIT2_OBJECTS}) SET(${fuzz_target_name}_SOURCES ${fuzz_target_src} ${LIBGIT2_OBJECTS})
IF(USE_STANDALONE_FUZZERS) IF(USE_STANDALONE_FUZZERS)
LIST(APPEND ${fuzz_target_name}_SOURCES "standalone_driver.c") LIST(APPEND ${fuzz_target_name}_SOURCES "standalone_driver.c")
...@@ -16,4 +18,6 @@ FOREACH(fuzz_target_src ${SRC_FUZZ}) ...@@ -16,4 +18,6 @@ FOREACH(fuzz_target_src ${SRC_FUZZ})
ADD_EXECUTABLE(${fuzz_target_name} ${${fuzz_target_name}_SOURCES}) ADD_EXECUTABLE(${fuzz_target_name} ${${fuzz_target_name}_SOURCES})
SET_TARGET_PROPERTIES(${fuzz_target_name} PROPERTIES C_STANDARD 90) SET_TARGET_PROPERTIES(${fuzz_target_name} PROPERTIES C_STANDARD 90)
TARGET_LINK_LIBRARIES(${fuzz_target_name} ${LIBGIT2_LIBS}) TARGET_LINK_LIBRARIES(${fuzz_target_name} ${LIBGIT2_LIBS})
ADD_TEST(${fuzz_target_name} "${CMAKE_CURRENT_BINARY_DIR}/${fuzz_target_name}" "${CMAKE_CURRENT_SOURCE_DIR}/corpora/${fuzz_name}")
ENDFOREACH() ENDFOREACH()
#!/bin/sh
export MallocStackLogging=1
export MallocScribble=1
export MallocLogFile=/dev/null
export CLAR_AT_EXIT="leaks -quiet \$PPID"
exec "$@"
#!/bin/bash
exec valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions="$(dirname "${BASH_SOURCE[0]}")/valgrind.supp" "$@"
...@@ -57,9 +57,17 @@ IF (MSVC_IDE) ...@@ -57,9 +57,17 @@ IF (MSVC_IDE)
SET_SOURCE_FILES_PROPERTIES("precompiled.c" COMPILE_FLAGS "/Ycprecompiled.h") SET_SOURCE_FILES_PROPERTIES("precompiled.c" COMPILE_FLAGS "/Ycprecompiled.h")
ENDIF () ENDIF ()
ADD_TEST(offline "${libgit2_BINARY_DIR}/libgit2_clar" -v -xonline) FUNCTION(ADD_CLAR_TEST name)
ADD_TEST(invasive "${libgit2_BINARY_DIR}/libgit2_clar" -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root) IF (NOT USE_LEAK_CHECKER STREQUAL "OFF")
ADD_TEST(online "${libgit2_BINARY_DIR}/libgit2_clar" -v -sonline) ADD_TEST(${name} "${libgit2_SOURCE_DIR}/script/${USE_LEAK_CHECKER}.sh" "${libgit2_BINARY_DIR}/libgit2_clar" ${ARGN})
ADD_TEST(gitdaemon "${libgit2_BINARY_DIR}/libgit2_clar" -v -sonline::push) ELSE()
ADD_TEST(ssh "${libgit2_BINARY_DIR}/libgit2_clar" -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths) ADD_TEST(${name} "${libgit2_BINARY_DIR}/libgit2_clar" ${ARGN})
ADD_TEST(proxy "${libgit2_BINARY_DIR}/libgit2_clar" -v -sonline::clone::proxy) ENDIF()
ENDFUNCTION(ADD_CLAR_TEST)
ADD_CLAR_TEST(offline -v -xonline)
ADD_CLAR_TEST(invasive -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
ADD_CLAR_TEST(online -v -sonline)
ADD_CLAR_TEST(gitdaemon -v -sonline::push)
ADD_CLAR_TEST(ssh -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths)
ADD_CLAR_TEST(proxy -v -sonline::clone::proxy)
...@@ -145,7 +145,7 @@ static struct { ...@@ -145,7 +145,7 @@ static struct {
int report_suite_names; int report_suite_names;
int write_summary; int write_summary;
const char *summary_filename; char *summary_filename;
struct clar_summary *summary; struct clar_summary *summary;
struct clar_explicit *explicit; struct clar_explicit *explicit;
...@@ -474,8 +474,8 @@ clar_parse_args(int argc, char **argv) ...@@ -474,8 +474,8 @@ clar_parse_args(int argc, char **argv)
case 'r': case 'r':
_clar.write_summary = 1; _clar.write_summary = 1;
_clar.summary_filename = *(argument + 2) ? (argument + 2) : free(_clar.summary_filename);
"summary.xml"; _clar.summary_filename = strdup(*(argument + 2) ? (argument + 2) : "summary.xml");
break; break;
default: default:
...@@ -493,6 +493,11 @@ clar_test_init(int argc, char **argv) ...@@ -493,6 +493,11 @@ clar_test_init(int argc, char **argv)
"" ""
); );
if ((_clar.summary_filename = getenv("CLAR_SUMMARY")) != NULL) {
_clar.write_summary = 1;
_clar.summary_filename = strdup(_clar.summary_filename);
}
if (argc > 1) if (argc > 1)
clar_parse_args(argc, argv); clar_parse_args(argc, argv);
...@@ -553,6 +558,8 @@ clar_test_shutdown(void) ...@@ -553,6 +558,8 @@ clar_test_shutdown(void)
report_next = report->next; report_next = report->next;
free(report); free(report);
} }
free(_clar.summary_filename);
} }
int int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment