[PATCH] D66873: [Test][Time profiler] Fix test for python3

Anton Afanasyev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 28 05:24:34 PDT 2019


anton-afanasyev created this revision.
anton-afanasyev added reviewers: mgehre, nathanchance.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Fix test checking time profiler generates correct tracing json-file.
`filter` works differently for python2 and python3, so unifying this.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66873

Files:
  clang/test/Driver/check-time-trace-sections.py


Index: clang/test/Driver/check-time-trace-sections.py
===================================================================
--- clang/test/Driver/check-time-trace-sections.py
+++ clang/test/Driver/check-time-trace-sections.py
@@ -12,9 +12,9 @@
     return b <= c
 
 events = json.loads(sys.stdin.read())["traceEvents"]
-codegens = filter(lambda x: x["name"] == "CodeGen Function", events)
-frontends = filter(lambda x: x["name"] == "Frontend", events)
-backends = filter(lambda x: x["name"] == "Backend", events)
+codegens = [event for event in events if event["name"] == "CodeGen Function"]
+frontends = [event for event in events if event["name"] == "Frontend"]
+backends = [event for event in events if event["name"] == "Backend"]
 
 if not all([any([is_inside(codegen, frontend) for frontend in frontends])
                         for codegen in codegens]):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66873.217613.patch
Type: text/x-patch
Size: 861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190828/9d61ae5d/attachment-0001.bin>


More information about the cfe-commits mailing list