From 79c301b87565c4b51c6f52ce1f9444eaa087f5e7 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Wed, 21 Jun 2017 14:44:14 -0600 Subject: 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 --- scripts/vk_validation_stats.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/vk_validation_stats.py b/scripts/vk_validation_stats.py index a4abd6d6..7db67397 100755 --- a/scripts/vk_validation_stats.py +++ b/scripts/vk_validation_stats.py @@ -44,6 +44,14 @@ import platform # 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 @@ class ValidationHeader: #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 @@ def main(argv): 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, ]) -- cgit v1.2.3