[OE-core] [PATCH 1/2] devtool: add new command for selftest
Ross Burton
ross.burton at intel.com
Mon Oct 12 12:03:24 UTC 2015
In selftest we want to exercise devtool's ability to use plugins from other
layers, so add a basic command to reverse a string to meta-selftest.
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
meta-selftest/lib/devtool/__init__.py | 0
meta-selftest/lib/devtool/test.py | 15 +++++++++++++++
2 files changed, 15 insertions(+)
create mode 100644 meta-selftest/lib/devtool/__init__.py
create mode 100644 meta-selftest/lib/devtool/test.py
diff --git a/meta-selftest/lib/devtool/__init__.py b/meta-selftest/lib/devtool/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/meta-selftest/lib/devtool/test.py b/meta-selftest/lib/devtool/test.py
new file mode 100644
index 0000000..106c322
--- /dev/null
+++ b/meta-selftest/lib/devtool/test.py
@@ -0,0 +1,15 @@
+import argparse
+
+def plugin_init(pluginlist):
+ """Plugin initialization"""
+ pass
+
+def selftest_reverse(args, config, basepath, workspace):
+ """Reverse the value passed to verify the plugin is executing."""
+ print args.value[::-1]
+
+def register_commands(subparsers, context):
+ parser_build = subparsers.add_parser('selftest-reverse', help='Reverse value (for selftest)',
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+ parser_build.add_argument('value', help='Value to reverse')
+ parser_build.set_defaults(func=selftest_reverse)
--
2.1.4
More information about the Openembedded-core
mailing list