diff options
author | Krzysztof Gogolewski <krz.gogolewski@gmail.com> | 2014-10-01 23:41:27 +0200 |
---|---|---|
committer | Krzysztof Gogolewski <krz.gogolewski@gmail.com> | 2014-10-01 23:41:27 +0200 |
commit | 084d241b316bfa12e41fc34cae993ca276bf0730 (patch) | |
tree | 2c51250374dd6419d2c2db2c16e3dff06c7206e9 /testsuite/tests | |
parent | 2a8856884de7d476e26b4ffa829ccb3a14d6f63e (diff) | |
download | haskell-084d241b316bfa12e41fc34cae993ca276bf0730.tar.gz |
Basic Python 3 support for testsuite driver (Trac #9184)
Summary:
Most of the changes is adaptation of old Python 2 only code.
My priority was not breaking Python 2, and so I avoided bigger
changes to the driver. In particular, under Python 3 the output
is a str and buffering cannot be disabled.
To test, define PYTHON=python3 in testsuite/mk/boilerplate.mk.
Thanks to aspidites <emarshall85@gmail.com> who provided the initial patch.
Test Plan: validate under 2 and 3
Reviewers: hvr, simonmar, thomie, austin
Reviewed By: thomie, austin
Subscribers: aspidites, thomie, simonmar, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D233
GHC Trac Issues: #9184
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/ffi/should_run/all.T | 10 | ||||
-rw-r--r-- | testsuite/tests/ghci/prog004/prog004.T | 4 | ||||
-rw-r--r-- | testsuite/tests/numeric/should_run/all.T | 8 | ||||
-rw-r--r-- | testsuite/tests/perf/compiler/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/plugins/all.T | 4 | ||||
-rw-r--r-- | testsuite/tests/th/TH_spliceViewPat/test.T | 6 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 6 | ||||
-rwxr-xr-x | testsuite/tests/typecheck/should_run/all.T | 4 |
8 files changed, 22 insertions, 22 deletions
diff --git a/testsuite/tests/ffi/should_run/all.T b/testsuite/tests/ffi/should_run/all.T index 7efc6eb3d8..6fe087884d 100644 --- a/testsuite/tests/ffi/should_run/all.T +++ b/testsuite/tests/ffi/should_run/all.T @@ -50,10 +50,10 @@ test('ffi008', [exit_code(1), omit_ways(['ghci'])], compile_and_run, ['']) maybe_skip = normal opts = '' if config.platform.startswith('i386-'): - if config.compiler_type == 'ghc' and \ + if config.compiler_type == 'ghc' and \ version_ge(config.compiler_version, '6.13'): - opts = '-msse2' - else: + opts = '-msse2' + else: maybe_skip = only_ways(['ghci']) test('ffi009', [when(fast(), skip), @@ -69,9 +69,9 @@ test('ffi011', normal, compile_and_run, ['']) # it. if config.os == 'mingw32': - skip_if_not_windows = normal + skip_if_not_windows = normal else: - skip_if_not_windows = skip + skip_if_not_windows = skip test('ffi012', skip_if_not_windows, compile_and_run, ['']) test('ffi013', normal, compile_and_run, ['']) diff --git a/testsuite/tests/ghci/prog004/prog004.T b/testsuite/tests/ghci/prog004/prog004.T index ed17afd088..4b6ee13028 100644 --- a/testsuite/tests/ghci/prog004/prog004.T +++ b/testsuite/tests/ghci/prog004/prog004.T @@ -1,8 +1,8 @@ setTestOpts(only_compiler_types(['ghc'])) def f(name, opts): - if not ('ghci' in config.run_ways): - opts.skip = 1 + if not ('ghci' in config.run_ways): + opts.skip = 1 setTestOpts(f) test('ghciprog004', diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T index 72c8e6a74a..76181a2115 100644 --- a/testsuite/tests/numeric/should_run/all.T +++ b/testsuite/tests/numeric/should_run/all.T @@ -15,11 +15,11 @@ test('arith007', normal, compile_and_run, ['']) ways = normal opts = '' if config.platform.startswith('i386-'): - if config.compiler_type == 'ghc' and \ + if config.compiler_type == 'ghc' and \ version_ge(config.compiler_version, '6.13'): - opts = '-msse2' - else: - ways = expect_fail_for(['optasm','threaded2','hpc','dyn','profasm']) + opts = '-msse2' + else: + ways = expect_fail_for(['optasm','threaded2','hpc','dyn','profasm']) test('arith008', ways, compile_and_run, [opts]) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index a7783a4977..9868faefac 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -1,6 +1,6 @@ def no_lint(name, opts): opts.compiler_always_flags = \ - filter(lambda opt: opt != '-dcore-lint' and opt != '-dcmm-lint', opts.compiler_always_flags) + [opt for opt in opts.compiler_always_flags if opt != '-dcore-lint' and opt != '-dcmm-lint'] setTestOpts(no_lint) diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T index 7e5f9b407d..8b2256ac70 100644 --- a/testsuite/tests/plugins/all.T +++ b/testsuite/tests/plugins/all.T @@ -1,6 +1,6 @@ def f(name, opts): - if (ghc_with_interpreter == 0): - opts.skip = 1 + if (ghc_with_interpreter == 0): + opts.skip = 1 setTestOpts(f) setTestOpts(when(compiler_lt('ghc', '7.1'), skip)) diff --git a/testsuite/tests/th/TH_spliceViewPat/test.T b/testsuite/tests/th/TH_spliceViewPat/test.T index c08e7cb6f5..21fdff3518 100644 --- a/testsuite/tests/th/TH_spliceViewPat/test.T +++ b/testsuite/tests/th/TH_spliceViewPat/test.T @@ -1,7 +1,7 @@ def f(name, opts): - opts.extra_hc_opts = '-XTemplateHaskell -package template-haskell' - if (ghc_with_interpreter == 0): - opts.skip = 1 + opts.extra_hc_opts = '-XTemplateHaskell -package template-haskell' + if (ghc_with_interpreter == 0): + opts.skip = 1 setTestOpts(f) setTestOpts(only_compiler_types(['ghc'])) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 6e86d303e5..00f5fc9670 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -4,9 +4,9 @@ test('T4255', unless(compiler_profiled(), skip), compile_fail, ['-v0']) def f(name, opts): - opts.extra_hc_opts = '-XTemplateHaskell -package template-haskell' - if (ghc_with_interpreter == 0): - opts.skip = 1 + opts.extra_hc_opts = '-XTemplateHaskell -package template-haskell' + if (ghc_with_interpreter == 0): + opts.skip = 1 setTestOpts(f) setTestOpts(only_compiler_types(['ghc'])) diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T index 760d5e1452..5da7c8b169 100755 --- a/testsuite/tests/typecheck/should_run/all.T +++ b/testsuite/tests/typecheck/should_run/all.T @@ -19,8 +19,8 @@ test('TcCoercible', when(compiler_lt('ghc', '7.7'), skip), compile_and_run, [''] # Skip everything else if fast is on def f(name, opts): - if config.fast: - opts.skip = 1 + if config.fast: + opts.skip = 1 setTestOpts(f) test('tcrun006', normal, compile_and_run, ['']) |