Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: tools/telemetry/third_party/coverage/tests/farm/run/run_timid.py

Issue 1366913004: Add coverage Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
2 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
3
4 # Test that the --timid command line argument properly swaps the tracer
5 # function for a simpler one.
6 #
7 # This is complicated by the fact that the tests are run twice for each
8 # version: once with a compiled C-based trace function, and once without
9 # it, to also test the Python trace function. So this test has to examine
10 # an environment variable set in igor.py to know whether to expect to see
11 # the C trace function or not.
12
13 import os
14
15 # When meta-coverage testing, this test doesn't work, because it finds
16 # coverage.py's own trace function.
17 if os.environ.get('COVERAGE_COVERAGE', ''):
18 skip("Can't test timid during coverage measurement.")
19
20 copy("src", "out")
21 run("""
22 python showtrace.py none
23 coverage run showtrace.py regular
24 coverage run --timid showtrace.py timid
25 """, rundir="out", outfile="showtraceout.txt")
26
27 # When running without coverage, no trace function
28 # When running timidly, the trace function is always Python.
29 contains("out/showtraceout.txt",
30 "none None",
31 "timid PyTracer",
32 )
33
34 if os.environ.get('COVERAGE_TEST_TRACER', 'c') == 'c':
35 # If the C trace function is being tested, then regular running should have
36 # the C function, which registers itself as f_trace.
37 contains("out/showtraceout.txt", "regular CTracer")
38 else:
39 # If the Python trace function is being tested, then regular running will
40 # also show the Python function.
41 contains("out/showtraceout.txt", "regular PyTracer")
42
43 clean("out")
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698