Завершить разделение SDK и внешних проектов
This commit is contained in:
@@ -153,8 +153,6 @@ void worker(void) __banked {
|
||||
try: launcher.wait(timeout=8)
|
||||
except subprocess.TimeoutExpired: launcher.kill();launcher.wait()
|
||||
profile=MameProfile.resolve()
|
||||
if profile.binary is None and (ROOT/'mame/v306/mame.arm').is_file():
|
||||
profile=MameProfile.resolve({'MAME_HOME':str(ROOT/'mame/v306')})
|
||||
profile.validate(dss=True)
|
||||
create_floppy_image(str(work/'probe.img'),[('PROBE.EXE',str(exe))])
|
||||
system=work/'system.chd'
|
||||
@@ -264,9 +262,6 @@ end)
|
||||
installed = profile.home.parent / 'plugins'
|
||||
if installed.is_dir():
|
||||
plugin_paths.append(installed)
|
||||
legacy = ROOT / 'mame/sources/MAME/plugins'
|
||||
if legacy.is_dir():
|
||||
plugin_paths.append(legacy)
|
||||
command.extend(['-verbose','-plugin','sdbgbridge','-pluginspath',
|
||||
';'.join(map(str, plugin_paths))])
|
||||
with (work/'mame.log').open('w') as log:
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
@@ -85,9 +86,15 @@ def wait_event(process, buffer, event, timeout):
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--build', default=None)
|
||||
parser.add_argument('--app-hdd', default=None)
|
||||
parser.add_argument('--launch-path', default=None)
|
||||
options, _ = parser.parse_known_args()
|
||||
if not PYTHON.is_file():
|
||||
raise RuntimeError('Нет local pyenv shim: '+str(PYTHON))
|
||||
build = ROOT/'tests/hello/.sprinter-cc-hello'
|
||||
build = Path(options.build).resolve() if options.build else \
|
||||
ROOT/'tests/hello/.sprinter-cc-hello'
|
||||
command = [str(PYTHON), str(ROOT/'toolchain/sdbg_dap.py')]
|
||||
process = subprocess.Popen(command, cwd=ROOT, stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
@@ -95,8 +102,13 @@ def main():
|
||||
try:
|
||||
send(process, 1, 'initialize')
|
||||
_, buffer, _ = wait_response(process, buffer, 'initialize', 10)
|
||||
send(process, 2, 'launch', {'build': str(build), 'debugger': 'sdbg',
|
||||
'dssTimeout': 30})
|
||||
debugger = 'osx' if '--osx' in sys.argv else 'sdbg'
|
||||
launch = {'build': str(build), 'debugger': debugger, 'dssTimeout': 30}
|
||||
if options.app_hdd:
|
||||
launch['appHdd'] = str(Path(options.app_hdd).resolve())
|
||||
if options.launch_path:
|
||||
launch['launchPath'] = options.launch_path
|
||||
send(process, 2, 'launch', launch)
|
||||
launched, buffer, events = wait_response(process, buffer, 'launch', 80)
|
||||
if not any(item.get('event') == 'initialized' for item in events):
|
||||
initialized, buffer = receive(process, buffer, 5)
|
||||
|
||||
@@ -128,19 +128,5 @@ class DapTests(unittest.TestCase):
|
||||
self.assertEqual([item['type'] for item in messages],
|
||||
['response', 'response'])
|
||||
|
||||
def test_vscode_extension_activates_before_debug_adapter_factory(self):
|
||||
extension_dir = ROOT / 'toolchain' / 'vscode-sprinter-debug'
|
||||
manifest = json.loads((extension_dir / 'package.json').read_text())
|
||||
self.assertIn('onDebug', manifest['activationEvents'])
|
||||
self.assertNotIn('onDebug:sprinter-mame', manifest['activationEvents'])
|
||||
self.assertEqual('auto', manifest['contributes']['configuration']
|
||||
['properties']['sprinterDebugger.pythonCommand']['default'])
|
||||
self.assertTrue((extension_dir / manifest['main']).is_file())
|
||||
debugger_types = {
|
||||
item['type'] for item in manifest['contributes']['debuggers']
|
||||
}
|
||||
self.assertIn('sprinter-mame', debugger_types)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -114,6 +114,22 @@ class Integration(unittest.TestCase):
|
||||
self.assertEqual(value['bank'],1)
|
||||
self.assertEqual(value['window'],1)
|
||||
|
||||
def test_04a_absolute_variable_is_not_confused_with_code(self):
|
||||
source=self.work/'absolute.c'
|
||||
source.write_text('''
|
||||
__at (0x4000) volatile unsigned char scratch;
|
||||
int main(void) { scratch = 42; return 0; }
|
||||
''')
|
||||
self.build('absolute',[source],'--src-debug')
|
||||
model=self.model('absolute')
|
||||
scratch=next(v for v in model.variables if v['name']=='scratch')
|
||||
self.assertEqual(scratch['section'],'_ABS')
|
||||
self.assertEqual(scratch['logical_address'],0x4000)
|
||||
self.assertEqual(scratch['window'],1)
|
||||
self.assertIsNone(scratch['bank'])
|
||||
with self.assertRaisesRegex(ValueError,'секция'):
|
||||
model.location(0x4000)
|
||||
|
||||
def test_05_stale_sources_and_corrupt_artifacts(self):
|
||||
source=self.work/'stale.c'
|
||||
source.write_text('int main(void) {return 42;}')
|
||||
|
||||
Reference in New Issue
Block a user