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/driver/testutil.py | |
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/driver/testutil.py')
-rw-r--r-- | testsuite/driver/testutil.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/testsuite/driver/testutil.py b/testsuite/driver/testutil.py index 0738683111..ec45e93987 100644 --- a/testsuite/driver/testutil.py +++ b/testsuite/driver/testutil.py @@ -1,39 +1,5 @@ # ----------------------------------------------------------------------------- # Utils - -def id(a): - return a - -def eq(x): - return lambda y,z=x: y == z - -def neq(x): - return lambda y,z=x: y != z - -def append(x,y): - return x + y - -def concat(xs): - return reduce(append,xs,[]) - -def chop(s): - if s[len(s)-1:] == '\n': - return s[:len(s)-1] - else: - return s - -def all(p,xs): - for x in xs: - if not p(x): - return False - return True - -def elem(xs): - return lambda x: x in xs - -def notElem(xs): - return lambda x: x not in xs - def version_to_ints(v): return [ int(x) for x in v.split('.') ] |