summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2023-10-16 15:44:58 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-17 11:41:34 +0100
commit26e3d58e71e5a88ac2c2d34845f45c77635cd2d4 (patch)
treea5e2359080ee9efa58bfd2ebb2fc88751ce03232 /meta/lib
parent6e53a778f10c77eab3c0172a0cbc4d63efc663e9 (diff)
downloadpoky-26e3d58e71e5a88ac2c2d34845f45c77635cd2d4.tar.gz
patchtest: set default repo and testdir targets
Since patchtest is in oe-core, the Python os module's methods can be used to retrieve the repository path and tests directory by default. This reduces the number of mandatory arguments for invocation of patchtest unless the user wants to use a custom test suite or test patches against a different repo. The REPO and TESTDIR arguments are likewise adjusted so that they are optional. Also, make it more obvious what the --startdir flag is meant for on the command line by renaming it to --testdir, and update the scripts/patchtest.README file to be consistent with the new usage. (From OE-Core rev: bae7421ece4806f5148f164293810b9fe75e0756) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/patchtest/data.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/lib/patchtest/data.py b/meta/lib/patchtest/data.py
index b661dd6479..12f36aa14d 100644
--- a/meta/lib/patchtest/data.py
+++ b/meta/lib/patchtest/data.py
@@ -35,6 +35,9 @@ import logging
35logger=logging.getLogger('patchtest') 35logger=logging.getLogger('patchtest')
36info=logger.info 36info=logger.info
37 37
38default_testdir = os.path.abspath(os.path.dirname(__file__) + "/tests")
39default_repodir = os.path.abspath(os.path.dirname(__file__) + "/../../..")
40
38# Data store commonly used to share values between pre and post-merge tests 41# Data store commonly used to share values between pre and post-merge tests
39PatchTestDataStore = collections.defaultdict(str) 42PatchTestDataStore = collections.defaultdict(str)
40 43
@@ -58,10 +61,12 @@ class PatchTestInput(object):
58 target_patch_group.add_argument('--directory', metavar='DIRECTORY', dest='patch_path', 61 target_patch_group.add_argument('--directory', metavar='DIRECTORY', dest='patch_path',
59 help='The directory containing patches to be tested') 62 help='The directory containing patches to be tested')
60 63
61 parser.add_argument('repodir', metavar='REPO', 64 parser.add_argument('--repodir', metavar='REPO',
65 default=default_repodir,
62 help="Name of the repository where patch is merged") 66 help="Name of the repository where patch is merged")
63 67
64 parser.add_argument('startdir', metavar='TESTDIR', 68 parser.add_argument('--testdir', metavar='TESTDIR',
69 default=default_testdir,
65 help="Directory where test cases are located") 70 help="Directory where test cases are located")
66 71
67 parser.add_argument('--top-level-directory', '-t', 72 parser.add_argument('--top-level-directory', '-t',