Skip to content

Commit

Permalink
Initial commit - conformance tests as approved by WG 20200521.
Browse files Browse the repository at this point in the history
  • Loading branch information
rpavlik committed Jul 6, 2020
0 parents commit 0fae170
Show file tree
Hide file tree
Showing 554 changed files with 159,234 additions and 0 deletions.
115 changes: 115 additions & 0 deletions .azure-pipelines/build_jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
parameters:
sourceDir: '$(System.DefaultWorkingDirectory)'

jobs:
# Build the loader, API layers, and samples on Linux
- job: linux_build
displayName: 'Linux'
strategy:
matrix:
xlib:
buildType: RelWithDebInfo
presentationBackend: xlib
xcb:
buildType: RelWithDebInfo
presentationBackend: xcb
wayland:
buildType: RelWithDebInfo
presentationBackend: wayland
pool:
vmImage: 'ubuntu-latest'
container: khronosgroup/docker-images:openxr-sdk
steps:
# First build as debug
- template: build_linux.yml
parameters:
sourceDir: ${{parameters.sourceDir}}
buildType: Debug
cmakeArgs: '-DPRESENTATION_BACKEND=$(PresentationBackend)'

# Then build release
- template: build_linux.yml
parameters:
sourceDir: ${{parameters.sourceDir}}
buildType: RelWithDebInfo
cmakeArgs: '-DPRESENTATION_BACKEND=$(PresentationBackend)'

# This job computes the product of the config dimensions
- job: generator
steps:
- task: PythonScript@0
name: winmatrix
inputs:
scriptPath: $(System.DefaultWorkingDirectory)/.azure-pipelines/generate_windows_matrix_build.py
# argument sets the variable name defined by python script
arguments: winbuild

# Build the loader, API layers, and samples on Windows
- job: windows_build
dependsOn: generator
displayName: 'Windows MSVC'
variables:
VULKAN_SDK: "$(System.DefaultWorkingDirectory)\\vulkan_sdk\\$(VULKAN_SDK_VERSION)"
pool:
vmImage: 'windows-latest'
# Use the json emitted by the generator job to set up this matrix
strategy:
matrix: $[ dependencies.generator.outputs['winmatrix.winbuild'] ]
steps:
- template: build_msvc.yml
parameters:
sourceDir: ${{parameters.sourceDir}}
buildType: $(buildType)
generator: "$(generator)"
cmakeArgs: $(cmakeArgs) -DBUILD_ALL_EXTENSIONS=ON
useVulkan: 'true'

- task: PublishPipelineArtifact@1
displayName: Publish loader
condition: and(succeeded(), eq(variables.buildType, 'RelWithDebInfo'))
inputs:
path: ${{parameters.sourceDir}}/install
artifact: $(artifactName)

# Build the loader, API layers, and samples on Windows with MinGW
# - job: mingw_build
# displayName: 'Windows MinGW'
# variables:
# VULKAN_SDK: "$(System.DefaultWorkingDirectory)\\vulkan_sdk\\$(VULKAN_SDK_VERSION)"
# pool:
# vmImage: 'windows-latest'
# steps:
# - template: build_mingw.yml
# parameters:
# sourceDir: ${{parameters.sourceDir}}
# buildType: RelWithDebInfo
# cmakeArgs: -DBUILD_ALL_EXTENSIONS=ON
# useVulkan: 'true'

- job: combine_artifacts
dependsOn: windows_build
displayName: "Organize artifacts"
pool:
vmImage: 'windows-latest'
steps:
- download: current
patterns: "**/*.dll"
displayName: Download dynamic libraries
- download: current
patterns: "**/*.lib"
displayName: Download link import libraries
- download: current
patterns: "**/*.h"
displayName: Download headers

- task: PythonScript@0
displayName: Move artifact contents
inputs:
scriptPath: $(System.DefaultWorkingDirectory)/.azure-pipelines/organize_windows_artifacts.py
arguments: $(Pipeline.Workspace) $(System.DefaultWorkingDirectory)/openxr_loader
- task: PublishPipelineArtifact@1
displayName: Publish combined artifact
condition: succeeded()
inputs:
path: $(System.DefaultWorkingDirectory)/openxr_loader
artifact: openxr_loader_windows
19 changes: 19 additions & 0 deletions .azure-pipelines/build_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
parameters:
buildType: RelWithDebInfo
cmakeArgs: ''
buildDir: build
sourceDir: '$(System.DefaultWorkingDirectory)'

