Changeset 5b993e0
- Timestamp:
- Mar 25, 2019, 12:05:29 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d3c1c6a
- Parents:
- d4a60ac
- Location:
- tests
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/Makefile.am
rd4a60ac r5b993e0 28 28 timeouts= 29 29 30 TEST_PY = python ${builddir}/test.py30 TEST_PY = python3 ${builddir}/test.py 31 31 32 32 # applies to both programs -
tests/Makefile.in
rd4a60ac r5b993e0 360 360 concurrent = 361 361 timeouts = 362 TEST_PY = python ${builddir}/test.py362 TEST_PY = python3 ${builddir}/test.py 363 363 364 364 # applies to both programs -
tests/config.py.in
rd4a60ac r5b993e0 1 #!/usr/bin/env python 1 #!/usr/bin/env python3 2 2 # encoding: utf-8 3 3 """ -
tests/pybin/settings.py
rd4a60ac r5b993e0 1 from __future__ import print_function2 3 1 import os 4 2 import sys 5 import tools3 from . import tools 6 4 7 5 try : -
tests/pybin/tools.py
rd4a60ac r5b993e0 1 from __future__ import print_function2 3 1 import __main__ 4 2 import argparse … … 12 10 import sys 13 11 import time 12 import types 14 13 15 14 from pybin import settings … … 58 57 # Remove 1 or more files silently 59 58 def rm( files ): 60 if isinstance( files, basestring ): 61 sh("rm -f %s > /dev/null 2>&1" % files ) 62 else: 63 for file in files: 64 sh("rm -f %s > /dev/null 2>&1" % file ) 59 if isinstance(files, str ): files = [ files ] 60 for file in files: 61 sh("rm -f %s > /dev/null 2>&1" % file ) 65 62 66 63 # Create 1 or more directory 67 64 def mkdir( files ): 68 if isinstance( files, basestring ):69 sh("mkdir -p %s" % os.path.dirname(files) )70 else:71 for file in files:72 sh("mkdir -p %s" % os.path.dirname(file) )65 if isinstance(files, str ): files = [ files ] 66 for file in files: 67 p = os.path.normpath( file ) 68 d = os.path.dirname ( p ) 69 sh( "mkdir -p {}".format(d) ) 73 70 74 71 … … 200 197 # Start the walk 201 198 dname = settings.SRCDIR 202 os.path.walk(dname, step, '') 199 for dirname, _, names in os.walk(dname): 200 for name in names: 201 path = os.path.join(dirname, name) 202 op( path ) 203 203 204 204 ################################################################################ … … 268 268 cmd = "%s 2> /dev/null" % column 269 269 proc = Popen(cmd, stdin=PIPE, stderr=None, shell=True) 270 proc.communicate(input= text + "\n")270 proc.communicate(input=bytes(text + "\n", "UTF-8")) 271 271 else: 272 272 print(text) -
tests/test.py
rd4a60ac r5b993e0 1 #!/usr/bin/python 2 from __future__ import print_function 1 #!/usr/bin/python3 3 2 4 3 from pybin.tools import * … … 102 101 print('ERROR: invalid arguments', file=sys.stderr) 103 102 parser.print_help(sys.stderr) 104 103 sys.exit(1) 105 104 106 105 # script must have at least some tests to run or be listing … … 112 111 # check that exactly one of the booleans is set to true 113 112 if not sum( (listing, all_tests, some_tests, some_dirs) ) > 0 : 114 print(' ERROR: must have option \'--all\', \'--list\', \'--include\', \'-I\' or non-empty test list', file=sys.stderr)113 print('''ERROR: must have option '--all', '--list', '--include', '-I' or non-empty test list''', file=sys.stderr) 115 114 parser.print_help() 116 115 sys.exit(1) … … 281 280 elif options.list : 282 281 print("Listing for %s:%s"% (settings.arch.string, settings.debug.string)) 283 fancy_print("\n".join(map(lambda t: "%s" % (t.toString()), tests)))282 fancy_print("\n".join(map(lambda t: t.toString(), tests))) 284 283 285 284 else :
Note: See TracChangeset
for help on using the changeset viewer.