mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make the skyanalyzer check the stocks app during testing.
Also, fix the last warning which I conveniently (yet accidentally) left in to test this. R=abarth@chromium.org Review URL: https://codereview.chromium.org/1190223002.
This commit is contained in:
parent
ea10435cec
commit
bfab895dcf
@ -1011,6 +1011,10 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
|
||||
markNeedsLayout();
|
||||
}
|
||||
|
||||
void performResize() {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
void performLayout() {
|
||||
if (_rootConstraints.orientation != _orientation) {
|
||||
if (_orientation != null && child != null)
|
||||
|
||||
@ -970,6 +970,9 @@ class Port(object):
|
||||
def perf_results_directory(self):
|
||||
return self._build_path()
|
||||
|
||||
def analyzer_build_directory(self):
|
||||
return self._build_path()
|
||||
|
||||
def default_results_directory(self):
|
||||
"""Absolute path to the default place to store the test results."""
|
||||
return self._build_path('layout-test-results')
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
import logging
|
||||
import optparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
@ -70,7 +71,7 @@ def main(argv, stdout, stderr):
|
||||
return test_run_results.UNEXPECTED_ERROR_EXIT_STATUS
|
||||
|
||||
try:
|
||||
run_details = run(port, options, args, stderr)
|
||||
run_details = run_tests(port, options, args, stderr)
|
||||
if ((run_details.exit_code not in test_run_results.ERROR_CODES or
|
||||
run_details.exit_code == test_run_results.EARLY_EXIT_STATUS) and
|
||||
not run_details.initial_results.keyboard_interrupted):
|
||||
@ -81,7 +82,11 @@ def main(argv, stdout, stderr):
|
||||
gen_dash_board = GenerateDashBoard(port)
|
||||
gen_dash_board.generate()
|
||||
|
||||
return run_details.exit_code
|
||||
if run_details.exit_code != 0:
|
||||
return run_details.exit_code
|
||||
|
||||
analyzer_result = run_analyzer(port, options, args, stderr)
|
||||
return analyzer_result
|
||||
|
||||
# We need to still handle KeyboardInterrupt, atleast for webkitpy unittest cases.
|
||||
except KeyboardInterrupt:
|
||||
@ -369,7 +374,7 @@ def _set_up_derived_options(port, options, args):
|
||||
if not options.skipped:
|
||||
options.skipped = 'default'
|
||||
|
||||
def run(port, options, args, logging_stream):
|
||||
def run_tests(port, options, args, logging_stream):
|
||||
logger = logging.getLogger()
|
||||
logger.setLevel(logging.DEBUG if options.debug_rwt_logging else logging.INFO)
|
||||
|
||||
@ -386,5 +391,25 @@ def run(port, options, args, logging_stream):
|
||||
finally:
|
||||
printer.cleanup()
|
||||
|
||||
def run_analyzer(port, options, args, logging_stream):
|
||||
build_dir = port.analyzer_build_directory()
|
||||
test_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
sky_tools_dir = os.path.dirname(os.path.dirname(test_dir))
|
||||
analyzer_path = os.path.join(sky_tools_dir, 'skyanalyzer')
|
||||
src_dir = os.path.dirname(os.path.dirname(sky_tools_dir))
|
||||
analyzer_target_path = os.path.join(src_dir, 'sky/examples/stocks2/lib/stock_app.dart')
|
||||
analyzer_args = [
|
||||
analyzer_path,
|
||||
build_dir,
|
||||
analyzer_target_path
|
||||
]
|
||||
try:
|
||||
output = subprocess.check_output(analyzer_args, stderr=subprocess.STDOUT)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print >> logging_stream, "Analyzer found new issues:"
|
||||
print >> logging_stream, e.output
|
||||
return e.returncode
|
||||
return 0
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv[1:], sys.stdout, sys.stderr))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user