Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 0318010b by Zubin Duggal at 2025-12-04T04:37:27-05:00 testlib: Optionally include the way name in the expected output file This allows us to have different outputs for different ways. - - - - - 6d945fdd by Zubin Duggal at 2025-12-04T04:37:27-05:00 testsuite: Accept output of tests failing in ext-interp way due to differing compilation requirements Fixes #26552 - - - - - 8 changed files: - testsuite/driver/testlib.py - + testsuite/tests/driver/T20696/T20696.stderr-ext-interp - testsuite/tests/driver/T20696/all.T - testsuite/tests/driver/fat-iface/all.T - + testsuite/tests/driver/fat-iface/fat012.stderr-ext-interp - + testsuite/tests/driver/fat-iface/fat015.stderr-ext-interp - + testsuite/tests/splice-imports/SI07.stderr-ext-interp - testsuite/tests/splice-imports/all.T Changes: ===================================== testsuite/driver/testlib.py ===================================== @@ -1971,7 +1971,7 @@ async def do_compile(name: TestName, # of whether we expected the compilation to fail or not (successful # compilations may generate warnings). - expected_stderr_file = find_expected_file(name, 'stderr') + expected_stderr_file = find_expected_file(name, 'stderr', way) actual_stderr_file = add_suffix(name, 'comp.stderr') diff_file_name = in_testdir(add_suffix(name, 'comp.diff')) @@ -2012,7 +2012,7 @@ async def compile_cmp_asm(name: TestName, # of whether we expected the compilation to fail or not (successful # compilations may generate warnings). - expected_asm_file = find_expected_file(name, 'asm') + expected_asm_file = find_expected_file(name, 'asm', way) actual_asm_file = add_suffix(name, 's') if not await compare_outputs(way, 'asm', @@ -2036,7 +2036,7 @@ async def compile_grep_asm(name: TestName, if badResult(result): return result - expected_pat_file = find_expected_file(name, 'asm') + expected_pat_file = find_expected_file(name, 'asm', way) actual_asm_file = add_suffix(name, 's') if not grep_output(join_normalisers(normalise_errmsg), @@ -2058,7 +2058,7 @@ async def compile_grep_core(name: TestName, if badResult(result): return result - expected_pat_file = find_expected_file(name, 'substr-simpl') + expected_pat_file = find_expected_file(name, 'substr-simpl', way) actual_core_file = add_suffix(name, 'dump-simpl') if not grep_output(join_normalisers(normalise_errmsg), @@ -2097,7 +2097,7 @@ async def compile_and_run__(name: TestName, return result if compile_stderr: - expected_stderr_file = find_expected_file(name, 'ghc.stderr') + expected_stderr_file = find_expected_file(name, 'ghc.stderr', way) actual_stderr_file = add_suffix(name, 'comp.stderr') diff_file_name = in_testdir(add_suffix(name, 'comp.diff')) @@ -2556,7 +2556,7 @@ def get_compiler_flags() -> List[str]: async def stdout_ok(name: TestName, way: WayName) -> bool: actual_stdout_file = add_suffix(name, 'run.stdout') - expected_stdout_file = find_expected_file(name, 'stdout') + expected_stdout_file = find_expected_file(name, 'stdout', way) extra_norm = join_normalisers(normalise_output, getTestOpts().extra_normaliser) @@ -2583,7 +2583,7 @@ def dump_stdout( name: TestName ) -> None: async def stderr_ok(name: TestName, way: WayName) -> bool: actual_stderr_file = add_suffix(name, 'run.stderr') - expected_stderr_file = find_expected_file(name, 'stderr') + expected_stderr_file = find_expected_file(name, 'stderr', way) return await compare_outputs(way, 'stderr', join_normalisers(normalise_errmsg, getTestOpts().extra_errmsg_normaliser), \ @@ -2688,7 +2688,7 @@ async def check_hp_ok(name: TestName) -> bool: return False async def check_prof_ok(name: TestName, way: WayName) -> bool: - expected_prof_file = find_expected_file(name, 'prof.sample') + expected_prof_file = find_expected_file(name, 'prof.sample', way) expected_prof_path = in_testdir(expected_prof_file) # Check actual prof file only if we have an expected prof file to @@ -3368,18 +3368,19 @@ def in_statsdir(name: Union[Path, str], suffix: str='') -> Path: # Finding the sample output. The filename is of the form # -# <test>.stdout[-ws-<wordsize>][-<platform>|-<os>] +# <test>.stdout[-ws-<wordsize>][-<platform>|-<os>][-<way>] # -def find_expected_file(name: TestName, suff: str) -> Path: +def find_expected_file(name: TestName, suff: str, way: WayName) -> Path: basename = add_suffix(name, suff) # Override the basename if the user has specified one, this will then be # subjected to the same name mangling scheme as normal to allow platform # specific overrides to work. basename = getTestOpts().use_specs.get(suff, basename) - files = [str(basename) + ws + plat + files = [str(basename) + ws + plat + way_ext for plat in ['-' + config.platform, '-' + config.os, ''] - for ws in ['-ws-' + config.wordsize, '']] + for ws in ['-ws-' + config.wordsize, ''] + for way_ext in ['-' + way, '']] for f in files: if in_srcdir(f).exists(): ===================================== testsuite/tests/driver/T20696/T20696.stderr-ext-interp ===================================== @@ -0,0 +1,3 @@ +[1 of 3] Compiling C ( C.hs, C.o ) +[2 of 3] Compiling B ( B.hs, B.o ) +[3 of 3] Compiling A ( A.hs, A.o ) ===================================== testsuite/tests/driver/T20696/all.T ===================================== @@ -1,5 +1,4 @@ test('T20696', [extra_files(['A.hs', 'B.hs', 'C.hs']) - , expect_broken_for(26552, ['ext-interp']) , unless(ghc_dynamic(), skip)], multimod_compile, ['A', '']) test('T20696-static', [extra_files(['A.hs', 'B.hs', 'C.hs']) , when(ghc_dynamic(), skip)], multimod_compile, ['A', '']) ===================================== testsuite/tests/driver/fat-iface/all.T ===================================== @@ -9,12 +9,12 @@ test('fat010', [req_th,extra_files(['THA.hs', 'THB.hs', 'THC.hs']), copy_files], # Check linking works when using -fbyte-code-and-object-code test('fat011', [req_th, extra_files(['FatMain.hs', 'FatTH.hs', 'FatQuote.hs'])], multimod_compile, ['FatMain', '-fbyte-code-and-object-code -fprefer-byte-code']) # Check that we use interpreter rather than enable dynamic-too if needed for TH -test('fat012', [req_th, expect_broken_for(26552, ['ext-interp']), unless(ghc_dynamic(), skip), extra_files(['FatTH.hs', 'FatQuote.hs'])], multimod_compile, ['FatTH', '-fprefer-byte-code']) +test('fat012', [req_th, unless(ghc_dynamic(), skip), extra_files(['FatTH.hs', 'FatQuote.hs'])], multimod_compile, ['FatTH', '-fprefer-byte-code']) # Check that no objects are generated if using -fno-code and -fprefer-byte-code test('fat013', [req_th, req_bco, extra_files(['FatTH.hs', 'FatQuote.hs'])], multimod_compile, ['FatTH', '-fno-code -fprefer-byte-code']) # When using interpreter should not produce objects test('fat014', [req_th, extra_files(['FatTH.hs', 'FatQuote.hs']), extra_run_opts('-fno-code')], ghci_script, ['fat014.script']) -test('fat015', [req_th, expect_broken_for(26552, ['ext-interp']), unless(ghc_dynamic(), skip), extra_files(['FatQuote.hs', 'FatQuote1.hs', 'FatQuote2.hs', 'FatTH1.hs', 'FatTH2.hs', 'FatTHTop.hs'])], multimod_compile, ['FatTHTop', '-fno-code -fwrite-interface']) +test('fat015', [req_th, unless(ghc_dynamic(), skip), extra_files(['FatQuote.hs', 'FatQuote1.hs', 'FatQuote2.hs', 'FatTH1.hs', 'FatTH2.hs', 'FatTHTop.hs'])], multimod_compile, ['FatTHTop', '-fno-code -fwrite-interface']) test('T22807', [req_th, unless(ghc_dynamic(), skip), extra_files(['T22807A.hs', 'T22807B.hs'])] , makefile_test, ['T22807']) test('T22807_ghci', [req_th, unless(ghc_dynamic(), skip), extra_files(['T22807_ghci.hs'])] ===================================== testsuite/tests/driver/fat-iface/fat012.stderr-ext-interp ===================================== @@ -0,0 +1,2 @@ +[1 of 2] Compiling FatQuote ( FatQuote.hs, FatQuote.o ) +[2 of 2] Compiling FatTH ( FatTH.hs, FatTH.o ) ===================================== testsuite/tests/driver/fat-iface/fat015.stderr-ext-interp ===================================== @@ -0,0 +1,6 @@ +[1 of 6] Compiling FatQuote ( FatQuote.hs, FatQuote.o, interpreted ) +[2 of 6] Compiling FatQuote1 ( FatQuote1.hs, interpreted ) +[3 of 6] Compiling FatQuote2 ( FatQuote2.hs, FatQuote2.o ) +[4 of 6] Compiling FatTH1 ( FatTH1.hs, nothing ) +[5 of 6] Compiling FatTH2 ( FatTH2.hs, nothing ) +[6 of 6] Compiling FatTHTop ( FatTHTop.hs, nothing ) ===================================== testsuite/tests/splice-imports/SI07.stderr-ext-interp ===================================== @@ -0,0 +1,3 @@ +[1 of 3] Compiling SI05A ( SI05A.hs, SI05A.o ) +[2 of 3] Compiling SI07A ( SI07A.hs, nothing ) +[3 of 3] Compiling SI07 ( SI07.hs, nothing ) ===================================== testsuite/tests/splice-imports/all.T ===================================== @@ -9,7 +9,7 @@ test('SI03', [extra_files(["SI01A.hs"])], multimod_compile_fail, ['SI03', '-v0'] test('SI04', [extra_files(["SI01A.hs"])], multimod_compile, ['SI04', '-v0']) test('SI05', [extra_files(["SI01A.hs"])], multimod_compile_fail, ['SI05', '-v0']) test('SI06', [extra_files(["SI01A.hs"])], multimod_compile, ['SI06', '-v0']) -test('SI07', [expect_broken_for(26552, ['ext-interp']), unless(ghc_dynamic(), skip), extra_files(["SI05A.hs"])], multimod_compile, ['SI07', '-fwrite-interface -fno-code']) +test('SI07', [unless(ghc_dynamic(), skip), extra_files(["SI05A.hs"])], multimod_compile, ['SI07', '-fwrite-interface -fno-code']) # Instance tests test('SI08', [extra_files(["ClassA.hs", "InstanceA.hs"])], multimod_compile_fail, ['SI08', '-v0']) test('SI09', [extra_files(["ClassA.hs", "InstanceA.hs"])], multimod_compile, ['SI09', '-v0']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3bd7dd44152f74d7a9fdd036f26be10... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3bd7dd44152f74d7a9fdd036f26be10... You're receiving this email because of your account on gitlab.haskell.org.