layers: Return an error when generator scripts fail.
authorJamie Madill <jmadill@chromium.org>
Wed, 8 Nov 2017 18:50:14 +0000 (13:50 -0500)
committerTobin Ehlis <tobine@google.com>
Thu, 9 Nov 2017 15:43:16 +0000 (08:43 -0700)
Currently the scripts would abort with an error message, but not an OS
error code. Adding an error code allows build systems to correctly
detect the script failure as a failed build step.

Change-Id: I142a6215a3c02e6a880bfce0c3aba2c3c8fc4ff1

scripts/object_tracker_generator.py
scripts/parameter_validation_generator.py

index 5106bb4..33c8b3e 100644 (file)
@@ -246,7 +246,7 @@ class ObjectTrackerOutputGenerator(OutputGenerator):
                 break
         if self.vuid_file == None:
             print("Error: Could not find vk_validation_error_messages.h")
-            quit()
+            sys.exit(1)
     #
     # Check if the parameter passed in is optional
     def paramIsOptional(self, param):
index 032b9fd..85078a6 100644 (file)
@@ -201,7 +201,7 @@ class ParameterValidationOutputGenerator(OutputGenerator):
                 break
         if self.vuid_file == None:
             print("Error: Could not find vk_validation_error_messages.h")
-            quit()
+            sys.exit(1)
     #
     # Generate Copyright comment block for file
     def GenerateCopyright(self):
@@ -246,7 +246,7 @@ class ParameterValidationOutputGenerator(OutputGenerator):
     def IdToHex(self, dec_num):
         if dec_num > 4294967295:
             print ("ERROR: Decimal # %d can't be represented in 8 hex digits" % (dec_num))
-            sys.exit()
+            sys.exit(1)
         hex_num = hex(dec_num)
         return hex_num[2:].zfill(8)
     #