diff options
| author | Mingli Yu <mingli.yu@windriver.com> | 2020-04-14 11:18:03 +0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2020-04-13 23:38:56 -0700 |
| commit | 6018030050a1648cc46de4eafc6480cff9c181fb (patch) | |
| tree | 75753eee67507c51795e57b9b4ecbf2364ce0524 | |
| parent | ea0d7b6a52a1e91e1c8e9c3ca6982cf8022c1f53 (diff) | |
| download | meta-openembedded-6018030050a1648cc46de4eafc6480cff9c181fb.tar.gz | |
mce-test: switch to python3
Make gcov_merge.py and scov_merge.py port to python3.
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-support/mcelog/mce-test/0001-gcov_merge.py-scov_merge.py-switch-to-python3.patch | 110 | ||||
| -rw-r--r-- | meta-oe/recipes-support/mcelog/mce-test_git.bb | 1 |
2 files changed, 111 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/mcelog/mce-test/0001-gcov_merge.py-scov_merge.py-switch-to-python3.patch b/meta-oe/recipes-support/mcelog/mce-test/0001-gcov_merge.py-scov_merge.py-switch-to-python3.patch new file mode 100644 index 0000000000..969bfc17cf --- /dev/null +++ b/meta-oe/recipes-support/mcelog/mce-test/0001-gcov_merge.py-scov_merge.py-switch-to-python3.patch | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | From 430982376a544bbccaef5006fab94bbc2f1d1711 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
| 3 | Date: Mon, 13 Apr 2020 07:12:44 +0000 | ||
| 4 | Subject: [PATCH] gcov_merge.py/scov_merge.py: switch to python3 | ||
| 5 | |||
| 6 | Make gcov_merge.py and scov_merge.py port to python3. | ||
| 7 | |||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
| 11 | --- | ||
| 12 | tools/scripts/gcov_merge.py | 12 ++++++------ | ||
| 13 | tools/scripts/scov_merge.py | 12 ++++++------ | ||
| 14 | 2 files changed, 12 insertions(+), 12 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/tools/scripts/gcov_merge.py b/tools/scripts/gcov_merge.py | ||
| 17 | index 0ac9bed..9f1cb8c 100644 | ||
| 18 | --- a/tools/scripts/gcov_merge.py | ||
| 19 | +++ b/tools/scripts/gcov_merge.py | ||
| 20 | @@ -1,4 +1,4 @@ | ||
| 21 | -#!/usr/bin/env python | ||
| 22 | +#!/usr/bin/env python3 | ||
| 23 | # | ||
| 24 | # Merge gcov graph from several test cases. This can be used to check | ||
| 25 | # the coverage of several test cases. | ||
| 26 | @@ -11,7 +11,7 @@ | ||
| 27 | import sys | ||
| 28 | |||
| 29 | def die(str): | ||
| 30 | - print str | ||
| 31 | + print(str) | ||
| 32 | sys.exit(-1) | ||
| 33 | |||
| 34 | def die_on(cond, str): | ||
| 35 | @@ -55,11 +55,11 @@ def merge(gcls1, gcls2): | ||
| 36 | gcl1.merge(gcl2) | ||
| 37 | |||
| 38 | def gcov_merge(fns, of): | ||
| 39 | - f = file(fns[0]) | ||
| 40 | + f = open(fns[0]) | ||
| 41 | gcls_base = parse(f) | ||
| 42 | |||
| 43 | for fn in fns[1:]: | ||
| 44 | - f = file(fn) | ||
| 45 | + f = open(fn) | ||
| 46 | gcls = parse(f) | ||
| 47 | merge(gcls_base, gcls) | ||
| 48 | |||
| 49 | @@ -67,10 +67,10 @@ def gcov_merge(fns, of): | ||
| 50 | gcl.write(of) | ||
| 51 | |||
| 52 | def usage(): | ||
| 53 | - print 'Usage: %s <gcov graph files>' % (sys.argv[0]) | ||
| 54 | + print('Usage: %s <gcov graph files>' % (sys.argv[0])) | ||
| 55 | |||
| 56 | if __name__ == '__main__': | ||
| 57 | if len(sys.argv) <= 1: | ||
| 58 | usage() | ||
| 59 | - exit -1 | ||
| 60 | + sys.exit(-1) | ||
| 61 | gcov_merge(sys.argv[1:], sys.stdout) | ||
| 62 | diff --git a/tools/scripts/scov_merge.py b/tools/scripts/scov_merge.py | ||
| 63 | index f83b922..bbcf760 100644 | ||
| 64 | --- a/tools/scripts/scov_merge.py | ||
| 65 | +++ b/tools/scripts/scov_merge.py | ||
| 66 | @@ -1,4 +1,4 @@ | ||
| 67 | -#!/usr/bin/env python | ||
| 68 | +#!/usr/bin/env python3 | ||
| 69 | # | ||
| 70 | # Merge mce serverity coverage file from several test cases. This can | ||
| 71 | # be used to check the coverage of several test cases. | ||
| 72 | @@ -11,7 +11,7 @@ | ||
| 73 | import sys | ||
| 74 | |||
| 75 | def die(str): | ||
| 76 | - print str | ||
| 77 | + print(str) | ||
| 78 | sys.exit(-1) | ||
| 79 | |||
| 80 | def die_on(cond, str): | ||
| 81 | @@ -47,11 +47,11 @@ def merge(gcls1, gcls2): | ||
| 82 | gcl1.merge(gcl2) | ||
| 83 | |||
| 84 | def scov_merge(fns, of): | ||
| 85 | - f = file(fns[0]) | ||
| 86 | + f = open(fns[0]) | ||
| 87 | gcls_base = parse(f) | ||
| 88 | |||
| 89 | for fn in fns[1:]: | ||
| 90 | - f = file(fn) | ||
| 91 | + f = open(fn) | ||
| 92 | gcls = parse(f) | ||
| 93 | merge(gcls_base, gcls) | ||
| 94 | |||
| 95 | @@ -59,10 +59,10 @@ def scov_merge(fns, of): | ||
| 96 | gcl.write(of) | ||
| 97 | |||
| 98 | def usage(): | ||
| 99 | - print 'Usage: %s <severities coverage files>' % (sys.argv[0]) | ||
| 100 | + print('Usage: %s <severities coverage files>' % (sys.argv[0])) | ||
| 101 | |||
| 102 | if __name__ == '__main__': | ||
| 103 | if len(sys.argv) <= 1: | ||
| 104 | usage() | ||
| 105 | - exit -1 | ||
| 106 | + sys.exit(-1) | ||
| 107 | scov_merge(sys.argv[1:], sys.stdout) | ||
| 108 | -- | ||
| 109 | 2.24.1 | ||
| 110 | |||
diff --git a/meta-oe/recipes-support/mcelog/mce-test_git.bb b/meta-oe/recipes-support/mcelog/mce-test_git.bb index 007b3944ae..35fb944702 100644 --- a/meta-oe/recipes-support/mcelog/mce-test_git.bb +++ b/meta-oe/recipes-support/mcelog/mce-test_git.bb | |||
| @@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" | |||
| 12 | 12 | ||
| 13 | SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mce-test.git;protocol=git \ | 13 | SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mce-test.git;protocol=git \ |
| 14 | file://makefile-remove-ldflags.patch \ | 14 | file://makefile-remove-ldflags.patch \ |
| 15 | file://0001-gcov_merge.py-scov_merge.py-switch-to-python3.patch \ | ||
| 15 | " | 16 | " |
| 16 | SRCREV = "7643baf6c3919b3d727e6ba6c2e545dc6a653307" | 17 | SRCREV = "7643baf6c3919b3d727e6ba6c2e545dc6a653307" |
| 17 | PV = "20190917+git${SRCPV}" | 18 | PV = "20190917+git${SRCPV}" |
