Commit 513a449c authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

testsuite: Use makefile_test

This eliminates most uses of run_command in the testsuite in favor of the more
structured makefile_test.
parent bdb559a6
......@@ -4,5 +4,4 @@ test('T12010',
only_ways(['threaded1']),
extra_ways(['threaded1']),
cmd_prefix('WAY_FLAGS="' + ' '.join(config.way_flags['threaded1']) + '"')],
run_command,
['$MAKE -s --no-print-directory T12010'])
makefile_test, [])
......@@ -89,14 +89,14 @@ test('hDuplicateTo001', [], compile_and_run, [''])
test('countReaders001', [], compile_and_run, [''])
test('concio001', [normal, multi_cpu_race],
run_command, ['$MAKE -s --no-print-directory test.concio001'])
makefile_test, ['test.concio001'])
test('concio001.thr', [extra_files(['concio001.hs']), multi_cpu_race],
run_command, ['$MAKE -s --no-print-directory test.concio001.thr'])
makefile_test, ['test.concio001.thr'])
test('concio002', reqlib('process'), compile_and_run, [''])
test('T2122', [], compile_and_run, [''])
test('T3307', [], run_command, ['$MAKE -s --no-print-directory T3307-test'])
test('T3307', [], makefile_test, ['T3307-test'])
test('T4855', normal, compile_and_run, [''])
test('hSetEncoding001',extra_run_opts('hSetEncoding001.in'), compile_and_run, [''])
......@@ -118,8 +118,7 @@ test('encoding003', normal, compile_and_run, [''])
test('encoding004', extra_files(['encoded-data/']), compile_and_run, [''])
test('encoding005', normal, compile_and_run, [''])
test('environment001', [], run_command,
['$MAKE -s --no-print-directory environment001-test'])
test('environment001', [], makefile_test, ['environment001-test'])
test('newline001', [], compile_and_run, [''])
......
......@@ -896,7 +896,7 @@ def do_test(name, way, func, args, files):
framework_fail(name, way,
'extra_file does not exist: ' + extra_file)
if func.__name__ == 'run_command' or opts.pre_cmd:
if func.__name__ == 'run_command' or func.__name__ == 'makefile_test' or opts.pre_cmd:
# When running 'MAKE' make sure 'TOP' still points to the
# root of the testsuite.
src_makefile = in_srcdir('Makefile')
......
......@@ -6,9 +6,9 @@
test('annth_make',
[extra_files(['AnnHelper.hs', 'TestModule.hs', 'TestModuleTH.hs', 'annth.hs']),
req_interp, omit_ways(prof_ways), unless(have_dynamic(), skip)],
run_command, ['$MAKE -s --no-print-directory annth_make'])
makefile_test, ['annth_make'])
test('annth_compunits',
[extra_files(['AnnHelper.hs', 'TestModule.hs', 'TestModuleTH.hs', 'annth.hs']),
req_interp, omit_ways(prof_ways), unless(have_dynamic(), skip)],
run_command, ['$MAKE -s --no-print-directory annth_compunits'])
makefile_test, ['annth_compunits'])
test('T12485', [extra_files(['a.pkg', 'b.pkg', 'Main.hs'])], run_command, ['$MAKE -s --no-print-directory T12485'])
test('T12485', [extra_files(['a.pkg', 'b.pkg', 'Main.hs'])], makefile_test, [])
......@@ -4,16 +4,14 @@ def normaliseDynlibNames(str):
def ignore_warnings(str):
return re.sub(r'Warning:.*\n', '', str)
test('ghcpkg01', [extra_files(['test.pkg', 'test2.pkg', 'test3.pkg'])], run_command, ['$MAKE -s --no-print-directory ghcpkg01'])
test('ghcpkg01', [extra_files(['test.pkg', 'test2.pkg', 'test3.pkg'])], makefile_test, [])
# Use ignore_stderr to prevent (when HADDOCK_DOCS=NO):
# warning: haddock-interfaces .. doesn't exist or isn't a file
test('ghcpkg02', [ignore_stderr], run_command,
['$MAKE -s --no-print-directory ghcpkg02'])
test('ghcpkg02', [ignore_stderr], makefile_test, [])
test('ghcpkg03', [extra_files(['test.pkg', 'test2.pkg', 'test4.pkg']),
normalise_errmsg_fun(normaliseDynlibNames)], run_command,
['$MAKE -s --no-print-directory ghcpkg03'])
normalise_errmsg_fun(normaliseDynlibNames)], makefile_test, [])
def normalise_package_order(s):
# Package order is not deterministic?
......@@ -22,8 +20,7 @@ def normalise_package_order(s):
s)
test('ghcpkg04', [extra_files(['test.pkg', 'test5.pkg']),
normalise_errmsg_fun(normalise_package_order)], run_command,
['$MAKE -s --no-print-directory ghcpkg04'])
normalise_errmsg_fun(normalise_package_order)], makefile_test, [])
# Sometimes we get spurious warnings from ghc-pkg about missing
# haddock-interfaces; this filters them out.
......@@ -33,27 +30,27 @@ def normalise_haddock_junk( str ):
test('ghcpkg05',
[extra_files(['test2.pkg', 'test3.pkg']),
normalise_errmsg_fun(normalise_haddock_junk, normaliseDynlibNames, ignore_warnings)],
run_command, ['$MAKE -s --no-print-directory ghcpkg05'])
test('ghcpkg06', [extra_files(['test.pkg', 'testdup.pkg'])], run_command, ['$MAKE -s --no-print-directory ghcpkg06'])
makefile_test, [])
test('ghcpkg06', [extra_files(['test.pkg', 'testdup.pkg'])], makefile_test, [])
test('ghcpkg07', [extra_files(['test.pkg', 'test7a.pkg', 'test7b.pkg'])], run_command, ['$MAKE -s --no-print-directory ghcpkg07'])
test('ghcpkg07', [extra_files(['test.pkg', 'test7a.pkg', 'test7b.pkg'])], makefile_test, [])
# Test that we *can* compile a module that also belongs to a package
# (this was disallowed in GHC 6.4 and earlier)
test('pkg01', normal, compile, [''])
test('T1750', [], run_command, ['$MAKE -s --no-print-directory T1750'])
test('T1750', [], makefile_test, [])
test('T5442a', [extra_files(['test.pkg'])], run_command, ['$MAKE -s --no-print-directory T5442a'])
test('T5442a', [extra_files(['test.pkg'])], makefile_test, [])
test('T5442b', [extra_files(['test.pkg'])], run_command, ['$MAKE -s --no-print-directory T5442b'])
test('T5442b', [extra_files(['test.pkg'])], makefile_test, [])
test('T5442c', [extra_files(['test.pkg'])], run_command, ['$MAKE -s --no-print-directory T5442c'])
test('T5442c', [extra_files(['test.pkg'])], makefile_test, [])
test('T5442d', [extra_files(['shadow1.pkg', 'shadow2.pkg', 'shadow4.pkg'])], run_command, ['$MAKE -s --no-print-directory T5442d'])
test('T5442d', [extra_files(['shadow1.pkg', 'shadow2.pkg', 'shadow4.pkg'])], makefile_test, [])
test('shadow', [], run_command, ['$MAKE -s --no-print-directory shadow'])
test('shadow', [], makefile_test, [])
test('T12485a', [extra_files(['shadow1.pkg', 'shadow2.pkg', 'shadow3.pkg'])], run_command, ['$MAKE -s --no-print-directory T12485a'])
test('T12485a', [extra_files(['shadow1.pkg', 'shadow2.pkg', 'shadow3.pkg'])], makefile_test, [])
test('T13703', [extra_files(['test13703a.pkg', 'test13703b.pkg'])], run_command, ['$MAKE -s --no-print-directory T13703'])
test('T13703', [extra_files(['test13703a.pkg', 'test13703b.pkg'])], makefile_test, [])
# Verify that we optimize away conditional branches which always jump
# to the same target.
test('T15188', normal, run_command, ['$MAKE -s --no-print-directory T15188'])
test('T15188', normal, makefile_test, [])
......@@ -12,7 +12,7 @@ test('T2388', normal, compile, [''])
test('T3132', normal, compile, ['-dcmm-lint'])
test('T3286', [], multimod_compile, ['T3286', '-v0'])
test('T3579', normal, compile, [''])
test('T2578', normal, run_command, ['$MAKE -s --no-print-directory T2578'])
test('T2578', normal, makefile_test, [])
# skip llvm on i386 as we don't support fPIC
test('jmp_tbl', when(arch('i386'), omit_ways(llvm_ways)), compile, ['-fPIC -O'])
test('massive_array',
......@@ -27,7 +27,7 @@ test('T9329', [when(unregisterised(), expect_broken(15467)), cmm_src], compile,
test('debug',
[when((arch('powerpc64') or arch('powerpc64le')), expect_broken(11261))],
run_command, ['$MAKE -s --no-print-directory debug'])
makefile_test, [])
test('T9964', normal, compile, ['-O'])
test('T10518', [cmm_src], compile, [''])
test('T10667', [ when((arch('powerpc64') or arch('powerpc64le')),
......@@ -40,15 +40,15 @@ test('T14999',
when(unregisterised(), skip),
unless(opsys('linux') and arch('x86_64') and have_gdb() and
have_readelf(), skip)],
run_command, ['$MAKE -s --no-print-directory T14999'])
makefile_test, [])
# Verify that we optimize away redundant jumps for unordered comparisons.
test('T15196',
[ unless(arch('x86_64'),skip),
only_ways('normal'),
], run_command, ['$MAKE -s --no-print-directory T15196'])
], makefile_test, [])
test('T15723',
[ unless(have_profiling(), skip),
unless(have_dynamic(), skip),
], run_command, ['$MAKE -s --no-print-directory T15723'])
], makefile_test, [])
test('T15038',
[reqlib('containers'), reqlib('ghc-prim'), reqlib('primitive')],
run_command,
['$MAKE -s --no-print-directory T15038'])
makefile_test, [])
......@@ -77,13 +77,12 @@ test('T4439', normal, compile, [''])
test('T4488', normal, compile, [''])
test('T4870', [only_ways(['optasm'])], multimod_compile, ['T4870', '-v0'])
test('T5117', normal, compile, [''])
test('T5252', [], run_command, ['$MAKE -s --no-print-directory T5252'])
test('T5252', [], makefile_test, [])
test('T5455', normal, compile, [''])
test('T5001', [only_ways(['optasm'])], multimod_compile, ['T5001', '-v0'])
# T5252Take2 failed when compiled *wihtout* optimisation
test('T5252Take2', [], run_command,
['$MAKE -s --no-print-directory T5252Take2'])
test('T5252Take2', [], makefile_test, [])
test('T2431', normal, compile, ['-ddump-simpl -dsuppress-uniques'])
test('T7669', normal, compile, [''])
test('T8470', normal, compile, [''])
......@@ -106,4 +105,4 @@ test('T14546c', normal, compile, ['-Wincomplete-patterns'])
test('T14547', normal, compile, ['-Wincomplete-patterns'])
test('T14773a', normal, compile, ['-Wincomplete-patterns'])
test('T14773b', normal, compile, ['-Wincomplete-patterns'])
test('T14815', [], run_command, ['$MAKE -s --no-print-directory T14815'])
test('T14815', [], makefile_test, ['T14815'])
......@@ -41,8 +41,7 @@ test('T12742', normal, compile, [''])
# (2) Build the program twice: once with -dynamic, and then
# with -prof using -osuf to set a different object file suffix.
test('T13910', omit_ways(['profasm']), compile, [''])
test('T13938', [extra_files(['T13938a.hs'])], run_command,
['$MAKE -s --no-print-directory T13938'])
test('T13938', [extra_files(['T13938a.hs'])], makefile_test, ['T13938'])
test('T14556', normal, compile, [''])
test('T14720', normal, compile, [''])
test('T14066a', normal, compile, [''])
......
......@@ -40,7 +40,7 @@ test('deriving-via-compile', normal, compile, [''])
test('deriving-via-standalone', normal, compile, [''])
test('T6031', [], multimod_compile, ['T6031', '-v0 -O'])
# Adding -O on T6031 to expose Trac #11245 regardless of way
test('T1133', [], run_command, ['$MAKE --no-print-directory -s T1133'])
test('T1133', [], makefile_test, [])
test('T7704', normal, compile, [''])
test('T7710', normal, compile, [''])
......@@ -65,8 +65,7 @@ test('T7947', [], multimod_compile, ['T7947', '-v0'])
test('T10561', normal, compile, [''])
test('T10487', [], multimod_compile, ['T10487', '-v0'])
test('T10524', normal, compile, [''])
test('T11148', normal, run_command,
['$MAKE -s --no-print-directory T11148'])
test('T11148', normal, makefile_test, [])
test('T9968', normal, compile, [''])
test('T9968a', normal, compile, [''])
test('T11174', normal, compile, [''])
......
......@@ -12,8 +12,7 @@ test('drvfail011', normal, compile_fail, [''])
test('drvfail012', normal, compile_fail, [''])
test('drvfail013', normal, compile_fail, [''])
test('drvfail015', normal, compile_fail, [''])
test('drvfail016', [], run_command,
['$MAKE --no-print-directory -s drvfail016'])
test('drvfail016', [], makefile_test, [])
test('T1830_1', normal, compile_fail, [''])
test('T2394', normal, compile_fail, [''])
# T2604 was removed as it was out of date re: fixing #9858
......@@ -33,7 +32,7 @@ test('T5287', normal, compile_fail, [''])
test('T5478', normal, compile_fail, [''])
test('T5686', normal, compile_fail, [''])
test('T5922', normal, compile_fail, [''])
test('T1133A', [], run_command, ['$MAKE --no-print-directory -s T1133A'])
test('T1133A', [], makefile_test, [])
# 5863a was removed as it was out of date re: fixing #9858
test('T7959', normal, compile_fail, [''])
......
test('T13807', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory T13807'])
test('T13807', [extra_files(['A.hs'])], makefile_test, ['T13807'])
test('determ002', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ002'])
test('determ002', [extra_files(['A.hs'])], makefile_test, ['determ002'])
test('determ003', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ003'])
test('determ003', [extra_files(['A.hs'])], makefile_test, ['determ003'])
test('determ005', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ005'])
test('determ005', [extra_files(['A.hs'])], makefile_test, ['determ005'])
test('determ006', [extra_files(['spec-inline-determ.hs'])], run_command, ['$MAKE -s --no-print-directory determ006'])
test('determ006', [extra_files(['spec-inline-determ.hs'])], makefile_test, ['determ006'])
test('determ007', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ007'])
test('determ007', [extra_files(['A.hs'])], makefile_test, ['determ007'])
test('determ008', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ008'])
test('determ008', [extra_files(['A.hs'])], makefile_test, ['determ008'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment