Skip to content

Commit 9455a20

Browse files
authored
Revert "Make output of run_tests.py easier to understand. (flutter#16229)"
This reverts commit 019473b.
1 parent 89d23f4 commit 9455a20

1 file changed

Lines changed: 5 additions & 28 deletions

File tree

testing/run_tests.py

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import re
1414
import subprocess
1515
import sys
16-
import time
1716

1817
buildroot_dir = os.path.abspath(os.path.join(os.path.realpath(__file__), '..', '..', '..'))
1918
out_dir = os.path.join(buildroot_dir, 'out')
@@ -25,34 +24,12 @@
2524

2625
fml_unittests_filter = '--gtest_filter=-*TimeSensitiveTest*'
2726

28-
def PrintDivider(char='='):
29-
print '\n'
30-
for _ in xrange(4):
31-
print(''.join([char for _ in xrange(80)]))
32-
print '\n'
33-
3427
def RunCmd(cmd, **kwargs):
35-
command_string = ' '.join(cmd)
36-
37-
PrintDivider('>')
38-
print 'Running command "%s"' % command_string
39-
40-
start_time = time.time()
41-
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs)
42-
(output, _) = process.communicate()
43-
end_time = time.time()
44-
45-
# Print the result no matter what.
46-
for line in output.splitlines():
47-
print line
48-
49-
if process.returncode != 0:
50-
PrintDivider('!')
51-
raise Exception('Command "%s" exited with code %d' % (command_string, process.returncode))
52-
53-
PrintDivider('<')
54-
print 'Command run successfully in %.2f seconds: %s' % (end_time - start_time, command_string)
55-
28+
try:
29+
print(subprocess.check_output(cmd, **kwargs))
30+
except subprocess.CalledProcessError as cpe:
31+
print(cpe.output)
32+
raise cpe
5633

5734
def IsMac():
5835
return sys.platform == 'darwin'

0 commit comments

Comments
 (0)