summaryrefslogtreecommitdiff
path: root/testsuite/driver
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2018-09-05 13:45:50 +0200
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-09-05 13:45:51 +0200
commitecde9546e7768a57bb57d742c8ef3b7cf7fde80e (patch)
tree5a94cef0ae165626a02676c85239ffe1bea805fe /testsuite/driver
parenta811d938acb09b23b11173842143a0fa946bf5cc (diff)
downloadhaskell-ecde9546e7768a57bb57d742c8ef3b7cf7fde80e.tar.gz
testsuite: Use bools for booleans, not ints
Summary: Just as it says on the tin. Test Plan: Validate Reviewers: bgamari, osa1 Reviewed By: osa1 Subscribers: osa1, monoidal, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D5010
Diffstat (limited to 'testsuite/driver')
-rw-r--r--testsuite/driver/testglobals.py22
-rw-r--r--testsuite/driver/testlib.py30
2 files changed, 26 insertions, 26 deletions
diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py
index 067b7d4afc..311e39be7f 100644
--- a/testsuite/driver/testglobals.py
+++ b/testsuite/driver/testglobals.py
@@ -27,9 +27,9 @@ class TestConfig:
self.only = set()
# Accept new output which differs from the sample?
- self.accept = 0
- self.accept_platform = 0
- self.accept_os = 0
+ self.accept = False
+ self.accept_platform = False
+ self.accept_os = False
# File in which to save the summary
self.summary_file = ''
@@ -117,7 +117,7 @@ class TestConfig:
# threads
self.threads = 1
- self.use_threads = 0
+ self.use_threads = False
# Should we skip performance tests
self.skip_perf_tests = False
@@ -168,7 +168,7 @@ def getTestRun():
class TestOptions:
def __init__(self):
# skip this test?
- self.skip = 0
+ self.skip = False
# skip these ways
self.omit_ways = []
@@ -193,7 +193,7 @@ class TestOptions:
self.ignore_stderr = False
# Backpack test
- self.compile_backpack = 0
+ self.compile_backpack = False
# We sometimes want to modify the compiler_always_flags, so
# they are copied from config.compiler_always_flags when we
@@ -230,15 +230,15 @@ class TestOptions:
self.alone = False
# Does this test use a literate (.lhs) file?
- self.literate = 0
+ self.literate = False
# Does this test use a .c, .m or .mm file?
- self.c_src = 0
- self.objc_src = 0
- self.objcpp_src = 0
+ self.c_src = False
+ self.objc_src = False
+ self.objcpp_src = False
# Does this test use a .cmm file?
- self.cmm_src = 0
+ self.cmm_src = False
# Should we put .hi/.o files in a subdirectory?
self.outputdir = None
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 6402efe72a..ff6a8c8e74 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -84,7 +84,7 @@ def normal( name, opts ):
return;
def skip( name, opts ):
- opts.skip = 1
+ opts.skip = True
def expect_fail( name, opts ):
# The compiler, testdriver, OS or platform is missing a certain
@@ -423,19 +423,19 @@ def multi_cpu_race(name, opts):
# ---
def literate( name, opts ):
- opts.literate = 1;
+ opts.literate = True
def c_src( name, opts ):
- opts.c_src = 1;
+ opts.c_src = True
def objc_src( name, opts ):
- opts.objc_src = 1;
+ opts.objc_src = True
def objcpp_src( name, opts ):
- opts.objcpp_src = 1;
+ opts.objcpp_src = True
def cmm_src( name, opts ):
- opts.cmm_src = 1;
+ opts.cmm_src = True
def outputdir( odir ):
return lambda name, opts, d=odir: _outputdir(name, opts, d)
@@ -973,19 +973,19 @@ def compile_fail( name, way, extra_hc_opts ):
return do_compile( name, way, 1, '', [], extra_hc_opts )
def backpack_typecheck( name, way, extra_hc_opts ):
- return do_compile( name, way, 0, '', [], "-fno-code -fwrite-interface " + extra_hc_opts, backpack=1 )
+ return do_compile( name, way, 0, '', [], "-fno-code -fwrite-interface " + extra_hc_opts, backpack=True )
def backpack_typecheck_fail( name, way, extra_hc_opts ):
- return do_compile( name, way, 1, '', [], "-fno-code -fwrite-interface " + extra_hc_opts, backpack=1 )
+ return do_compile( name, way, 1, '', [], "-fno-code -fwrite-interface " + extra_hc_opts, backpack=True )
def backpack_compile( name, way, extra_hc_opts ):
- return do_compile( name, way, 0, '', [], extra_hc_opts, backpack=1 )
+ return do_compile( name, way, 0, '', [], extra_hc_opts, backpack=True )
def backpack_compile_fail( name, way, extra_hc_opts ):
- return do_compile( name, way, 1, '', [], extra_hc_opts, backpack=1 )
+ return do_compile( name, way, 1, '', [], extra_hc_opts, backpack=True )
def backpack_run( name, way, extra_hc_opts ):
- return compile_and_run__( name, way, '', [], extra_hc_opts, backpack=1 )
+ return compile_and_run__( name, way, '', [], extra_hc_opts, backpack=True )
def multimod_compile( name, way, top_mod, extra_hc_opts ):
return do_compile( name, way, 0, top_mod, [], extra_hc_opts )
@@ -1577,14 +1577,14 @@ def compare_outputs(way, kind, normaliser, expected_file, actual_file,
# See Note [Output comparison].
r = runCmd('diff -uw "{0}" "{1}"'.format(expected_normalised_path,
actual_normalised_path),
- print_output = 1)
+ print_output=True)
# If for some reason there were no non-whitespace differences,
# then do a full diff
if r == 0:
r = runCmd('diff -u "{0}" "{1}"'.format(expected_normalised_path,
actual_normalised_path),
- print_output = 1)
+ print_output=True)
if config.accept and (getTestOpts().expect == 'fail' or
way in getTestOpts().expect_fail_for):
@@ -1800,7 +1800,7 @@ def dump_file(f):
except Exception:
print('')
-def runCmd(cmd, stdin=None, stdout=None, stderr=None, timeout_multiplier=1.0, print_output=0):
+def runCmd(cmd, stdin=None, stdout=None, stderr=None, timeout_multiplier=1.0, print_output=False):
timeout_prog = strip_quotes(config.timeout_prog)
timeout = str(int(ceil(config.timeout * timeout_multiplier)))
@@ -1832,7 +1832,7 @@ def runCmd(cmd, stdin=None, stdout=None, stderr=None, timeout_multiplier=1.0, pr
finally:
if stdin_file:
stdin_file.close()
- if config.verbose >= 1 and print_output >= 1:
+ if config.verbose >= 1 and print_output:
if stdout_buffer:
sys.stdout.buffer.write(stdout_buffer)
if stderr_buffer: