GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pythonfuzz/pythonfuzz/tracer.py at master · fuzzitdev/pythonfuzz

This repository was archived by the owner on Apr 30, 2021. It is now read-only.

Expand file tree

/

tracer.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
33 lines (24 loc) · 825 Bytes
/

tracer.py

Copy path

File metadata and controls

33 lines (24 loc) · 825 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import collections
import sys
prev_line = 0
prev_filename = ''
data = collections.defaultdict(set)
def trace(frame, event, arg):
if event != 'line':
return trace
global prev_line
global prev_filename
func_filename = frame.f_code.co_filename
func_line_no = frame.f_lineno
if func_filename != prev_filename:
# We need a way to keep track of inter-files transferts,
# and since we don't really care about the details of the coverage,
# concatenating the two filenames in enough.
data[func_filename + prev_filename].add((prev_line, func_line_no))
else:
data[func_filename].add((prev_line, func_line_no))
prev_line = func_line_no
prev_filename = func_filename
return trace
def get_coverage():
return sum(map(len, data.values()))
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.