summaryrefslogtreecommitdiffstats
path: root/tools/cr
diff options
context:
space:
mode:
authortsergeant <tsergeant@chromium.org>2015-02-26 15:01:31 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-26 23:02:20 +0000
commit776f903d83d221752ea562b681f86bfcc3bdb5e6 (patch)
treef231f9d97b3691c295cfb647341b31131f8649c7 /tools/cr
parent90497b7b350019991b383aa42ce60b621d48c833 (diff)
downloadchromium_src-776f903d83d221752ea562b681f86bfcc3bdb5e6.zip
chromium_src-776f903d83d221752ea562b681f86bfcc3bdb5e6.tar.gz
chromium_src-776f903d83d221752ea562b681f86bfcc3bdb5e6.tar.bz2
cr: Add support for run to LinuxChromeOS
This allows LinuxChromeOS to use LinuxRunner and LinuxInstaller to launch the ChromeOS binary. Also fixes minor issue with selecting a runner from the command line. BUG=NONE Review URL: https://codereview.chromium.org/915853003 Cr-Commit-Position: refs/heads/master@{#318337}
Diffstat (limited to 'tools/cr')
-rw-r--r--tools/cr/cr/actions/action.py2
-rw-r--r--tools/cr/cr/actions/linuxchromeos.py30
-rw-r--r--tools/cr/cr/actions/runner.py1
-rw-r--r--tools/cr/main.py2
4 files changed, 33 insertions, 2 deletions
diff --git a/tools/cr/cr/actions/action.py b/tools/cr/cr/actions/action.py
index e2f966a..d187094 100644
--- a/tools/cr/cr/actions/action.py
+++ b/tools/cr/cr/actions/action.py
@@ -25,7 +25,7 @@ class Action(cr.Plugin):
cls.SELECTOR_ARG, dest=cls.SELECTOR,
choices=cls.Choices(),
default=None,
- help=cls.SELECTOR_HELP + 'Overrides ' + cls.SELECTOR
+ help=cls.SELECTOR_HELP + ' Overrides ' + cls.SELECTOR
)
@cr.Plugin.activemethod
diff --git a/tools/cr/cr/actions/linuxchromeos.py b/tools/cr/cr/actions/linuxchromeos.py
new file mode 100644
index 0000000..b8faa3b
--- /dev/null
+++ b/tools/cr/cr/actions/linuxchromeos.py
@@ -0,0 +1,30 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Linux ChromeOS specific implementations."""
+
+import cr
+
+
+class LinuxChromeOSRunner(cr.LinuxRunner):
+ """A version of cr.LinuxRunner for LinuxChromeOS.
+
+ Running ChromeOS in Linux is the same as a normal linux Chrome build -- just
+ executing the output binary.
+ """
+
+ @property
+ def enabled(self):
+ return cr.LinuxChromeOSPlatform.GetInstance().is_active
+
+
+class LinuxChromeOSInstaller(cr.LinuxInstaller):
+ """A version of cr.LinuxInstaller for LinuxChromeOS.
+
+ This does nothing, as there is nothing to be installed.
+ """
+
+ @property
+ def enabled(self):
+ return cr.LinuxChromeOSPlatform.GetInstance().is_active
diff --git a/tools/cr/cr/actions/runner.py b/tools/cr/cr/actions/runner.py
index 0886174..0b7a03d 100644
--- a/tools/cr/cr/actions/runner.py
+++ b/tools/cr/cr/actions/runner.py
@@ -30,6 +30,7 @@ class Runner(cr.Action, cr.Plugin.Type):
Set to 'no' to force it to not be a test.
"""
)
+ cls.AddSelectorArg(command, parser)
@cr.Plugin.activemethod
def Kill(self, targets, arguments):
diff --git a/tools/cr/main.py b/tools/cr/main.py
index b5c2a4b..c4b9b74 100644
--- a/tools/cr/main.py
+++ b/tools/cr/main.py
@@ -59,8 +59,8 @@ def Main():
# Load the build specific configuration
found_build_dir = cr.base.client.LoadConfig()
# Final processing or arguments
- cr.context.ParseArgs()
cr.plugin.Activate()
+ cr.context.ParseArgs()
# If we did not get a command before, it might have been fixed.
if command is None:
command = cr.Command.GetActivePlugin()