David Eichmann pushed to branch wip/davide/testdriver-cleanup at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • testsuite/driver/testlib.py
    ... ... @@ -2071,13 +2071,13 @@ async def multi_compile( name, way, top_mod, extra_mods, extra_hc_opts ):
    2071 2071
     async def multi_compile_fail( name, way, top_mod, extra_mods, extra_hc_opts ):
    
    2072 2072
         return await do_compile( name, way, True, top_mod, extra_mods, [], extra_hc_opts)
    
    2073 2073
     
    
    2074
    -async def make_depend( name, way, mods, extra_hc_opts ):
    
    2075
    -    return await do_compile( name, way, False, Path(' '.join(mods)), [], [], extra_hc_opts, mode = '-M')
    
    2074
    +async def make_depend( name: TestName, way: WayName, mods: List[str], extra_hc_opts: str ):
    
    2075
    +    return await do_compile( name, way, False, ' '.join(mods), [], [], extra_hc_opts, mode = '-M')
    
    2076 2076
     
    
    2077 2077
     async def do_compile(name: TestName,
    
    2078 2078
                    way: WayName,
    
    2079 2079
                    should_fail: bool,
    
    2080
    -               top_mod: Optional[Path],
    
    2080
    +               top_mod: Optional[Union[Path, str]],
    
    2081 2081
                    extra_mods: List[str],
    
    2082 2082
                    units: List[str],
    
    2083 2083
                    extra_hc_opts: str,
    
    ... ... @@ -2353,7 +2353,7 @@ async def simple_build(name: Union[TestName, str],
    2353 2353
                      way: WayName,
    
    2354 2354
                      extra_hc_opts: str,
    
    2355 2355
                      should_fail: bool,
    
    2356
    -                 top_mod: Optional[Path],
    
    2356
    +                 top_mod: Optional[Union[Path, str]],
    
    2357 2357
                      units: List[str],
    
    2358 2358
                      link: bool,
    
    2359 2359
                      addsuf: bool,
    
    ... ... @@ -2376,7 +2376,7 @@ async def simple_build(name: Union[TestName, str],
    2376 2376
             else:
    
    2377 2377
                 srcname = add_hs_lhs_suffix(name)
    
    2378 2378
         else:
    
    2379
    -        srcname = Path(name)
    
    2379
    +        srcname = name
    
    2380 2380
     
    
    2381 2381
         if mode is not None:
    
    2382 2382
             to_do = mode
    
    ... ... @@ -2423,9 +2423,7 @@ async def simple_build(name: Union[TestName, str],
    2423 2423
     
    
    2424 2424
         flags = ' '.join(get_compiler_flags() + config.way_flags[way])
    
    2425 2425
     
    
    2426
    -    cmd = ('{cmd_prefix} '
    
    2427
    -           '{{compiler}} {to_do} {srcname} {flags} {extra_hc_opts}'
    
    2428
    -          ).format(**locals())
    
    2426
    +    cmd = f'{cmd_prefix} {{compiler}} {to_do} {srcname} {flags} {extra_hc_opts}'
    
    2429 2427
     
    
    2430 2428
         if filter_with != '':
    
    2431 2429
             cmd = cmd + ' | ' + filter_with
    
    ... ... @@ -2624,13 +2622,12 @@ async def interpreter_run(name: TestName,
    2624 2622
     
    
    2625 2623
         flags = ' '.join(get_compiler_flags() + config.way_flags[way])
    
    2626 2624
     
    
    2627
    -    cmd = ('{{compiler}} {srcname} {flags} {extra_hc_opts}'
    
    2628
    -          ).format(**locals())
    
    2625
    +    cmd = f'{{compiler}} {srcname} {flags} {extra_hc_opts}'
    
    2629 2626
     
    
    2630 2627
         if opts.cmd_wrapper is not None:
    
    2631 2628
             cmd = opts.cmd_wrapper(cmd);
    
    2632 2629
     
    
    2633
    -    cmd = 'cd "{opts.testdir}" && {cmd}'.format(**locals())
    
    2630
    +    cmd = f'cd "{opts.testdir}" && {cmd}'
    
    2634 2631
     
    
    2635 2632
         exit_code = await runCmd(cmd, script, stdout, stderr, timeout_multiplier=opts.run_timeout_multiplier)
    
    2636 2633
     
    
    ... ... @@ -2828,7 +2825,7 @@ async def check_hp_ok(name: TestName) -> bool:
    2828 2825
         opts = getTestOpts()
    
    2829 2826
     
    
    2830 2827
         # do not qualify for hp2ps because we should be in the right directory
    
    2831
    -    hp2psCmd = 'cd "{opts.testdir}" && {{hp2ps}} {name}'.format(**locals())
    
    2828
    +    hp2psCmd = f'cd "{opts.testdir}" && {{hp2ps}} {name}'
    
    2832 2829
     
    
    2833 2830
         hp2psResult = await runCmd(hp2psCmd, print_output=True)
    
    2834 2831