scripts: Move layer scripts into scripts directory
authorMark Lobodzinski <mark@lunarg.com>
Wed, 21 Jun 2017 19:41:00 +0000 (13:41 -0600)
committerMark Lobodzinski <mark@lunarg.com>
Fri, 23 Jun 2017 16:27:55 +0000 (10:27 -0600)
Simplifies sharing code among python modules, keeps everything together.

- Moved python scripts out of layers dir into scripts dir
- Updated relative paths for input/output files in layers dir
- Updated doc validation tests to use correct paths

Change-Id: I57e6ad6f551d4fb652583315fe3dccb23b187db1

scripts/spec.py [moved from layers/spec.py with 98% similarity]
scripts/vk_validation_stats.py [moved from layers/vk_validation_stats.py with 98% similarity]
scripts/vuid_mapping.py [moved from layers/vuid_mapping.py with 100% similarity]
tests/_vkvalidatelayerdoc.ps1
tests/vkvalidatelayerdoc.sh

similarity index 98%
rename from layers/spec.py
rename to scripts/spec.py
index 13e18e2..de34632 100644 (file)
@@ -25,8 +25,8 @@ import vuid_mapping
 #############################
 
 
-out_filename = "vk_validation_error_messages.h" # can override w/ '-out <filename>' option
-db_filename = "vk_validation_error_database.txt" # can override w/ '-gendb <filename>' option
+out_filename = "../layers/vk_validation_error_messages.h" # can override w/ '-out <filename>' option
+db_filename = "../layers/vk_validation_error_database.txt" # can override w/ '-gendb <filename>' option
 json_filename = None # con pass in w/ '-json <filename> option
 gen_db = False # set to True when '-gendb <filename>' option provided
 json_compare = False # compare existing DB to json file input
similarity index 98%
rename from layers/vk_validation_stats.py
rename to scripts/vk_validation_stats.py
index 5fedd0d..a4abd6d 100755 (executable)
@@ -43,16 +43,16 @@ import platform
 #  2. Could use notes to store custom fields (like TODO) and print those out here
 #  3. Update test code to check if tests use new, unique enums to check for errors instead of strings
 
-db_file = 'vk_validation_error_database.txt'
+db_file = '../layers/vk_validation_error_database.txt'
 layer_source_files = [
-'core_validation.cpp',
-'descriptor_sets.cpp',
-'parameter_validation.cpp',
-'object_tracker.cpp',
-'shader_validation.cpp',
-'buffer_validation.cpp',
+'../layers/core_validation.cpp',
+'../layers/descriptor_sets.cpp',
+'../layers/parameter_validation.cpp',
+'../layers/object_tracker.cpp',
+'../layers/shader_validation.cpp',
+'../layers/buffer_validation.cpp',
 ]
-header_file = 'vk_validation_error_messages.h'
+header_file = '../layers/vk_validation_error_messages.h'
 # TODO : Don't hardcode linux path format if we want this to run on windows
 test_file = '../tests/layer_validation_tests.cpp'
 # List of enums that are allowed to be used more than once so don't warn on their duplicates
index 613e1ce..a3b5dc3 100644 (file)
@@ -4,11 +4,11 @@
 #    cd C:\src\Vulkan-LoaderAndValidationLayers\build\tests
 #    .\vkvalidatelayerdoc.ps1 [-Debug]
 
-if (-not (Test-Path -LiteralPath '..\..\layers')) {
+if (-not (Test-Path -LiteralPath '..\..\scripts')) {
     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"
+    write-host "  vk_validation_stats.py from the 'scripts' dir of your source tree"
     exit 0
 }
 
@@ -25,8 +25,8 @@ if (($args[0] -eq "terse_mode") -Or ($args[1] -eq "terse_mode")) {
 write-host -background black -foreground green "[  RUN     ] " -nonewline
 write-host "vkvalidatelayerdoc.ps1: Validate layer documentation"
 
-# Run doc validation from project layers dir
-push-location ..\..\layers
+# Run doc validation from project scripts dir
+push-location ..\..\scripts
 
 # Validate that layer documentation matches source contents
 python vk_validation_stats.py $output_mode
index e3e0c74..5aaefbc 100755 (executable)
@@ -11,17 +11,17 @@ else
     NC=''
 fi
 # If we can't find the source dir then skip
-if [ ! -d "../../layers" ]; then
+if [ ! -d "../../scripts" ]; 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"
+    printf "  vk_validation_stats.py from the 'scripts' dir of your source tree\n"
     exit
 fi
 
 printf "$GREEN[ RUN      ]$NC $0\n"
 
-# Run doc validation from project layers dir
-pushd ../../layers
+# Run doc validation from project scripts dir
+pushd ../../scripts
 
 # Validate that layer database matches source contents
 python vk_validation_stats.py $1