|
43 | 43 | curdir = dirname(abspath(__file__))
|
44 | 44 | results = join(curdir, 'results')
|
45 | 45 | output = join(results, 'output.xml')
|
46 |
| -interpreter = sys.argv[1] if len(sys.argv) > 1 else 'python' |
47 |
| -version = subprocess.check_output([interpreter, '-V'], encoding='UTF-8', |
48 |
| - stderr=subprocess.STDOUT) |
| 46 | +interpreter = shlex.split(sys.argv[1] if len(sys.argv) > 1 else 'python') |
| 47 | +version = subprocess.check_output(interpreter + ['-V'], encoding='UTF-8', |
| 48 | + stderr=subprocess.STDOUT).strip() |
49 | 49 | py2 = version.split()[1][:3] == '2.7'
|
50 | 50 | arguments = sys.argv[2:]
|
51 | 51 |
|
52 | 52 | if exists(results):
|
53 | 53 | shutil.rmtree(results)
|
54 | 54 | os.mkdir(results)
|
55 | 55 |
|
| 56 | +print(f'Running tests on {version}.\n') |
| 57 | + |
56 | 58 | if not arguments:
|
57 |
| - print(f'Running unit tests with "{interpreter}".') |
58 |
| - command = shlex.split(interpreter) + [join(curdir, 'utest', 'run.py')] |
| 59 | + command = interpreter + [join(curdir, 'utest', 'run.py')] |
| 60 | + print('Running unit tests:\n' + ' '.join(command)) |
59 | 61 | rc = subprocess.call(command)
|
60 | 62 | print()
|
61 | 63 | if rc != 0:
|
|
67 | 69 | excludes = []
|
68 | 70 | if os.sep == '\\':
|
69 | 71 | excludes.extend(['--exclude', 'no-windows'])
|
70 |
| -if 'ipy' in interpreter: |
| 72 | +if 'ipy' in interpreter[0]: |
71 | 73 | excludes.extend(['--exclude', 'no-ipy'])
|
72 | 74 | command = [
|
73 | 75 | 'python', '-m', 'robot.run',
|
74 |
| - '--variable', f'INTERPRETER:{interpreter}', |
| 76 | + '--variable', f'INTERPRETER:{subprocess.list2cmdline(interpreter)}', |
75 | 77 | '--variable', f'PY2:{py2}',
|
76 |
| - '--doc', f"Remote server tests using '{interpreter}'.", |
77 |
| - '--metadata', f'Interpreter Version:{version}', |
| 78 | + '--metadata', f'Interpreter:{version}', |
78 | 79 | '--output', output, '--log', 'NONE', '--report', 'NONE'
|
79 | 80 | ] + excludes + arguments
|
80 |
| -print('Running acceptance tests with command:\n' + ' '.join(command)) |
| 81 | +print('Running acceptance tests:\n' + ' '.join(command)) |
81 | 82 | rc = subprocess.call(command)
|
82 | 83 | print()
|
83 | 84 | if rc > 250:
|
|
0 commit comments