diff options
Diffstat (limited to 'scripts/oe-selftest')
| -rwxr-xr-x | scripts/oe-selftest | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest deleted file mode 100755 index afc48d9905..0000000000 --- a/scripts/oe-selftest +++ /dev/null | |||
| @@ -1,63 +0,0 @@ | |||
| 1 | #!/usr/bin/env python3 | ||
| 2 | |||
| 3 | # Copyright (c) 2013-2017 Intel Corporation | ||
| 4 | # | ||
| 5 | # SPDX-License-Identifier: GPL-2.0-only | ||
| 6 | # | ||
| 7 | |||
| 8 | # DESCRIPTION | ||
| 9 | # This script runs tests defined in meta/lib/oeqa/selftest/ | ||
| 10 | # It's purpose is to automate the testing of different bitbake tools. | ||
| 11 | # To use it you just need to source your build environment setup script and | ||
| 12 | # add the meta-selftest layer to your BBLAYERS. | ||
| 13 | # Call the script as: "oe-selftest -a" to run all the tests in meta/lib/oeqa/selftest/ | ||
| 14 | # Call the script as: "oe-selftest -r <module>.<Class>.<method>" to run just a single test | ||
| 15 | # E.g: "oe-selftest -r bblayers.BitbakeLayers" will run just the BitbakeLayers class from meta/lib/oeqa/selftest/bblayers.py | ||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | import os | ||
| 20 | import sys | ||
| 21 | |||
| 22 | scripts_path = os.path.dirname(os.path.realpath(__file__)) | ||
| 23 | lib_path = scripts_path + '/lib' | ||
| 24 | sys.path = sys.path + [lib_path] | ||
| 25 | import argparse_oe | ||
| 26 | import scriptutils | ||
| 27 | import scriptpath | ||
| 28 | scriptpath.add_oe_lib_path() | ||
| 29 | scriptpath.add_bitbake_lib_path() | ||
| 30 | |||
| 31 | from oeqa.utils import load_test_components | ||
| 32 | from oeqa.core.exception import OEQAPreRun | ||
| 33 | |||
| 34 | logger = scriptutils.logger_create('oe-selftest', stream=sys.stdout, keepalive=True) | ||
| 35 | |||
| 36 | def main(): | ||
| 37 | description = "Script that runs unit tests against bitbake and other Yocto related tools. The goal is to validate tools functionality and metadata integrity. Refer to https://wiki.yoctoproject.org/wiki/Oe-selftest for more information." | ||
| 38 | parser = argparse_oe.ArgumentParser(description=description) | ||
| 39 | |||
| 40 | comp_name, comp = load_test_components(logger, 'oe-selftest').popitem() | ||
| 41 | comp.register_commands(logger, parser) | ||
| 42 | |||
| 43 | try: | ||
| 44 | args = parser.parse_args() | ||
| 45 | results = args.func(logger, args) | ||
| 46 | ret = 0 if results.wasSuccessful() else 1 | ||
| 47 | except SystemExit as err: | ||
| 48 | if err.code != 0: | ||
| 49 | raise err | ||
| 50 | ret = err.code | ||
| 51 | except OEQAPreRun as pr: | ||
| 52 | ret = 1 | ||
| 53 | |||
| 54 | return ret | ||
| 55 | |||
| 56 | if __name__ == '__main__': | ||
| 57 | try: | ||
| 58 | ret = main() | ||
| 59 | except Exception: | ||
| 60 | ret = 1 | ||
| 61 | import traceback | ||
| 62 | traceback.print_exc() | ||
| 63 | sys.exit(ret) | ||
