r370300 - [Test][Time profiler] Fix test for python3

Anton Afanasyev via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 28 23:49:06 PDT 2019


Author: anton-afanasyev
Date: Wed Aug 28 23:49:05 2019
New Revision: 370300

URL: http://llvm.org/viewvc/llvm-project?rev=370300&view=rev
Log:
[Test][Time profiler] Fix test for python3

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

Reviewers: mgehre, nathanchance

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66873

Modified:
    cfe/trunk/test/Driver/check-time-trace-sections.py

Modified: cfe/trunk/test/Driver/check-time-trace-sections.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/check-time-trace-sections.py?rev=370300&r1=370299&r2=370300&view=diff
==============================================================================
--- cfe/trunk/test/Driver/check-time-trace-sections.py (original)
+++ cfe/trunk/test/Driver/check-time-trace-sections.py Wed Aug 28 23:49:05 2019
@@ -12,9 +12,9 @@ def is_before(range1, range2):
     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]):




More information about the cfe-commits mailing list