[poppler] unit test for GLib bindings

Kouhei Sutou kou at cozmixng.org
Mon Mar 30 06:10:49 PDT 2009


Hi Carlos,

Thanks for trying.

In <1238341726.4783.17.camel at charmaleon>
  "Re: [poppler] unit test for GLib bindings" on Sun, 29 Mar 2009 17:48:46 +0200,
  Carlos Garcia Campos <carlosgc at gnome.org> wrote:

> I've just tried it out and I got a crash while testing:
> 
> $ make check -s
> Making check in goo
> Making check in fofi
> Making check in splash
> Making check in poppler
> Making check in utils
> Making check in glib
> Making check in .
> Making check in reference
> Making check in demo
> Making check in test
> Making check in lib
> Making check in fixtures
> Making check in pdf
> ....................!
> CRASH!!!
> 
> 
> Finished in 2.799551 seconds (total: 0.087569 seconds)
> 
> 21 test(s), 139 assertion(s), 0 failure(s), 0 error(s), 0 pending(s), 0 omission(s), 0 notification(s)
> 95.2381% passed

> The cutter documentation says that cutter tries to get a backtrace for
> crashes, but it seems it couldn't in this case. How can I know which
> test produced the crash?

Please use '--verbose=verbose' (or '-v v') option.  Cutter
shows test names with the options:

---
% glib/test/run-test.sh --verbose=verbose
test-layer:
  test_nested:						.: (0.008216)
  test_title:						.: (0.000842)
  test_visible:						.: (0.000457)
test-page:
  test_index_multi_pages:				.: (0.000428)
  test_get_size:					.: (0.000296)
  test_render_pixbuf:					.: (0.004779)
  test_transition:					.: (0.000516)
  test_index_single_page:				.: (0.000376)
  test_get_form_field_mapping:				.: (0.001078)
  test_get_text:					.: (0.002724)
test-document:
  test_attachment:					.: (0.000648)
  test_action:						.: (0.000500)
  test_new_from_data:					.: (0.000296)
  test_property:					.: (0.000806)
  test_new_from_file:					.: (0.000547)
  test_font:						.: (0.001641)
  test_save_a_copy:					.: (0.001072)
  test_attachment_save:					.: (0.001803)
  test_no_attachment:					.: (0.000329)
  test_save:						.: (0.001117)
test-form-field:
  test_multi_line_text:					.: (0.001383)
  test_combo_choice:					.: (0.001834)
  test_list_choice:					.: (0.002096)
  test_check_button:					.: (0.001182)
  test_radio_button:					.: (0.001242)
  test_general:						.: (0.001353)
  test_normal_text:					.: (0.001482)
  test_file_select_text:				.: (0.008652)
  test_push_button:					.: (0.006131)
  test_normal_password_text:				.: (0.002913)

Finished in 0.150165 seconds (total: 0.056737 seconds)

30 test(s), 172 assertion(s), 0 failure(s), 0 error(s), 0 pending(s), 0 omission(s), 0 notification(s)
100% passed
---

Or please use CUTTER_DEBUG=yes envrioment variable. You can
run tests on GDB:

---
% CUTTER_DEBUG=yes make check -s
Making check in goo
Making check in fofi
Making check in splash
Making check in poppler
Making check in utils
Making check in glib
Making check in .
Making check in reference
Making check in demo
Making check in test
Making check in lib
Making check in fixtures
Making check in pdf
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(no debugging symbols found)
(gdb) r
Starting program: /usr/bin/cutter --keep-opening-modules -s . --exclude-directory lib --exclude-directory fixtures .
[Thread debugging using libthread_db enabled]
[New Thread 0x2b515c9ee620 (LWP 2543)]
..............................

Finished in 0.107099 seconds (total: 0.085314 seconds)

30 test(s), 172 assertion(s), 0 failure(s), 0 error(s), 0 pending(s), 0 omission(s), 0 notification(s)
100% passed

Program exited normally.
(gdb)
---


Yes. Cutter tries to get a backtrace with
g_on_error_stack_trace() but it may fail because some
memories may be broekn on crash...

It seems that Cutter should show crashed test name even if
a backtrace can't be gotten. I'll improve Cutter in the next
release. :)


Thanks,
--
kou


More information about the poppler mailing list