summaryrefslogtreecommitdiff
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:04 +0000
commit175810503d5596370cf7d840539ebdf35cf30278 (patch)
tree299ba089f344751c265f7ef6a50b162e60d64120
parent975e67e28ccba5dcb0fced43c1f9e7da183dc201 (diff)
downloadopenembedded-core-175810503d5596370cf7d840539ebdf35cf30278.tar.gz
openembedded-core-175810503d5596370cf7d840539ebdf35cf30278.tar.bz2
openembedded-core-175810503d5596370cf7d840539ebdf35cf30278.zip
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] Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-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():
if isinstance(t, type(oeSelfTest)) and issubclass(t, oeSelfTest) and t!=oeSelfTest:
print " --", v
for method in dir(t):
- if method.startswith("test_"):
+ if method.startswith("test_") and callable(vars(t)[method]):
print " -- --", method
except (AttributeError, ImportError) as e: