• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 # Powershell script for running validating the layer database file
2 # To run this test:
3 #    From a Windows powershell:
4 #    cd C:\src\Vulkan-LoaderAndValidationLayers\build\tests
5 #    .\vkvalidatelayerdoc.ps1 [-Debug]
6 
7 if (-not (Test-Path -LiteralPath '..\..\scripts')) {
8     write-host -background black -foreground green "[  SKIPPED  ] " -nonewline
9     write-host "vkvalidatelayerdoc.ps1: Validate layer documentation"
10     write-host "  To run validation DB checks you can manually execute"
11     write-host "  vk_validation_stats.py from the 'scripts' dir of your source tree"
12     exit 0
13 }
14 
15 if ($args[0] -eq "-Debug") {
16     $dPath = "Debug"
17 } else {
18     $dPath = "Release"
19 }
20 
21 write-host -background black -foreground green "[  RUN     ] " -nonewline
22 write-host "vkvalidatelayerdoc.ps1: Validate layer documentation"
23 
24 # Run doc validation from project scripts dir
25 push-location ..\..\scripts
26 
27 # Validate that layer documentation matches source contents
28 python vk_validation_stats.py
29 
30 # Report result based on exit code
31 if (!$LASTEXITCODE) {
32     write-host -background black -foreground green "[  PASSED  ] " -nonewline;
33     $exitstatus = 0
34 } else {
35     echo 'Validation of vk_validation_error_database.txt failed'
36     write-host -background black -foreground red "[  FAILED  ] "  -nonewline;
37     echo '1 FAILED TEST'
38     $exitstatus = 1
39 }
40 
41 pop-location
42 exit $exitstatus
43