2021-01-27 13:11:54 +03:00
|
|
|
# Copyright (c) Microsoft Corporation.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
|
|
|
|
parameters:
|
|
|
|
- name: hostArch
|
|
|
|
type: string
|
|
|
|
- name: targetArch
|
|
|
|
type: string
|
2024-04-19 03:10:29 +03:00
|
|
|
- name: ctestOptions
|
2023-09-29 19:45:22 +03:00
|
|
|
type: string
|
2024-04-19 03:10:29 +03:00
|
|
|
- name: skipTesting
|
|
|
|
type: boolean
|
2021-01-27 13:11:54 +03:00
|
|
|
steps:
|
2024-04-19 03:10:29 +03:00
|
|
|
- script: |
|
|
|
|
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
|
|
|
|
-host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo
|
|
|
|
ctest --verbose ${{ parameters.ctestOptions }}
|
|
|
|
displayName: 'Build and Run Tests'
|
2024-02-16 23:32:41 +03:00
|
|
|
timeoutInMinutes: 30
|
2024-04-19 03:10:29 +03:00
|
|
|
condition: and(succeeded(), not(${{ parameters.skipTesting }}))
|
|
|
|
workingDirectory: $(buildOutputLocation)
|
2021-01-27 13:11:54 +03:00
|
|
|
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: 'Publish Tests'
|
2023-06-15 11:13:35 +03:00
|
|
|
timeoutInMinutes: 5
|
2024-04-19 03:10:29 +03:00
|
|
|
condition: and(succeededOrFailed(), not(${{ parameters.skipTesting }}))
|
2021-01-27 13:11:54 +03:00
|
|
|
inputs:
|
2023-10-06 21:53:15 +03:00
|
|
|
searchFolder: $(buildOutputLocation)
|
2021-01-27 13:11:54 +03:00
|
|
|
testResultsFormat: JUnit
|
|
|
|
testResultsFiles: '**/test-results.xml'
|
2024-04-19 03:10:29 +03:00
|
|
|
testRunTitle: 'test-${{ parameters.targetArch }}-$(System.JobPositionInPhase)'
|
2023-10-06 21:53:15 +03:00
|
|
|
- publish: $(buildOutputLocation)/test-results.xml
|
2024-04-19 03:10:29 +03:00
|
|
|
artifact: '${{ parameters.targetArch }}-$(System.JobPositionInPhase)-xml-$(System.JobId)'
|
|
|
|
condition: and(failed(), not(${{ parameters.skipTesting }}))
|
2022-03-05 01:43:34 +03:00
|
|
|
displayName: 'Publish XML Artifact'
|