scripts:Skip doc validation if src dir not found
authorTobin Ehlis <tobine@google.com>
Tue, 20 Jun 2017 20:16:15 +0000 (14:16 -0600)
committerTobin Ehlis <tobine@google.com>
Tue, 20 Jun 2017 22:52:57 +0000 (16:52 -0600)
Fixes #1878

If vkvalidatelayerdoc script is not run from a directly two levels
below the layer source, then just skip running it. Print out a message
on how to run doc validation manually for those interested.

tests/_run_all_tests.ps1
tests/_vkvalidatelayerdoc.ps1
tests/run_all_tests.sh
tests/vkvalidatelayerdoc.sh

index a46fa38..28a0732 100644 (file)
@@ -31,6 +31,6 @@ if ($lastexitcode -ne 0) {
 
 & $dPath\vk_layer_validation_tests --gtest_filter=-$TestExceptions
 
-& .\vkvalidatelayerdoc.ps1 terse_mode
+& .\vkvalidatelayerdoc.ps1 terse_mode
 
 exit $lastexitcode
index 87c4c88..613e1ce 100644 (file)
@@ -4,6 +4,14 @@
 #    cd C:\src\Vulkan-LoaderAndValidationLayers\build\tests
 #    .\vkvalidatelayerdoc.ps1 [-Debug]
 
+if (-not (Test-Path -LiteralPath '..\..\layers')) {
+    write-host -background black -foreground green "[  SKIPPED  ] " -nonewline
+    write-host "vkvalidatelayerdoc.ps1: Validate layer documentation"
+    write-host "  To run validation DB checks you can manually execute"
+    write-host "  vk_validation_stats.py from the 'layers' dir of your source tree"
+    exit 0
+}
+
 if ($args[0] -eq "-Debug") {
     $dPath = "Debug"
 } else {
index 7d1e4e4..b47f888 100755 (executable)
@@ -10,7 +10,7 @@ set -e
 ./run_loader_tests.sh
 
 # Verify that validation checks in source match documentation
-#./vkvalidatelayerdoc.sh terse_mode
+./vkvalidatelayerdoc.sh terse_mode
 
 # vk_layer_validation_tests check to see that validation layers will
 # catch the errors that they are supposed to by intentionally doing things
index 4bf3722..e3e0c74 100755 (executable)
@@ -1,5 +1,6 @@
 #!/bin/bash
 #set -x
+
 if [ -t 1 ] ; then
     RED='\033[0;31m'
     GREEN='\033[0;32m'
@@ -9,6 +10,13 @@ else
     GREEN=''
     NC=''
 fi
+# If we can't find the source dir then skip
+if [ ! -d "../../layers" ]; then
+    printf "$GREEN[ SKIPPED  ]$NC $0\n"
+    printf "  To run validation DB checks you can manually execute\n"
+    printf "  vk_validation_stats.py from the 'layers' dir of your source tree\n"
+    exit
+fi
 
 printf "$GREEN[ RUN      ]$NC $0\n"