summaryrefslogtreecommitdiffstats
path: root/scripts/patchtest
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 /scripts/patchtest
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 'scripts/patchtest')
-rwxr-xr-xscripts/patchtest6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/patchtest b/scripts/patchtest
index 9525a2be17..b25ef18321 100755
--- a/scripts/patchtest
+++ b/scripts/patchtest
@@ -142,7 +142,7 @@ def _runner(resultklass, prefix=None):
142 loader.testMethodPrefix = prefix 142 loader.testMethodPrefix = prefix
143 143
144 # create the suite with discovered tests and the corresponding runner 144 # create the suite with discovered tests and the corresponding runner
145 suite = loader.discover(start_dir=PatchTestInput.startdir, pattern=PatchTestInput.pattern, top_level_dir=PatchTestInput.topdir) 145 suite = loader.discover(start_dir=PatchTestInput.testdir, pattern=PatchTestInput.pattern, top_level_dir=PatchTestInput.topdir)
146 ntc = suite.countTestCases() 146 ntc = suite.countTestCases()
147 147
148 # if there are no test cases, just quit 148 # if there are no test cases, just quit
@@ -220,9 +220,9 @@ if __name__ == '__main__':
220 if PatchTestInput.debug: 220 if PatchTestInput.debug:
221 logger.setLevel(logging.DEBUG) 221 logger.setLevel(logging.DEBUG)
222 222
223 # if topdir not define, default it to startdir 223 # if topdir not define, default it to testdir
224 if not PatchTestInput.topdir: 224 if not PatchTestInput.topdir:
225 PatchTestInput.topdir = PatchTestInput.startdir 225 PatchTestInput.topdir = PatchTestInput.testdir
226 226
227 try: 227 try:
228 ret = main() 228 ret = main()