MCPcopy Create free account
hub / github.com/WebAssembly/wabt / CreateInputFile

Method CreateInputFile

test/run-tests.py:585–605  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

583 raise Error('test has no commands')
584
585 def CreateInputFile(self):
586 gen_input_path = self.GetGeneratedInputFilename()
587 gen_input_dir = os.path.dirname(gen_input_path)
588 try:
589 os.makedirs(gen_input_dir)
590 except OSError:
591 if not os.path.isdir(gen_input_dir):
592 raise
593
594 # Read/write as binary because spec tests may have invalid UTF-8 codes.
595 with open(gen_input_path, 'wb') as gen_input_file:
596 if self.input_filename:
597 input_path = os.path.join(REPO_ROOT_DIR, self.input_filename)
598 with open(input_path, 'rb') as input_file:
599 gen_input_file.write(input_file.read())
600 else:
601 # add an empty line for each header line so the line numbers match
602 gen_input_file.write(('\n' * self.header.count('\n')).encode('ascii'))
603 gen_input_file.write(self.input_)
604 gen_input_file.flush()
605 return gen_input_file.name
606
607 def Rebase(self, stdout, stderr):
608 test_path = os.path.join(REPO_ROOT_DIR, self.filename)

Callers 1

RunTestFunction · 0.80

Calls 5

joinMethod · 0.80
readMethod · 0.80
countMethod · 0.80
flushMethod · 0.80

Tested by

no test coverage detected