diff options
Diffstat (limited to 'meta/lib/patchtest')
-rwxr-xr-x | meta/lib/patchtest/selftest/selftest | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/meta/lib/patchtest/selftest/selftest b/meta/lib/patchtest/selftest/selftest index c2e6b4863d..ba8e1623ee 100755 --- a/meta/lib/patchtest/selftest/selftest +++ b/meta/lib/patchtest/selftest/selftest | |||
@@ -15,6 +15,9 @@ patchesdir = os.path.join(currentdir, 'files') | |||
15 | topdir = os.path.dirname(currentdir) | 15 | topdir = os.path.dirname(currentdir) |
16 | parentdir = os.path.dirname(topdir) | 16 | parentdir = os.path.dirname(topdir) |
17 | 17 | ||
18 | # path to the repo root | ||
19 | repodir = os.path.dirname(os.path.dirname(parentdir)) | ||
20 | |||
18 | def print_results(passcount, skipcount, failcount, xpasscount, xfailcount, errorcount): | 21 | def print_results(passcount, skipcount, failcount, xpasscount, xfailcount, errorcount): |
19 | total = passcount + skipcount + failcount + xpasscount + xfailcount + errorcount | 22 | total = passcount + skipcount + failcount + xpasscount + xfailcount + errorcount |
20 | print("============================================================================") | 23 | print("============================================================================") |
@@ -30,21 +33,16 @@ def print_results(passcount, skipcount, failcount, xpasscount, xfailcount, error | |||
30 | print("============================================================================") | 33 | print("============================================================================") |
31 | 34 | ||
32 | # Once the tests are in oe-core, we can remove the testdir param and use os.path.dirname to get relative paths | 35 | # Once the tests are in oe-core, we can remove the testdir param and use os.path.dirname to get relative paths |
33 | def test(root, patch, testdir): | 36 | def test(root, patch): |
34 | res = True | 37 | res = True |
35 | patchpath = os.path.abspath(os.path.join(root, patch)) | 38 | patchpath = os.path.abspath(os.path.join(root, patch)) |
36 | |||
37 | 39 | ||
38 | cmd = 'patchtest %s %s/tests --patch %s' % (testdir, topdir, patchpath) | 40 | cmd = 'patchtest %s %s/tests --patch %s' % (repodir, topdir, patchpath) |
39 | results = subprocess.check_output(cmd, stderr=subprocess.STDOUT, universal_newlines=True, shell=True) | 41 | results = subprocess.check_output(cmd, stderr=subprocess.STDOUT, universal_newlines=True, shell=True) |
40 | 42 | ||
41 | return results | 43 | return results |
42 | 44 | ||
43 | if __name__ == '__main__': | 45 | if __name__ == '__main__': |
44 | # sys.argv[1] should be the repo to target for selftest, i.e. oe-core | ||
45 | if len(sys.argv) == 1: | ||
46 | sys.exit("Error: Must provide the path to openembedded-core, e.g. \"selftest /workspace/yocto/openembedded-core\"") | ||
47 | |||
48 | passcount = 0 | 46 | passcount = 0 |
49 | failcount = 0 | 47 | failcount = 0 |
50 | skipcount = 0 | 48 | skipcount = 0 |
@@ -56,7 +54,7 @@ if __name__ == '__main__': | |||
56 | 54 | ||
57 | for root, dirs, patches in os.walk(patchesdir): | 55 | for root, dirs, patches in os.walk(patchesdir): |
58 | for patch in patches: | 56 | for patch in patches: |
59 | results = test(root, patch, sys.argv[1]) | 57 | results = test(root, patch) |
60 | 58 | ||
61 | a = patch.split('.') | 59 | a = patch.split('.') |
62 | klass, testname = a[0], a[1] | 60 | klass, testname = a[0], a[1] |