summaryrefslogtreecommitdiffstats
path: root/scripts/oe-selftest
diff options
context:
space:
mode:
authorDaniel Istrate <daniel.alexandrux.istrate@intel.com>2016-01-04 15:43:56 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-07 13:40:16 +0000
commit17d886bef2ba960233a353114bf3681619d5cec9 (patch)
tree8ad9f8e8c136843ae07b0877a29fa8e9bd1ad16d /scripts/oe-selftest
parent4ec2da71db78c16aedad2156a68b2e244ee2ccea (diff)
downloadpoky-17d886bef2ba960233a353114bf3681619d5cec9.tar.gz
oe-selftest: Improved --list-classes when determining test names
--list-classes does a weak validation when determining test names: (if method.startswith("test_") which could report any class attribute that starts with 'test_' as a valid test case. This fix checks that the class attribute that starts with 'test_' is also callable (is a method). Fix for [YOCTO #8862] (From OE-Core rev: 175810503d5596370cf7d840539ebdf35cf30278) Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-selftest')
-rwxr-xr-xscripts/oe-selftest2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index bd903f9e68..c32c419e19 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -453,7 +453,7 @@ def main():
453 if isinstance(t, type(oeSelfTest)) and issubclass(t, oeSelfTest) and t!=oeSelfTest: 453 if isinstance(t, type(oeSelfTest)) and issubclass(t, oeSelfTest) and t!=oeSelfTest:
454 print " --", v 454 print " --", v
455 for method in dir(t): 455 for method in dir(t):
456 if method.startswith("test_"): 456 if method.startswith("test_") and callable(vars(t)[method]):
457 print " -- --", method 457 print " -- --", method
458 458
459 except (AttributeError, ImportError) as e: 459 except (AttributeError, ImportError) as e: