| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 import pipes |
| 7 import shutil | 8 import shutil |
| 9 import subprocess |
| 8 import sys | 10 import sys |
| 9 | 11 |
| 10 import test_env # pylint: disable=W0403,W0611 | 12 import test_env # pylint: disable=W0403,W0611 |
| 11 | 13 |
| 12 # Delete the old recipe_engine directory which might have stale pyc files | 14 # Delete the old recipe_engine directory which might have stale pyc files |
| 13 # that will mess us up. | 15 # that will mess us up. |
| 14 shutil.rmtree(os.path.join( | 16 shutil.rmtree(os.path.join( |
| 15 os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname( | 17 os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname( |
| 16 os.path.realpath(__file__))))), | 18 os.path.realpath(__file__))))), |
| 17 'third_party', 'recipe_engine'), | 19 'third_party', 'recipe_engine'), |
| 18 ignore_errors=True) | 20 ignore_errors=True) |
| 19 | 21 |
| 20 RECIPES_PY = os.path.join( | 22 RECIPES_PY = os.path.join( |
| 21 os.path.dirname(os.path.dirname(os.path.realpath(__file__))), | 23 os.path.dirname(os.path.dirname(os.path.realpath(__file__))), |
| 22 'recipes.py') | 24 'recipes.py') |
| 23 | 25 |
| 24 args = [sys.argv[0], 'simulation_test'] + sys.argv[1:] | 26 args = [RECIPES_PY, 'simulation_test'] + sys.argv[1:] |
| 25 os.execvp(RECIPES_PY, args) | 27 ret = subprocess.call(args) |
| 28 if ret: |
| 29 # TODO(martiniss): Move this logic into recipes-py. http://crbug.com/601662 |
| 30 if not any(x.startswith('train') for x in args): |
| 31 print |
| 32 print 'To train new expectations, run:' |
| 33 print ' ', sys.argv[0], 'train' |
| 34 print |
| 35 if not any(x.startswith('--html_report') for x in args): |
| 36 print 'To create a coverage report, run:' |
| 37 print ' ', ' '.join(pipes.quote(arg) for arg in sys.argv), |
| 38 print '--html_report PATH' |
| 39 print |
| 40 sys.exit(ret) |
| OLD | NEW |