steps:
- script: |
rm -rf ${{ parameters.sourceDir }}/${{ parameters.buildDir }}
mkdir -p ${{ parameters.sourceDir }}/${{ parameters.buildDir }}
displayName: 'Clean up and create new build directory'
- script: cmake -G Ninja .. -DCMAKE_BUILD_TYPE=${{ parameters.buildType }} ${{ parameters.cmakeArgs }}
workingDirectory: ${{ parameters.sourceDir }}/${{ parameters.buildDir }}
displayName: 'Generate build system'

- script: ninja
workingDirectory: ${{ parameters.sourceDir }}/${{ parameters.buildDir }}
displayName: 'Compile'
33 changes: 33 additions & 0 deletions .azure-pipelines/build_mingw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
parameters:
buildType: 'Debug'
cmakeArgs: ''
sourceDir: '$(System.DefaultWorkingDirectory)'
useVulkan: 'true'

steps:
# - script: choco install -y ninja
# displayName: 'Install Ninja'

- script: mkdir $(System.DefaultWorkingDirectory)\\vulkan_sdk
displayName: 'Make Vulkan SDK dir'

- powershell: ./.azure-pipelines/install_vulkan.ps1
displayName: Install Vulkan SDK
workingDirectory: '${{ parameters.sourceDir }}'
condition: eq('${{ parameters.useVulkan}}', 'true')

- script: mkdir build
displayName: 'Create build directory'
workingDirectory: '${{ parameters.sourceDir }}'

- script: |
set VULKAN_SDK=$(System.DefaultWorkingDirectory)\\vulkan_sdk\\$(VULKAN_SDK_VERSION)
cmake .. -G "MinGW Makefiles" ${{ parameters.cmakeArgs }} -DCMAKE_BUILD_TYPE=${{ parameters.buildType }} -DCMAKE_INSTALL_PREFIX=${{ parameters.sourceDir }}/install
displayName: 'Generate build system'
workingDirectory: '${{ parameters.sourceDir }}/build'
- script: mingw32-make -C build -j
displayName: Build all targets

- script: mingw32-make -C build install
displayName: Install build
37 changes: 37 additions & 0 deletions .azure-pipelines/build_msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
parameters:
buildType: 'Debug'
generator: 'Visual Studio 16 2019'
cmakeArgs: ''
sourceDir: '$(System.DefaultWorkingDirectory)'
useVulkan: 'true'

steps:

- powershell: ./.azure-pipelines/install_vulkan.ps1
displayName: Install Vulkan SDK
workingDirectory: '${{ parameters.sourceDir }}'
condition: eq('${{ parameters.useVulkan}}', 'true')

- script: mkdir build
displayName: 'Create build directory'
workingDirectory: '${{ parameters.sourceDir }}'

- script: |
set VULKAN_SDK=$(System.DefaultWorkingDirectory)\\vulkan_sdk\\$(VULKAN_SDK_VERSION)
cmake .. -G "${{ parameters.generator }}" ${{ parameters.cmakeArgs }} -DCMAKE_INSTALL_PREFIX=${{ parameters.sourceDir }}/install
displayName: 'Generate build system'
workingDirectory: '${{ parameters.sourceDir }}/build'
- task: MSBuild@1
displayName: Build all targets
inputs:
solution: '${{ parameters.sourceDir }}/build/ALL_BUILD.vcxproj'
maximumCpuCount: true
configuration: ${{ parameters.buildType }}

- task: MSBuild@1
displayName: Install build
inputs:
solution: '${{ parameters.sourceDir }}/build/INSTALL.vcxproj'
maximumCpuCount: true
configuration: ${{ parameters.buildType }}
23 changes: 23 additions & 0 deletions .azure-pipelines/check_clang_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

jobs:
- job: check_clang_format
displayName: 'clang-format'
pool:
vmImage: 'ubuntu-16.04'
container: khronosgroup/docker-images:openxr-sdk
steps:
- script: ./runClangFormat.sh
displayName: Run clang-format

- script: git diff --patch --exit-code > clang-format.patch
displayName: Save changes as diff

# In case of failure (clang-format changes needed) do these two things
- script: echo "The following files need clang-formatting:"; sed -n -e "s/^diff.* b\///p" clang-format.patch
condition: failed()
- task: PublishPipelineArtifact@1
displayName: Publish diff
condition: failed()
inputs:
path: $(System.DefaultWorkingDirectory)/clang-format.patch
artifact: clang-format-changes
10 changes: 10 additions & 0 deletions .azure-pipelines/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

jobs:
- job: check_codespell
displayName: 'codespell'
pool:
vmImage: 'ubuntu-16.04'
container: khronosgroup/docker-images:openxr-sdk
steps:
- script: ./checkCodespell
displayName: Run Codespell script
100 changes: 100 additions & 0 deletions .azure-pipelines/cts_build_jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
parameters:
sourceDir: '$(System.DefaultWorkingDirectory)'

