scripts: Add parameter_validation.h to doc validator
As the python script doesn't know where the generated source ends up,
added a search of the build, dbuild, and release layers dirs. This
generated file contains LOTS of VUIDs.
Change-Id: I767ae2c3af11a0686ee629edb9964b294b5f7e08
diff --git a/scripts/vk_validation_stats.py b/scripts/vk_validation_stats.py
index a4abd6d..7db6739 100755
--- a/scripts/vk_validation_stats.py
+++ b/scripts/vk_validation_stats.py
@@ -44,6 +44,14 @@
# 3. Update test code to check if tests use new, unique enums to check for errors instead of strings
db_file = '../layers/vk_validation_error_database.txt'
+generated_layer_source_directories = [
+'build',
+'dbuild',
+'release',
+]
+generated_layer_source_files = [
+'parameter_validation.h',
+]
layer_source_files = [
'../layers/core_validation.cpp',
'../layers/descriptor_sets.cpp',
@@ -164,8 +172,26 @@
#print "Found %d error enums. First is %s and last is %s." % (len(self.enums), self.enums[0], self.enums[-1])
class ValidationSource:
- def __init__(self, source_file_list):
+ def __init__(self, source_file_list, generated_source_file_list, generated_source_directories):
self.source_files = source_file_list
+ self.generated_source_files = generated_source_file_list
+ self.generated_source_dirs = generated_source_directories
+
+ if len(self.generated_source_files) > 0:
+ qualified_paths = []
+ for source in self.generated_source_files:
+ for build_dir in self.generated_source_dirs:
+ filepath = '../%s/layers/%s' % (build_dir, source)
+ if os.path.isfile(filepath):
+ qualified_paths.append(filepath)
+ continue
+ if len(self.generated_source_files) != len(qualified_paths):
+ print("Error: Unable to locate one or more of the following source files in the build, dbuild, or release directories")
+ print(self.generated_source_files)
+ quit()
+ else:
+ self.source_files.extend(qualified_paths)
+
self.enum_count_dict = {} # dict of enum values to the count of how much they're used, and location of where they're used
# 1500099c is a special case that provides an exception when an extension is enabled. No specific error is flagged, but the exception is handled so add it here
self.enum_count_dict['VALIDATION_ERROR_1500099c'] = {}
@@ -287,7 +313,7 @@
val_header = ValidationHeader()
val_header.read()
# Create parser for layer files
- val_source = ValidationSource(layer_source_files)
+ val_source = ValidationSource(layer_source_files, generated_layer_source_files, generated_layer_source_directories)
val_source.parse()
# Parse test files
test_parser = TestParser([test_file, ])