• Home
  • Raw
  • Download

Lines Matching +full:is +full:- +full:binary +full:- +full:path

7 #     http://www.apache.org/licenses/LICENSE-2.0
10 # distributed under the License is distributed on an "AS IS" BASIS,
40 foo.vert -> foo.vert.[extension] [similarly for .frag, .comp, etc.]
41 foo.glsl -> foo.[extension]
42 foo.unknown -> foo.[extension]
43 foo -> foo.[extension]
45 if filename[-5:] not in [
64 """Checks that a given file exists and is not empty."""
65 if not os.path.isfile(filename):
67 if not os.path.getsize(filename):
73 """Mixin class for checking that the return code is zero."""
77 return False, 'Non-zero return code: {ret}\n'.format(
83 """Mixin class for checking that the return code is not zero."""
87 return False, 'return code is 0'
92 """Mixin class for checking that there is no output on stdout."""
101 """Mixin class for checking that there is no output on stderr."""
110 """Mixin class for checking that return code is zero and no output on
116 """Mixin class for checking that there is no file generated."""
122 all_files = [os.path.join(status.directory, f) for f in all_files]
123 generated_files = set(all_files) - set(input_files)
131 """Provides methods for verifying preamble for a SPIR-V binary."""
133 def verify_binary_length_and_header(self, binary, spv_version=0x10000): argument
134 """Checks that the given SPIR-V binary has valid length and header.
137 False, error string if anything is invalid
140 binary: a bytes object containing the SPIR-V binary
141 spv_version: target SPIR-V version number, with same encoding
142 as the version word in a SPIR-V header.
145 def read_word(binary, index, little_endian): argument
146 """Reads the index-th word from the given binary file."""
147 word = binary[index * 4:(index + 1) * 4]
152 def check_endianness(binary): argument
153 """Checks the endianness of the given SPIR-V binary.
157 None if magic number is wrong.
159 first_word = read_word(binary, 0, True)
162 first_word = read_word(binary, 0, False)
167 num_bytes = len(binary)
169 return False, ('Incorrect SPV binary: size should be a multiple'
172 return False, 'Incorrect SPV binary: size less than 5 words'
174 preamble = binary[0:19]
176 # SPIR-V module magic number
177 if little_endian is None:
178 return False, 'Incorrect SPV binary: wrong magic number'
180 # SPIR-V version number
186 …return False, 'Incorrect SPV binary: wrong version number: ' + hex(version) + ' expected ' + hex(s…
187 # Shaderc-over-Glslang (0x000d....) or
188 # SPIRV-Tools (0x0007....) generator number
191 return False, ('Incorrect SPV binary: wrong generator magic ' 'number')
194 return False, 'Incorrect SPV binary: the 5th byte should be 0'
205 """Checks that the given SPIR-V binary file has correct preamble."""
217 binary = bytes(object_file.read())
218 return self.verify_binary_length_and_header(binary, spv_version)
236 if (line1 != '; SPIR-V\n' or line2 != '; Version: 1.0\n' or
244 """Mixin class for checking that every input file generates a valid SPIR-V 1.0
245 object file following the object file naming rule, and there is no output on
252 os.path.join(status.directory, object_filename))
259 """Mixin class for checking that every input file generates a valid SPIR-V 1.3
260 object file following the object file naming rule, and there is no output on
267 os.path.join(status.directory, object_filename), 0x10300)
274 """Mixin class for checking that every input file generates a valid SPIR-V 1.5
275 object file following the object file naming rule, and there is no output on
282 os.path.join(status.directory, object_filename), 0x10500)
289 """Mixin class for checking that every input file generates a valid SPIR-V 1.6
290 object file following the object file naming rule, and there is no output on
297 os.path.join(status.directory, object_filename), 0x10600)
307 file following the object file naming rule, there is no output on
315 obj_file = str(os.path.join(status.directory, object_filename))
319 cmd = [status.test_manager.disassembler_path, '--no-color', obj_file]
339 names are correctly generated, and there is no output on stdout/stderr.
348 os.path.join(status.directory, object_filename))
360 target_filename = os.path.join(status.directory, self.target_filename)
361 if not os.path.isfile(target_filename):
393 file following the assembly file naming rule, and there is no output on
400 os.path.join(status.directory, assembly_filename))
408 file following the assembly file naming rule, there is no output on
420 os.path.join(status.directory, assembly_filename))
435 file following the assembly file naming rule, there is no output on
447 os.path.join(status.directory, assembly_filename))
462 names are correctly generated, and there is no output on stdout/stderr.
471 os.path.join(status.directory, assembly_filename))
491 # On Unix, a negative value -N for Popen.returncode indicates
520 # On Unix, a negative value -N for Popen.returncode indicates
565 os.path.join(status.directory, object_filename))
581 os.path.join(status.directory, assembly_filename))
594 will not check what it is. If it's a string, expect an exact match. If it's
595 anything else, it is assumed to be a compiled regular expression which will
602 # care what it is, we want to distinguish this from "blah" which means we
604 if self.expected_stdout is True:
628 but will not check what it is. If it's a string, expect an exact match.
629 If it's anything else, it is assumed to be a compiled regular expression
636 # care what it is, we want to distinguish this from "blah" which means we
638 if self.expected_stderr is True:
679 full_object_file = os.path.join(status.directory, object_filename)
681 if os.path.isfile(full_object_file):
694 if os.path.isfile(object_filename):
703 It works by analyzing the output of the --print-all flag to spirv-opt.