diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2017-06-21 14:44:14 -0600 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2017-06-27 09:40:18 -0600 |
| commit | 79c301b87565c4b51c6f52ce1f9444eaa087f5e7 (patch) | |
| tree | 62253c158a083e7f6b85bead4f8defcdf3d8165c /scripts | |
| parent | 2c98d5fe5ddd43f36f24cad46d0c7cd5da19dbb4 (diff) | |
| download | usermoji-79c301b87565c4b51c6f52ce1f9444eaa087f5e7.tar.xz | |
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
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/vk_validation_stats.py | 30 |
1 files changed, 28 insertions, 2 deletions
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, ]) |
