Commit 135fc86c authored by thomie's avatar thomie

Testsuite: remove `-Wno-warn-tabs` from default flags

This allows the removal of the override_flags stuff in testlib.py.
parent 82f7f182
......@@ -1006,8 +1006,8 @@ def run_command( name, way, cmd ):
# -----------------------------------------------------------------------------
# GHCi tests
def ghci_script( name, way, script, override_flags = None ):
flags = ' '.join(get_compiler_flags(override_flags))
def ghci_script( name, way, script):
flags = ' '.join(get_compiler_flags())
way_flags = ' '.join(config.way_flags(name)[way])
......@@ -1022,32 +1022,6 @@ def ghci_script( name, way, script, override_flags = None ):
# -----------------------------------------------------------------------------
# Compile-only tests
def compile_override_default_flags(overrides):
def apply(name, way, extra_opts):
return do_compile(name, way, 0, '', [], extra_opts, overrides)
return apply
def compile_fail_override_default_flags(overrides):
def apply(name, way, extra_opts):
return do_compile(name, way, 1, '', [], extra_opts, overrides)
return apply
def compile_without_flag(flag):
def apply(name, way, extra_opts):
overrides = [f for f in getTestOpts().compiler_always_flags if f != flag]
return compile_override_default_flags(overrides)(name, way, extra_opts)
return apply
def compile_fail_without_flag(flag):
def apply(name, way, extra_opts):
overrides = [f for f in getTestOpts.compiler_always_flags if f != flag]
return compile_fail_override_default_flags(overrides)(name, way, extra_opts)
return apply
def compile( name, way, extra_hc_opts ):
return do_compile( name, way, 0, '', [], extra_hc_opts )
......@@ -1066,7 +1040,7 @@ def multi_compile( name, way, top_mod, extra_mods, extra_hc_opts ):
def multi_compile_fail( name, way, top_mod, extra_mods, extra_hc_opts ):
return do_compile( name, way, 1, top_mod, extra_mods, extra_hc_opts)
def do_compile( name, way, should_fail, top_mod, extra_mods, extra_hc_opts, override_flags = None ):
def do_compile(name, way, should_fail, top_mod, extra_mods, extra_hc_opts):
# print 'Compile only, extra args = ', extra_hc_opts
result = extras_build( way, extra_mods, extra_hc_opts )
......@@ -1074,7 +1048,7 @@ def do_compile( name, way, should_fail, top_mod, extra_mods, extra_hc_opts, over
return result
extra_hc_opts = result['hc_opts']
result = simple_build(name, way, extra_hc_opts, should_fail, top_mod, 0, 1, override_flags)
result = simple_build(name, way, extra_hc_opts, should_fail, top_mod, 0, 1)
if badResult(result):
return result
......@@ -1222,7 +1196,7 @@ def extras_build( way, extra_mods, extra_hc_opts ):
return {'passFail' : 'pass', 'hc_opts' : extra_hc_opts}
def simple_build(name, way, extra_hc_opts, should_fail, top_mod, link, addsuf, override_flags=None):
def simple_build(name, way, extra_hc_opts, should_fail, top_mod, link, addsuf):
opts = getTestOpts()
errname = add_suffix(name, 'comp.stderr')
......@@ -1262,8 +1236,7 @@ def simple_build(name, way, extra_hc_opts, should_fail, top_mod, link, addsuf, o
else:
cmd_prefix = getTestOpts().compile_cmd_prefix + ' '
flags = ' '.join(get_compiler_flags(override_flags) +
config.way_flags(name)[way])
flags = ' '.join(get_compiler_flags() + config.way_flags(name)[way])
cmd = ('cd "{opts.testdir}" && {cmd_prefix} '
'{{compiler}} {to_do} {srcname} {flags} {extra_hc_opts} '
......@@ -1437,8 +1410,7 @@ def interpreter_run( name, way, extra_hc_opts, compile_only, top_mod ):
if os.path.exists(stdin_file):
os.system('cat "{0}" >> "{1}"'.format(stdin_file, qscriptname))
flags = ' '.join(get_compiler_flags() +
config.way_flags(name)[way])
flags = ' '.join(get_compiler_flags() + config.way_flags(name)[way])
if getTestOpts().combined_output:
redirection = ' > {0} 2>&1'.format(outname)
......@@ -1505,13 +1477,10 @@ def split_file(in_fn, delimiter, out1_fn, out2_fn):
# -----------------------------------------------------------------------------
# Utils
def get_compiler_flags(override_flags=None):
def get_compiler_flags():
opts = getTestOpts()
if override_flags is not None:
flags = copy.copy(override_flags)
else:
flags = copy.copy(opts.compiler_always_flags)
flags = copy.copy(opts.compiler_always_flags)
flags.append(opts.extra_hc_opts)
......
......@@ -38,14 +38,6 @@ TEST_HC_OPTS = -dcore-lint -dcmm-lint -dno-debug-output -no-user-$(GhcPackageDbF
TEST_HC_OPTS_INTERACTIVE = $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci
# The warning suppression flag below is a temporary kludge. While working with
# tests that contain tabs, please de-tab them so this flag can be eventually
# removed. See
# http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
# for details
#
TEST_HC_OPTS += -fno-warn-tabs
ifeq "$(MinGhcVersion711)" "YES"
# Don't warn about missing specialisations. They can only occur with `-O`, but
# we want tests to produce the same output for all test ways.
......
......@@ -59,9 +59,9 @@ test('ds052', normal, compile, [''])
test('ds053', normal, compile, [''])
test('ds054', normal, compile, [''])
test('ds055', normal, compile, [''])
test('ds056', normal, compile, ['-Wall -fno-warn-tabs'])
test('ds056', normal, compile, ['-Wall'])
test('ds057', normal, compile, [''])
test('ds058', normal, compile, ['-W -fno-warn-tabs'])
test('ds058', normal, compile, ['-W'])
test('ds059', normal, compile, ['-W'])
test('ds062', normal, compile, [''])
test('ds063', normal, compile, [''])
......
:set -fno-warn-overlapping-patterns
:set -fno-warn-overlapping-patterns -Wno-tabs
:l HappyTest.hs
:break lexer
main
......
......@@ -92,8 +92,7 @@ test('ghci056',
],
ghci_script, ['ghci056.script'])
test('ghci057', extra_hc_opts('-fwarn-tabs'), ghci_script, ['ghci057.script'])
test('ghci057', normal, ghci_script, ['ghci057.script'])
test('ghci060', normal, ghci_script, ['ghci060.script'])
test('ghci061', normal, ghci_script, ['ghci061.script'])
......@@ -203,7 +202,7 @@ test('T9181', normal, ghci_script, ['T9181.script'])
test('T9086b', normal, ghci_script, ['T9086b.script'])
test('T9140', combined_output, ghci_script, ['T9140.script'])
test('T9658', normal, ghci_script, ['T9658.script'])
test('T9293', extra_hc_opts('-fwarn-tabs'), ghci_script, ['T9293.script'])
test('T9293', normal, ghci_script, ['T9293.script'])
test('T9762',
[ unless(have_dynamic(),skip)
, pre_cmd('$MAKE -s --no-print-directory T9762_prep')
......
......@@ -9,7 +9,6 @@ other dynamic, non-language, flag settings:
-fimplicit-import-qualified
-fshow-warning-groups
warning settings:
-Wno-tabs
~~~~~~~~~~ Testing :set -a
options currently set: none.
base language is: Haskell2010
......
......@@ -309,7 +309,7 @@ test('mod170', extra_clean(['Mod170_A.hi', 'Mod170_A.o']),
test('mod171', extra_clean(['Mod171_A.hi', 'Mod171_A.o', 'Mod171_B.hi', 'Mod171_B.o']),
multimod_compile, ['mod171', '-v0 -Wall -fno-warn-tabs'])
multimod_compile, ['mod171', '-v0 -Wall'])
test('mod172', extra_clean(['Mod172_B.hi', 'Mod172_B.o', 'Mod172_C.hi', 'Mod172_C.o']),
......
{-# OPTIONS_GHC -Wno-tabs #-}
-- !!! 500 defns chained together with "where"s
module Main(main) where
......
......@@ -3,7 +3,10 @@ test('T2526', normal, compile, ['-fwarn-missing-signatures -fwarn-missing-export
test('T9178', extra_clean(['T9178.o', 'T9178DataType.o',
'T9178.hi', 'T9178DataType.hi']),
multimod_compile, ['T9178', '-Wall'])
test('T9230', normal, compile_without_flag('-fno-warn-tabs'), [''])
# T9230.hs contains a tab charater. Test that -Wtabs is enabled by default.
test('T9230', normal, compile, [''])
test('T10908', normal, compile, [''])
test('T11077', normal, compile, ['-fwarn-missing-exported-signatures'])
test('T11128', normal, compile, [''])
......
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