diff options
| author | Karel Klic <kklic@redhat.com> | 2011-03-01 12:08:36 +0100 |
|---|---|---|
| committer | Karel Klic <kklic@redhat.com> | 2011-03-01 12:08:36 +0100 |
| commit | 85f639b7fe277ba327e5013e5b101b4a67f14e1d (patch) | |
| tree | 7caa3999e8c987e3ddbc26f4bfbbdc73defca73f /src/report-python/test_full | |
| parent | fb52104af74bbf6eeda394880666df40b4354aba (diff) | |
| parent | 77468fcdd7cc05db52320c373a24a5490ff32f52 (diff) | |
merge changes from master
Diffstat (limited to 'src/report-python/test_full')
| -rwxr-xr-x | src/report-python/test_full | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/report-python/test_full b/src/report-python/test_full new file mode 100755 index 00000000..103535dd --- /dev/null +++ b/src/report-python/test_full @@ -0,0 +1,27 @@ +#!/usr/bin/python + +import sys +from report import * + +def run_event_on_crash_data(cd, event, log_function = None): + dd = cd.create_dump_dir("/tmp") + dir_name = dd.name + print "Created dump_dir:", dir_name + dd.close() + run_state = run_event_state() + if log_function: # maybe if callable(log_function)? + run_state.logging_callback = log_function + print "Running event:", event + r = run_state.run_event_on_dir_name(dir_name, event) + print "Deleting:", dir_name + delete_dump_dir(dir_name) + return r; + +def log_function(line): + print "LOG:", line + +cd = crash_data() +cd.add("foo", "bar") +cd.add("analyzer", "baz", CD_FLAG_ISNOTEDITABLE) +r = run_event_on_crash_data(cd, "post-create", log_function) +print "Result:", r |
