def _get_ctl(self, elements='abtdrmsc', write_hex=0, skool=TEST_SKOOL, preserve_base=False, min_address=0, max_address=65536): skoolfile = self.write_text_file(skool, suffix='.skool') writer = CtlWriter(skoolfile, elements, write_hex, preserve_base, min_address, max_address) writer.write() return self.out.getvalue().split('\n')[:-1]
def run(skoolfile, options): writer = CtlWriter(skoolfile, options.elements, options.write_hex, options.preserve_base, options.start, options.end) writer.write()
def _get_ctl(self, elements='btdrmsc', write_hex=False, write_asm_dirs=True, skool=TEST_SKOOL, preserve_base=False): skoolfile = self.write_text_file(skool, suffix='.skool') writer = CtlWriter(skoolfile, elements, write_hex, write_asm_dirs, preserve_base) writer.write() return self.out.getvalue().split('\n')[:-1]
def test_s_directive_invalid_value(self): with self.assertRaisesRegex(SkoolParsingError, "^Invalid integer 'y': DEFS 10,y$"): CtlWriter(StringIO('s30000 DEFS 10,y'))
def test_s_directive_invalid_size(self): with self.assertRaisesRegex(SkoolParsingError, "^Invalid integer 'x': DEFS x,1$"): CtlWriter(StringIO('s30000 DEFS x,1'))
def test_invalid_address(self): with self.assertRaises(SkoolParsingError) as cm: CtlWriter(self.write_text_file('c3000f RET')) self.assertEqual(cm.exception.args[0], "Invalid address (3000f):\nc3000f RET")
def _get_ctl(self, elements='abtdrmsc', write_hex=0, skool=TEST_SKOOL, preserve_base=False, min_address=0, max_address=65536): skoolfile = StringIO(skool) writer = CtlWriter(skoolfile, elements, write_hex, preserve_base, min_address, max_address) writer.write() return self.out.getvalue().split('\n')[:-1]