From 26e3d58e71e5a88ac2c2d34845f45c77635cd2d4 Mon Sep 17 00:00:00 2001 From: Trevor Gamblin Date: Mon, 16 Oct 2023 15:44:58 -0400 Subject: 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 Signed-off-by: Richard Purdie --- meta/lib/patchtest/data.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'meta/lib') 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 logger=logging.getLogger('patchtest') info=logger.info +default_testdir = os.path.abspath(os.path.dirname(__file__) + "/tests") +default_repodir = os.path.abspath(os.path.dirname(__file__) + "/../../..") + # Data store commonly used to share values between pre and post-merge tests PatchTestDataStore = collections.defaultdict(str) @@ -58,10 +61,12 @@ class PatchTestInput(object): target_patch_group.add_argument('--directory', metavar='DIRECTORY', dest='patch_path', help='The directory containing patches to be tested') - parser.add_argument('repodir', metavar='REPO', + parser.add_argument('--repodir', metavar='REPO', + default=default_repodir, help="Name of the repository where patch is merged") - parser.add_argument('startdir', metavar='TESTDIR', + parser.add_argument('--testdir', metavar='TESTDIR', + default=default_testdir, help="Directory where test cases are located") parser.add_argument('--top-level-directory', '-t', -- cgit v1.2.3-54-g00ecf