diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-10-11 09:39:58 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-10-11 09:39:58 -0400 |
commit | 064f6f18ea75af5f28a9adf959e902f6c3010bb6 (patch) | |
tree | 074db569309dda04fb351888a9d2e6721c1b991f /coverage/tracer.c | |
parent | 5b3e061e84857872572ec858efe51106ea156bdf (diff) | |
download | python-coveragepy-git-064f6f18ea75af5f28a9adf959e902f6c3010bb6.tar.gz |
One way to collect arc information..
Diffstat (limited to 'coverage/tracer.c')
-rw-r--r-- | coverage/tracer.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/coverage/tracer.c b/coverage/tracer.c index 98f10d1b..f52d66db 100644 --- a/coverage/tracer.c +++ b/coverage/tracer.c @@ -39,10 +39,9 @@ typedef struct {
PyObject_HEAD
PyObject * should_trace;
- PyObject * line_data;
- PyObject * arc_data;
+ PyObject * data;
PyObject * should_trace_cache;
- PyObject * branch;
+ PyObject * arcs;
int started;
/* The index of the last-used entry in tracenames. */
int depth;
@@ -60,8 +59,7 @@ static int Tracer_init(Tracer *self, PyObject *args, PyObject *kwds)
{
self->should_trace = NULL;
- self->line_data = NULL;
- self->arc_data = NULL;
+ self->data = NULL;
self->should_trace_cache = NULL;
self->started = 0;
self->depth = -1;
@@ -82,8 +80,7 @@ Tracer_dealloc(Tracer *self) }
Py_XDECREF(self->should_trace);
- Py_XDECREF(self->line_data);
- Py_XDECREF(self->arc_data);
+ Py_XDECREF(self->data);
Py_XDECREF(self->should_trace_cache);
while (self->depth >= 0) {
@@ -248,7 +245,7 @@ Tracer_trace(Tracer *self, PyFrameObject *frame, int what, PyObject *arg) Py_INCREF(tracename);
PyTuple_SET_ITEM(t, 0, tracename);
PyTuple_SET_ITEM(t, 1, MyInt_FromLong(frame->f_lineno));
- PyDict_SetItem(self->line_data, t, Py_None);
+ PyDict_SetItem(self->data, t, Py_None);
Py_DECREF(t);
}
}
@@ -299,17 +296,14 @@ Tracer_members[] = { { "should_trace", T_OBJECT, offsetof(Tracer, should_trace), 0,
PyDoc_STR("Function indicating whether to trace a file.") },
- { "line_data", T_OBJECT, offsetof(Tracer, line_data), 0,
- PyDoc_STR("The raw dictionary of trace data.") },
-
- { "arc_data", T_OBJECT, offsetof(Tracer, arc_data), 0,
+ { "data", T_OBJECT, offsetof(Tracer, data), 0,
PyDoc_STR("The raw dictionary of trace data.") },
{ "should_trace_cache", T_OBJECT, offsetof(Tracer, should_trace_cache), 0,
PyDoc_STR("Dictionary caching should_trace results.") },
- { "branch", T_OBJECT, offsetof(Tracer, branch), 0,
- PyDoc_STR("Should we trace branches?") },
+ { "arcs", T_OBJECT, offsetof(Tracer, arcs), 0,
+ PyDoc_STR("Should we trace arcs, or just lines?") },
{ NULL }
};
|