diff options
-rw-r--r-- | meta-selftest/lib/devtool/__init__.py | 0 | ||||
-rw-r--r-- | meta-selftest/lib/devtool/test.py | 11 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/devtool.py | 12 |
3 files changed, 23 insertions, 0 deletions
diff --git a/meta-selftest/lib/devtool/__init__.py b/meta-selftest/lib/devtool/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/meta-selftest/lib/devtool/__init__.py | |||
diff --git a/meta-selftest/lib/devtool/test.py b/meta-selftest/lib/devtool/test.py new file mode 100644 index 0000000000..b7474b5eee --- /dev/null +++ b/meta-selftest/lib/devtool/test.py | |||
@@ -0,0 +1,11 @@ | |||
1 | import argparse | ||
2 | |||
3 | def selftest_reverse(args, config, basepath, workspace): | ||
4 | """Reverse the value passed to verify the plugin is executing.""" | ||
5 | print args.value[::-1] | ||
6 | |||
7 | def register_commands(subparsers, context): | ||
8 | parser_build = subparsers.add_parser('selftest-reverse', help='Reverse value (for selftest)', | ||
9 | formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||
10 | parser_build.add_argument('value', help='Value to reverse') | ||
11 | parser_build.set_defaults(func=selftest_reverse) | ||
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py index e4de309e72..fb46559eec 100644 --- a/meta/lib/oeqa/selftest/devtool.py +++ b/meta/lib/oeqa/selftest/devtool.py | |||
@@ -1015,3 +1015,15 @@ class DevtoolTests(DevtoolBase): | |||
1015 | self.track_for_cleanup(tempdir) | 1015 | self.track_for_cleanup(tempdir) |
1016 | self.track_for_cleanup(self.workspacedir) | 1016 | self.track_for_cleanup(self.workspacedir) |
1017 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 1017 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
1018 | |||
1019 | def test_devtool_layer_plugins(self): | ||
1020 | """Test that devtool can use plugins from other layers. | ||
1021 | |||
1022 | This test executes the selftest-reverse command from meta-selftest.""" | ||
1023 | |||
1024 | self.track_for_cleanup(self.workspacedir) | ||
1025 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
1026 | |||
1027 | s = "Microsoft Made No Profit From Anyone's Zunes Yo" | ||
1028 | result = runCmd("devtool --quiet selftest-reverse \"%s\"" % s) | ||
1029 | self.assertEqual(result.output, s[::-1]) | ||