jobs:
# Build the loader, API layers, and samples on Linux
- job: linux_build
displayName: 'Linux'
strategy:
matrix:
xlib:
buildType: RelWithDebInfo
presentationBackend: xlib
# xcb:
# buildType: RelWithDebInfo
# presentationBackend: xcb
# wayland:
# buildType: RelWithDebInfo
# presentationBackend: wayland
pool:
vmImage: 'ubuntu-latest'
container: khronosgroup/docker-images:openxr-sdk
steps:
# First build as debug
- template: build_linux.yml
parameters:
sourceDir: ${{parameters.sourceDir}}
buildType: Debug
cmakeArgs: '-DPRESENTATION_BACKEND=$(PresentationBackend)'

# Then build release
- template: build_linux.yml
parameters:
sourceDir: ${{parameters.sourceDir}}
buildType: RelWithDebInfo
cmakeArgs: '-DPRESENTATION_BACKEND=$(PresentationBackend)'

# This job computes the product of the config dimensions
- job: generator
steps:
- task: PythonScript@0
name: winmatrix
inputs:
scriptPath: $(System.DefaultWorkingDirectory)/.azure-pipelines/generate_windows_matrix_build.py
# argument sets the variable name defined by python script
arguments: winbuild

# Build the loader, API layers, and samples on Windows
- job: windows_build
dependsOn: generator
displayName: 'Windows MSVC'
variables:
VULKAN_SDK: "$(System.DefaultWorkingDirectory)\\vulkan_sdk\\$(VULKAN_SDK_VERSION)"
pool:
vmImage: 'windows-latest'
# Use the json emitted by the generator job to set up this matrix
strategy:
matrix: $[ dependencies.generator.outputs['winmatrix.winbuild'] ]
steps:
- template: build_msvc.yml
parameters:
sourceDir: ${{parameters.sourceDir}}
buildType: $(buildType)
generator: "$(generator)"
cmakeArgs: $(cmakeArgs) -DBUILD_ALL_EXTENSIONS=ON
useVulkan: 'true'

- task: PublishPipelineArtifact@1
displayName: Publish loader
condition: and(succeeded(), eq(variables.buildType, 'RelWithDebInfo'))
inputs:
path: ${{parameters.sourceDir}}/install/conformance
artifact: $(artifactName)

# - job: combine_artifacts
# dependsOn: windows_build
# displayName: "Organize artifacts"
# pool:
# vmImage: 'windows-latest'
# steps:
# - download: current
# patterns: "**/*.dll"
# displayName: Download dynamic libraries
# - download: current
# patterns: "**/*.lib"
# displayName: Download link import libraries
# - download: current
# patterns: "**/*.h"
# displayName: Download headers

# - task: PythonScript@0
# displayName: Move artifact contents
# inputs:
# scriptPath: $(System.DefaultWorkingDirectory)/.azure-pipelines/organize_windows_artifacts.py
# arguments: $(Pipeline.Workspace) $(System.DefaultWorkingDirectory)/openxr_loader
# - task: PublishPipelineArtifact@1
# displayName: Publish combined artifact
# condition: succeeded()
# inputs:
# path: $(System.DefaultWorkingDirectory)/openxr_loader
# artifact: openxr_loader_windows
37 changes: 37 additions & 0 deletions .azure-pipelines/generate_windows_matrix_build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python3
# Copyright (c) 2019 The Khronos Group Inc.

from itertools import product

from shared import (PLATFORMS, TRUE_FALSE, VS_VERSION, make_win_artifact_name,
output_json)

if __name__ == "__main__":

configs = {}
for platform, debug, uwp in product(PLATFORMS, (False,), TRUE_FALSE):
# No need to support ARM/ARM64 except for UWP.
if not uwp and (platform.lower() == 'arm' or platform.lower() == 'arm64'):
continue

label = [platform]
config = []
generator = VS_VERSION
config.append('-A ' + platform)
config.append('-DDYNAMIC_LOADER=ON')
if debug:
label.append('debug')
if uwp:
label.append('UWP')
config.append('-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0')
name = '_'.join(label)
configs[name] = {
'generator': generator,
'buildType': 'Debug' if debug else 'RelWithDebInfo',
'cmakeArgs': ' '.join(config)
}
if not debug:
configs[name]['artifactName'] = make_win_artifact_name(
platform, uwp)

output_json(configs)
Loading

0 comments on commit 0fae170

Please sign in to comment.