David Eichmann pushed to branch wip/davide/testdriver-cleanup at Glasgow Haskell Compiler / GHC Commits: 1fd4ffe9 by David Eichmann at 2026-11-13T15:19:29+00:00 test driver refactor: replace `.format(**locals())` with f-string - - - - - 79ae9248 by David Eichmann at 2026-11-13T15:19:47+00:00 test driver: clarify `make_depend()` and `top_mod` type and usage - - - - - 1 changed file: - testsuite/driver/testlib.py Changes: ===================================== testsuite/driver/testlib.py ===================================== @@ -2071,13 +2071,13 @@ async def multi_compile( name, way, top_mod, extra_mods, extra_hc_opts ): async def multi_compile_fail( name, way, top_mod, extra_mods, extra_hc_opts ): return await do_compile( name, way, True, top_mod, extra_mods, [], extra_hc_opts) -async def make_depend( name, way, mods, extra_hc_opts ): - return await do_compile( name, way, False, Path(' '.join(mods)), [], [], extra_hc_opts, mode = '-M') +async def make_depend( name: TestName, way: WayName, mods: List[str], extra_hc_opts: str ): + return await do_compile( name, way, False, ' '.join(mods), [], [], extra_hc_opts, mode = '-M') async def do_compile(name: TestName, way: WayName, should_fail: bool, - top_mod: Optional[Path], + top_mod: Optional[Union[Path, str]], extra_mods: List[str], units: List[str], extra_hc_opts: str, @@ -2353,7 +2353,7 @@ async def simple_build(name: Union[TestName, str], way: WayName, extra_hc_opts: str, should_fail: bool, - top_mod: Optional[Path], + top_mod: Optional[Union[Path, str]], units: List[str], link: bool, addsuf: bool, @@ -2376,7 +2376,7 @@ async def simple_build(name: Union[TestName, str], else: srcname = add_hs_lhs_suffix(name) else: - srcname = Path(name) + srcname = name if mode is not None: to_do = mode @@ -2423,9 +2423,7 @@ async def simple_build(name: Union[TestName, str], flags = ' '.join(get_compiler_flags() + config.way_flags[way]) - cmd = ('{cmd_prefix} ' - '{{compiler}} {to_do} {srcname} {flags} {extra_hc_opts}' - ).format(**locals()) + cmd = f'{cmd_prefix} {{compiler}} {to_do} {srcname} {flags} {extra_hc_opts}' if filter_with != '': cmd = cmd + ' | ' + filter_with @@ -2624,13 +2622,12 @@ async def interpreter_run(name: TestName, flags = ' '.join(get_compiler_flags() + config.way_flags[way]) - cmd = ('{{compiler}} {srcname} {flags} {extra_hc_opts}' - ).format(**locals()) + cmd = f'{{compiler}} {srcname} {flags} {extra_hc_opts}' if opts.cmd_wrapper is not None: cmd = opts.cmd_wrapper(cmd); - cmd = 'cd "{opts.testdir}" && {cmd}'.format(**locals()) + cmd = f'cd "{opts.testdir}" && {cmd}' exit_code = await runCmd(cmd, script, stdout, stderr, timeout_multiplier=opts.run_timeout_multiplier) @@ -2828,7 +2825,7 @@ async def check_hp_ok(name: TestName) -> bool: opts = getTestOpts() # do not qualify for hp2ps because we should be in the right directory - hp2psCmd = 'cd "{opts.testdir}" && {{hp2ps}} {name}'.format(**locals()) + hp2psCmd = f'cd "{opts.testdir}" && {{hp2ps}} {name}' hp2psResult = await runCmd(hp2psCmd, print_output=True) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f857e2adceac3ab0d9316c1feff7d20... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f857e2adceac3ab0d9316c1feff7d20... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
David Eichmann (@DavidEichmann)