Commit Graph

273 Commits

Author SHA1 Message Date
Michael Natterer d46041665c app: disable UI test alt_click_is_layer_to_selection()
It makes assumptions about widget positions that don't work on Jenkins.
2012-08-04 01:53:55 +02:00
Michael Natterer fc28e60dec app: un-fail (not fix) test-ui so make check runs again
keyboard_zoom_focus: disabled, because it fails randomly

restore_recently_closed_multi_column_dock: tracked down the
failure to GTK+ and disabled until we depend on GTK+ >= 2.24.11

repeatedly_switch_window_mode: disabled, I have no clue how to
fix this. These UI tests run way too much code to be useful.
2012-08-03 23:43:09 +02:00
Michael Natterer 6c025d52bf app: make app/tests/ build again 2012-06-20 22:13:06 +02:00
Michael Natterer 2bf48b5f19 app: remove leftover operation testing junk from tests Makefile.am 2012-06-17 00:22:48 +02:00
Ville Sokk 1edb18c30a app: modified and moved gegl operation testing to operations/tests 2012-06-14 21:30:00 +03:00
Ville Sokk e35427071b app: added test for gegl operations 2012-06-14 21:29:52 +03:00
Ville Sokk 4148d4a5af app: fixed typos in testing code 2012-06-05 22:03:26 +03:00
Michael Henning 89760cf044 app: Save the maximized state of the main window in the sessionrc file. 2012-05-27 20:42:02 +02:00
Michael Natterer b058137145 Bug 676389 - Compilation fails using clang because of -u options passed to linker
Use -Wl,-u,symbol to makes things build instead of just -u symbol.
2012-05-20 19:29:44 +02:00
Michael Natterer 91392f85e5 app: make tests build again 2012-05-19 01:27:37 +02:00
Michael Natterer ba4034f8dc app: fix tests: must not link against libgimp 2012-05-10 22:48:37 +02:00
Martin Nordholts d7db79c2f2 app: Make tests build
In particular: link.
2012-05-10 22:12:58 +02:00
Michael Natterer af2ad3228f app: fail less badly in tests 2012-05-05 20:36:54 +02:00
Michael Muré 9966bcfd13 remove now useless and deprecated g_thread_init
Warning

g_thread_init has been deprecated since version 2.32 and should not be used in newly-written code. This function is no longer necessary. The GLib threading system is automatically initialized at the start of your program.
2012-05-03 20:44:07 +09:00
Martin Nordholts 1adfcfaf58 app/tests: Build and initialize GEGL
2 tests left that doesn't pass, will fix
2012-05-02 22:32:41 +02:00
Martin Nordholts 563d3c10d6 Make 'make check' compile 2012-05-02 21:53:38 +02:00
Michael Natterer c07325a005 app: add "precision" argument to gimp_image_new() 2012-05-02 17:51:09 +02:00
Michael Natterer a9e60bf6ce app: make the tests build again 2012-05-02 17:51:03 +02:00
Michael Natterer c14738806e app: use gimp_image_get_layer_format() instead of dealing with image_type 2012-05-02 17:50:57 +02:00
Michael Natterer 105d2207ef app: require a non-NULL format in gimp_tile_manager_create_buffer() 2012-05-02 17:50:56 +02:00
Michael Natterer 765c2cfea2 app: replace GimpDraable's type by a Babl format
and change gimp_drawable_new() and all gimp_layer_new() variants to
take formats instead of types.
2012-05-02 17:46:06 +02:00
Michael Natterer 411b1b6f4b app: make test-gimptilebackendtilemanager.c build again 2012-05-02 17:46:02 +02:00
Martin Nordholts 08cbf159c1 app/tests: Update gegl_buffer_get() code so it builds 2012-04-01 11:44:12 +02:00
Øyvind Kolås 2ea41ea3f6 tests: update API usage of gimptilebackendtilemanager test 2012-03-13 13:09:59 +00:00
Martin Nordholts 6335190ff7 app/tests: The single-window-mode setting is in the sessionrc now
We don't need to have a special gimprc because of it.
2012-01-10 19:47:52 +01:00
Michael Natterer 3821eb1a56 app: update test sessionrc files for the moved session config properties 2011-11-05 21:13:16 +01:00
Martin Nordholts d32e1ed351 app/tests: Simplify
Use g_test_add_func() and g_test_add_data_func().
2011-10-15 13:19:04 +02:00
Martin Nordholts 16ca43e4c8 Revert "app: Add /gimptilebackendtilemanager/basic_write unit test"
This reverts commit e4d6726bde.
We need a GEGL release to depend on first.
2011-10-02 18:41:11 +02:00
Martin Nordholts e4d6726bde app: Add /gimptilebackendtilemanager/basic_write unit test
Rename the 'basic_usage' test to 'basic_read' and add 'basic_write'
test. Implement GimpTileBackendTileManagerPrivate enough to make them
pass.

Note that these tests currently do not work with GIMP's "effective
tile size" optimization.
2011-10-02 18:25:08 +02:00
Martin Nordholts cb242a484e app: Add basic GimpTileBackendTileManager unit test
Add a super basic GimpTileBackendTileManager unit test and implement
GimpTileBackendTileManager enough to make it pass. Still a lot of work
left to do, this was just to get things up and running.
2011-09-30 12:00:40 +02:00
Martin Nordholts 2b2ecd1af1 app/tests: Remove static Gimp *gimp
Say no to evilness.
2011-09-30 07:56:47 +02:00
Martin Nordholts 172c3eb935 app/tests: Add single-window mode specific tests 2011-07-20 16:36:36 +02:00
Martin Nordholts 6c880859ea app/tests: Fix sporadic '/gimp-ui/repeatedly_switch_window_mode' failure 2011-07-03 11:28:42 +02:00
Martin Nordholts f55f26c9b8 app/tests: Add single-window mode session files test
Rename and copy some session files and add a single-window mode
session files test.
2011-06-14 23:34:12 +02:00
Martin Nordholts e74d220930 app: Restore docks in an idle handler
In single-window mode, gimp_session_managed_set_aux_info() will set
the size of the dock areas at the sides. If we don't wait for those
areas to get their size-allocation, we can't properly restore the
docks inside them, so do that in an idle callback.

Also add a required call to gimp_test_run_mainloop_until_idle()
because of this in the 'automatic_tab_style' test.
2011-06-14 23:34:12 +02:00
Martin Nordholts bed298be13 app: Remember column width in multi-column dock windows 2011-05-31 23:15:39 +02:00
Martin Nordholts 981546c02e app/tests: Make sessionrc-2-6 more realistic
GIMP 2.6 session files can't have many docks in a dock window, so
remove that from the GIMP 2.6 session file we use for compatibility
testing. Also remove the "gimp-single-image-window" entry.

The downside is that we need a separate 'expected'-file, but we need
to live with that.
2011-05-31 23:15:38 +02:00
Martin Nordholts 10aa3921a0 app: Rememeber if image windows are opened
Rememeber if image windows are opened because we want the
gimp_session_info_restore() code to run for the single-image window
once that code is in place.
2011-05-28 16:18:34 +02:00
Martin Nordholts a456a70bfd app/tests: Add test for gimp_session_info_read_geometry() fix
Add regression test for "app: Give configure event info to
gimp_session_info_read_geometry()", commit
93fd257c52, which fails without that fix
being present.
2011-05-27 22:34:24 +02:00
Martin Nordholts cd72389404 app/tests: Add '/gimp-ui/close_image'
Add '/gimp-ui/close_image', mainly so that we can do tests that
becomes much harder if there is an image around.
2011-05-27 22:33:55 +02:00
Martin Nordholts 2095c9307b app/tests: Fix typo in gimp-app-test-utils.c 2011-05-27 22:33:54 +02:00
Martin Nordholts 9325120291 app/tests: Distribute new session files 2011-05-20 18:19:56 +02:00
Martin Nordholts 87e69d2312 app/tests: Add test for GIMP 2.8 multi window session files
Move code in test-session-management.c to a common place so we can
have several variants of session management tests. We can't easily run
all session management tests in a single process, because some parts
of Gimp (the GObject) initialization eeks if done twice in the same
process.

Rename test-session-management.c to test-session-2-6-compatibility.c
and create a new test for GIMP 2.8 multi-window mode session files,
namely test-session-2-8-compatibility-multi-window.c. Copy and rename
sessionrc files accordingly.
2011-05-18 21:30:04 +02:00
Martin Nordholts 4121ac3738 app: Use GLib test framework in test-session-management.c
Use GLib test framework in test-session-management.c. Also rename the
test to 'session_2_6_compatibility'.
2011-05-18 21:11:07 +02:00
Martin Nordholts e255998775 app/tests: Expose gimp_test_utils_set_env_to_subpath() 2011-05-18 21:11:07 +02:00
Martin Nordholts 0f19471e22 app: Make GimpDockContainer::get_docks() return a new list
Make GimpDockContainer::get_docks() return a new list and not just a
pointer to a list so that GimpImageWindow can implement it (who needs
to merge its two GimpDockColumns lists).
2011-05-13 21:04:23 +02:00
Martin Nordholts 4b9243fc60 app: Make GimpDockWindow implement GimpDockContainer
Make GimpDockWindow implement the GimpDockContainer interface. The
plan is to make GimpImageWindow also implement the GimpDockContainer
interface when we start to session manage docks in single-window mode.
2011-05-09 19:55:51 +02:00
Martin Nordholts d9264c6bd5 app/tests: Fixup test-gimpidtable.c
Fixup of test-gimpidtable.c of things sleepy eyes and brains missed.
2011-05-06 07:23:16 +02:00
Martin Nordholts c4097d4ff4 app: void * -> gpointer in GimpIdTable 2011-05-04 23:14:21 +02:00
Martin Nordholts 9fefa22efe app: Add GimpIdTable utility class
Not written in Vala... ;)
2011-05-04 22:54:35 +02:00
Martin Nordholts a4aa6add43 app/tests: Assert on existance of files before trying to open them
Assert on existance of files before trying to open them so that that
reason for failure becomes clear when that is the cause.
2011-04-10 12:12:15 +02:00
Martin Nordholts a5204631f3 app/tests: Use plug-ins from build dir, in particular file-png
Use a selected set of plug-ins from the build dir rather than the
install dir. In particular 'file-png' for the
'/gimp-save-and-export/imported_file_uris' test. We might need to use
other plug-ins from the build dir as well later, but for the ones from
'plug-ins/common' is enough.
2011-04-08 08:50:59 +02:00
Martin Nordholts 18286d29ec app/tests: Use gdk_window_get_display()
Use gdk_window_get_display() (available since GTK+ 2.24 which we now
depend on) and not gdk_drawable_get_display(), which is deprecated.
2011-04-06 21:05:24 +02:00
Martin Nordholts 67755ab987 app/tests: Update include for gimp_display_shell_canvas_tool_events() 2011-04-05 22:04:25 +02:00
Martin Nordholts a8f552da2f Bug 646371 - The wrong file gets saved when exporting with overwrite
An image can not be considered both exported and imported at the same
time, so stop consider it as imported after we consider it exported.

Also add an automatic regression test.
2011-04-03 16:54:34 +02:00
Michael Natterer 1cdaa2846f app: some forgotten s/GDK_foo/GDK_KEY_foo/ 2011-03-29 18:53:02 +02:00
Michael Natterer 1c8149a553 Bug 632568 - 'gimp-drawable-transform-rotate-simple' makes GIMP crash in some cases
Applied modified patch from Massimo that makes sure we don't use
negative width/height if source and dest regions don't overlap.
2011-03-18 00:53:21 +01:00
Martin Nordholts 8bf46b3efb app/tests: Cleanup temp files after tests
Remove files in /tmp after tests so that other users on the same
machine (like buildbots) also can run make distcheck without getting
"can't overwrite file" errors.
2011-02-09 23:48:18 +01:00
Martin Nordholts 3e0d0b862a app/tests: Add test-save-and-export
Add some regression tests for how the URIs associated with an image is
handled during, save, import etc.
2011-02-02 22:32:30 +01:00
Martin Nordholts 3728f6f7d7 app/tests: Add gimp_test_utils_create_image_from_dalog() 2011-02-02 22:29:24 +01:00
Martin Nordholts a69cd7467d app/tests: Update gimpdir/tags.xml
The order is changed after tests are run, make the change already in
the version controlled version.
2011-02-02 08:34:39 +01:00
Martin Nordholts df0772fcde app: Add 'crop_set_width_without_pending_rect' regression test
Add regression test 'crop_set_width_without_pending_rect' for "Bug
322396 - Crop dimension entering causes crash".
2010-10-31 15:09:03 +01:00
Martin Nordholts cba98e1bc0 app/tests: Run tests on an Xvfb X server if available
Add a configure check for xvfb-run and run tests with that if
available. This makes it possible to easily run UI tests in headless
environments such as a server that does nightly builds; one just needs
to make sure xvfb-run is available.
2010-10-31 08:22:05 +01:00
Martin Nordholts 5931fe5312 app/tests: test-tools.c formating 2010-10-26 19:06:32 +02:00
Martin Nordholts d3c97238a3 app/tests: Fix inludes of non-UI tests
Eventually we might want to be more strict, but I think it will be
fine to depend on UI headers in non-UI tests. Non-UI tests just means
we don't need to initalize the UI.
2010-10-26 14:35:06 +02:00
Martin Nordholts 4fd051cc0d app/tests: Remove invalid redeclaration
I forgot this...
2010-10-26 14:34:10 +02:00
Martin Nordholts fc8ab634a8 app/tests: Add '/gimp-tools/crop_tool_can_crop' test
Begin adding a new set of tests meant to test tools. The first test is
a regression test for "Bug 315255 - SIGSEGV, while doing a crop".
2010-10-26 14:23:09 +02:00
Martin Nordholts e7b7bb7136 app/tests: Make gimp_ui_get_ui_manager() a global test util
Make gimp_ui_get_ui_manager() a global test util and make
gimp_test_utils_create_image() return void, clients can reach the new
image and display from the Gimp instance.
2010-10-26 14:23:09 +02:00
Martin Nordholts 62ece2ff18 app/tests: Make gimp_ui_synthesize_key_event() a global test util 2010-10-26 14:23:09 +02:00
Martin Nordholts 3d82d40f5b app/tests: Improve gimp_test_utils_set_env_to_subdir() hint
Improve gimp_test_utils_set_env_to_subdir() hint by making it stand
out more from normal gdb output.
2010-10-26 14:23:08 +02:00
Martin Nordholts 2056042e96 app/tests: Add gimp_test_utils_create_image() 2010-10-26 14:22:53 +02:00
Martin Nordholts 9e6f5000a5 app/tests: Give possible solution to 'keyboard_zoom_focus' failing 2010-10-26 14:21:27 +02:00
Martin Nordholts 8140df304a app/tests: Don't depend on UI in test-xcf.c 2010-10-21 21:12:54 +02:00
Martin Nordholts 81410e0a5f app/tests: Exit properly in test-core.c to avoid broken wire
Exit properly in test-core.c to avoid broken wire causing the warning:

  LibGimpBase-WARNING **: script-fu: gimp_wire_read(): error
2010-10-21 21:12:46 +02:00
Martin Nordholts c1c42f193d app: Remove 'use_cpu_accel' from gimp_init_for_{,gui_}testing()
Remove silly 'use_cpu_accel' parameter from gimp_init_for_testing()
and gimp_init_for_gui_testing().
2010-10-09 18:50:34 +02:00
Martin Nordholts 185deee3b2 app: Don't run UI tests when there is no DISPLAY 2010-10-03 11:14:35 +02:00
Martin Nordholts ea5190e630 app/tests: Fix gimp_display_shell_transform_xy() build 2010-09-26 12:47:24 +02:00
Martin Nordholts 3c2f0809e3 app/tests: Increase GIMP_UI_WINDOW_POSITION_EPSILON
Increase GIMP_UI_WINDOW_POSITION_EPSILON, we had a nightly build that
failed with

  assertion failed ((int)abs (y_before_hide - y_after_show) <=
                    GIMP_UI_WINDOW_POSITION_EPSILON): (21 <= 10)

so appearently we need to be more liberal.
2010-09-12 18:37:00 +02:00
Martin Nordholts fa6eb03fb2 app/tests: Add 'paintbrush_is_standard_tool' regression test
Add 'paintbrush_is_standard_tool' regression test to prevent bug
624177 from happening again.
2010-08-26 19:05:57 +02:00
Martin Nordholts 3a447213a9 app/tests: Add layer group regression testing for XCF write and read 2010-08-21 11:14:20 +02:00
Martin Nordholts 81925e424b app/tests: Prepare test-core.c for other tests 2010-06-29 19:08:59 +02:00
Martin Nordholts dd059635d4 app/tests: Rename test-layers to test-core
Rename test-layers to test-core so we can put more tests there, like
color processing algorithm tests for example.
2010-06-29 18:08:34 +02:00
Martin Nordholts 706900c4f6 Bug 589010 - Don't make Alt-Clicked layers active
Add a "pre-clicked" signal to GimpCellRendererViewable that can
prevent a selection from happening. Move the Alt-Click code in
GimpLayerTreeView to this signal and if a layer is Alt-Clicked, don't
go ahead and make the layer active. Also add a test for this use case.
2010-06-27 21:46:53 +02:00
Martin Nordholts 66e2866a78 app/tests: Make "create_new_image_via_dialog" result more useful
Also add a layer in "create_new_image_via_dialog" so the created
image is more useful in following tests.
2010-06-27 13:37:41 +02:00
Martin Nordholts d8f8acdff3 app/tests: Add convenience macro GIMP_PAUSE() 2010-06-27 13:30:06 +02:00
Martin Nordholts 1a9eb3e923 app/tests: Use gtk_test_init() 2010-06-27 11:08:42 +02:00
Martin Nordholts 8d0fe6fc4a app/tests: Output session management test result
Output session management test result to be consistent with GLib test
framework test output.
2010-06-27 10:47:30 +02:00
Martin Nordholts bbfb4b13df app/tests: Add "gimp-single-image-window" entry to sessionrc
Add "gimp-single-image-window" entry to sessionrc. Makes the UI test
behave a bit more nicely.
2010-06-27 10:43:58 +02:00
Martin Nordholts a5c0d74599 app/tests: Merge some tests
Remove two GIMP initializations by putting
"gimp-window-management/window_roles" into "gimp-ui" and removing
"gimp-layer-groups/add_layer" which we already have in
"gimp-layers". And we can have layer group tests there too.
2010-06-27 10:40:55 +02:00
Martin Nordholts 7670ae7e87 app/tests: Add alt_click_is_layer_to_selection
Add a regression test that makes sure its possible to Alt-Click on a
layer in the layers dockable to create a selection from it.

Change sessionrc to have only one page in the GimpDockbook to
avoid problems with gtk_test_find_widget().
2010-06-27 10:40:55 +02:00
Martin Nordholts 1c72e5e406 app/tests: Make gimp_ui_find_dock_window() more generic 2010-06-27 10:40:55 +02:00
Martin Nordholts f6781d15c4 Bug 565459 - newly opened images are put into the background
When we are going to open new image windows, unset the transient
window. We don't need it since we will use gdk_window_raise() to
keep the dialog on top. And if we don't do it, then the dialog
will pull the image window it was invoked from on top of all the
new opened image windows, and we don't want that to happen.

Patch heavily inspiried by hack from Massimo Valentini.

Also add a manual test case for the fix. (I don't think there is GTK+
API to automate it).
2010-06-23 20:17:44 +02:00
Martin Nordholts f0e90007f7 app/tests: Remove gimp_ui_synthesize_plus_key_event() crack
Make gimp_ui_synthesize_plus_key_event() generic and implement it with
gdk_test_simulate_key(). We can't use gtk_test_widget_send_key()
because its input window logic doesn't seem to work very well.
2010-06-21 21:19:15 +02:00
Martin Nordholts df731fecda Make 'make distcheck' pass
Add missing CLEANFILES, make distcheck passes now.
2010-06-20 20:30:24 +02:00
Martin Nordholts ce33255588 app/tests: Also add error margin to 'gimpsessioninfo-book.c'
Also add error margin to 'gimpsessioninfo-book.c' and update reference
files. This makes 'make distcheck' pass, and it passes more reliably.
2010-06-20 20:30:24 +02:00
Michael Natterer ba3d530c9b tests: fix the directory variables in TESTS_ENVIRONMENT
Apparently, $(abs_top_srcdir) and $(abs_top_builddir) aren't set as
shell variables any longer. Instead, use @abs_top_srcdir@ and
@abs_top_builddir@ so they get substituted at configure time.
2010-06-20 12:25:32 +02:00
Martin Nordholts 49d951d49e app: Introduce error margin in sessionrc in test cases
Introduce a few pixels of error margin in sessionrc, otherwise the
tests are too fragile, widgets have a tendency to change size a bit
and window managers have a tendency to move windows a bit.

Still needs more work, should probably do the same on book positions
too...
2010-06-19 23:55:35 +02:00
Martin Nordholts 4e78fc7279 Also distribute dockrc-expected 2010-06-19 23:55:35 +02:00
Martin Nordholts 1e6055060c app/tests: Also simply test-xcf.c
Simply test-xcf.c too, forgot to do that.
2010-06-19 08:26:30 +02:00
Martin Nordholts 7e3898da09 app/tests: Add keyboard zoom focus regression test
Add keyboard zoom focus regression test. We also need a new display
shell utility function
gimp_display_shell_push_zoom_focus_pointer_pos() for that.
2010-06-18 20:57:59 +02:00
Martin Nordholts 3f6a3e749c app/tests: cleanup 2010-06-18 20:31:33 +02:00
Martin Nordholts 782ba9bcb9 app/tests: Make it easier to add tests
Minimize the effort to add a new test by removing prototypes for tests
and adding macros to register tests.
2010-06-14 18:53:38 +02:00
Martin Nordholts 6812d5bdce Bug 346881 - Remove redundant title of tab and move menu button up
Remove the dockable drag handle and move the menu button it hosts up
to the GimpDockbook, with the gtk_notebook_set_action_widget() API.

This frees up quite a lot of screen estate which can be used for the
content of dockables instead.
2010-06-12 01:24:39 +02:00
Martin Nordholts 9b86acd16b Add 'Automatic' Tab Style support
Add support for a new type of Tab Style called 'Automatic'. This tab
style makes the GimpDockbook use the biggest actual tab style it can
for its auto tab style dockables, based on its widget allocation.

The tab style candidates for auto tab style are "Status + Blurb",
"Status + Text" and "Status". A docked widget can also say that it
wants to use "Icon" instead of "Status" for its auto tab style. The
'Tool Options' dockable does this. This is to be as backwards
compatible with the old tab style setup, we make 'automatic' the
default everywhere.

We have quite a bit of dependency to internal layout code in
GtkNotebook, but the current code should be pixel perfect and rather
complete.

Also add a basic regression test.
2010-06-12 01:23:42 +02:00
Martin Nordholts c67a8c7546 app/tests: Don't have toolbox in sessionrc in session-management test
Enable it again when we have a way to handle that the toolbox size is
likely to change due to the use of GDK_HINT_RESIZE_INC.
2010-05-29 15:46:38 +02:00
Martin Nordholts d7dc2dc1ab app: Make tooltips in the toolbox work again
We need to be able to pass a GimpUIManager to
gimp_dialog_factory_dialog_new(), so make that possible. Also make
sure to set ui_manager in gimp_dialog_factory_dialog_new_internal()
when we create both a dock window and a dock, so tooltips works in
toolboxes created from scratch.
2010-05-16 12:19:18 +02:00
Martin Nordholts 7b8352bfa0 app/tests: Make test that closes dock window use multi-column variant
Make test that closes dock window use multi-column variant so it
catches a bunch of warnings that occurs when closing multi-column dock
windows.
2010-03-07 09:00:08 +01:00
Martin Nordholts bdfbddd5e8 app/tests: Generalize gimp_ui_find_non_toolbox_dock_window()
Generalize gimp_ui_find_non_toolbox_dock_window() by renaming it to
gimp_ui_find_dock_window() and adding a parameter with a function that
will be used to find the toolbox.
2010-03-07 08:55:18 +01:00
Martin Nordholts 11b1300b6f app: Introduce gimp_dialog_factory_get_singleton()
Instead of including dialogs/dialogs.h everywhere, introduce
gimp_dialog_factory_get_singleton(). The dialog factory singleton is
still initialized by dialogs.c though.

Right now the assumption is that we never will have another dialog
factory instance around. There were so many problems before when we
had four of them, so let's just keep one of them around.
2010-02-28 23:23:24 +01:00
Martin Nordholts 82c52974e2 app/tests: Don't exit before test-xcf.c tests are run 2010-02-28 23:23:23 +01:00
Martin Nordholts 947e28596f app: Remove gimp_dialog_factory_from_name()
We only have one dialog factory now, and
gimp_dialog_factory_from_name() doesn't provide compile-time type
safety, so use global_dialog_factory directly instead.
2010-02-28 20:02:45 +01:00
Martin Nordholts 18f3be6bd3 Bug 602223 - Can't hide docks with Tab in single-window mode
Add a "hide-docks" config and connect the Windows->Hide docks menu
item to it. Also connect the image window to the config property so it
can hide/show its docks when it needs to.

Also add and use a utility function
gimp_image_window_keep_canvas_pos() to ensure that the image in the
window remains fixed when toggling visiblity of docks. One problem:
When GimpDrawTool is active on the canvas, there is flicker. The end
position is correct though.

Also add regression testing for this fix to test-ui.c
2010-02-24 19:53:48 +01:00
Martin Nordholts 82b2e2cff5 app/tests: Update test-ui.c, gimp_dialog_factories_toggle() is removed 2010-02-24 19:53:48 +01:00
Martin Nordholts 1e9048ded9 app: Turn gimp_dialog_factory_dock_with_window_new() into util func
Turn gimp_dialog_factory_dock_with_window_new() into a utility
function, it doesn't make sense to let it be part of the generic
GimpDialogFactory.
2010-02-20 16:55:59 +01:00
Martin Nordholts ea6efc3885 app: Make Recently Used Docks work with GIMP 2.6 dockrc files
In GIMP 2.6 dockrc did not contain the factory entries for the session
infos, so set that up manually if needed. Also take the opportunity to
add a copyright notice to dialogs.c since tha file is almost rewritten
by now...
2010-02-20 13:05:16 +01:00
Martin Nordholts dec798e0df app: Serialize factory entry name along with GimpSessionInfo
Serialize factory entry name along with GimpSessionInfo so we can make
the Recently Closed Docks feature work across sessions in a natural
way.
2010-02-20 13:05:16 +01:00
Martin Nordholts 1d120d9b02 app/tests: Improve test-session-management.c output
Don't bail out if sessionrc fails, report result for dockrc too. And
change system() to g_spawn_sync().
2010-02-20 13:05:16 +01:00
Martin Nordholts c3619fb85c app: Merge "toplevel" and "display" factories
Merge "toplevel" and "display" factories so that we only have one
dialog factory. This allows us to get rid of a lot of special casing.
2010-02-20 10:58:29 +01:00
Martin Nordholts 8b458fb591 app: Merge "toplevel" and "dock" dialog factories
Merge "toplevel" and "dock" dialog factories. The end goal is to have
only one dialog factory.
2010-02-20 09:28:26 +01:00
Sven Neumann 3c63462e43 app: always use snprintf(), even in tests 2010-02-19 19:30:55 +01:00
Martin Nordholts 3545bafc41 app/tests: When session management test fails, use system() to say why 2010-02-18 21:49:34 +01:00
Martin Nordholts b081d91370 app/tests: Add regression test for hide/show of dock windows
Add regression test for hide/show of dock windows that makes sure that
dock window positions are kept after a hide/show cycle. Also introduce
a helper function gimp_ui_find_non_toolbox_dock_window().
2010-02-18 07:25:07 +01:00
Martin Nordholts 33d66f5c7e app/tests: Add regression test for Recently Closed Docks
Add a simple regression test for Windows → Recently Closed Docks.
2010-02-13 20:10:40 +01:00
Martin Nordholts 5093109122 app: Fix gimp_ui_get_ui_manager() to allow arbitrary test exec order
Make gimp_ui_get_ui_manager() in test-ui.c handle when there is no
empty display so we can put the new-image test before the
single-window mode tests. We want the single-window mode tests lasts
because they are so flickery.
2010-02-13 20:10:40 +01:00
Martin Nordholts 1438b9b31c app/tests: Make sessionrc more realistic
GIMP 2.6 can't have a toolbox top-level with an empty dock, remove the
dock. This gives us a more realistic test.
2010-01-31 19:04:51 +01:00
Martin Nordholts f77c400957 app/tests: Generalize gimp_test_utils_set_gimp2_directory()
Support both builddir and srcdir with
gimp_test_utils_set_gimp2_directory() so we can have gimpdir-output in
the build dir.
2010-01-30 08:07:24 +01:00
Martin Nordholts 97bbde6e5b app/tests: Distribute sessionrc-expected 2010-01-30 08:06:09 +01:00
Martin Nordholts 985f2ae093 app/tests: Create gimpdir-output properly
The rule check-local is run after the tests themselves are run, so
make the tests depend on this directory to be created instead.
2010-01-30 08:06:09 +01:00
Martin Nordholts 3612ef2d76 app: Have separate output gimpdir for test cases
Make our test cases write gimpdir files in a dedicate output directory
by changing GIMP2_DIRECTORY at runtime. This ends the writing to the
source directory which make distcheck doesn't like, and it also allows
us to have a separate expected sessionrc for the session management
test. In that test we load a GIMP 2.6 formated sessionrc but write one
updated for 2.8.

We perform this change by passing the builddir through an environment
variable to the test cases. The patch also does some generalizations
in gimp-app-test-utils.c and adapts test cases accordingly.

Also do an adjustment in sessionrc on the toolbox size since
GIMP/GTK+/X/whatever has a tendency to adjust that during runs. The
new size is stable for the moment.
2010-01-29 18:33:22 +01:00
Martin Nordholts 1093462ae9 app: Merge 'global_toolbox_factory' into 'global_dock_factory'
Get rid of 'global_toolbox_factory' and manage everything dock-related
with 'global_dock_factory'. The whole of 'global_toolbox_factory' was
a big special-case and getting rid of it makes it easier to extend the
session management with e.g. single-window mode dock functionality.

To get rid of 'global_toolbox_factory' we, roughly, have to
 * Replace 'global_toolbox_factory' with 'global_dock_factory'
   everywhere. We can also get rid of lots of code that did special
   things for the "toolbox" factory.
 * Make the use or interaction with the toolbox explicit in some
   places. For example, a function gimp_dock_window_has_toolbox() has
   been introduced.
 * Make GimpSessionInfoDock have an 'identifier' parameter so we can
   differentiate between the "gimp-dock" and "gimp-toolbox" dock
   types.
2010-01-20 18:29:54 +01:00
Martin Nordholts 66197c5d11 app: global_dock_window_factory -> global_dock_factory
Rename back global_dock_window_factory to
global_dock_factory. Renaming to global_dock_window_factory was done
under the assumption that there would be a separate factory that would
create non-toplevel dockables, but I don't expect this to happen in
the forseeable future.
2010-01-19 22:40:06 +01:00
Martin Nordholts 8c10d1c451 app/tests: Add simple tests to switch to and from single-window mode 2010-01-17 10:43:16 +01:00
Martin Nordholts 0e9f434277 app/tests: Explain why gimp_test_utils_get_source_subdir() might fail 2010-01-16 23:51:23 +01:00
Martin Nordholts f8060aed27 app/tests: Add "/gimp-ui/create-new-image-via-dialog" test
Add a test to create a new image via the new image dialog that would
have caught the regression fixed by:
db2221c9 "app: Fix gimp_dialog_factory_constructor()".
2010-01-16 23:05:18 +01:00
Martin Nordholts a259d46716 app/tests: Add "gimp-image-new-dialog" to sessionrc
Add "gimp-image-new-dialog" to sessionrc so we can have tests with
this dialog without sessionrc changing.
2010-01-16 21:47:36 +01:00
Martin Nordholts e87c77bcfc app: Allow tests to override the menus directory
In order to let tests run against the source dir, allow them to
override the menus directory. Add utility functions for this and
adjust gimpuimanager.c accordingly.
2010-01-08 15:05:15 +01:00
Martin Nordholts 33e8b08f12 app/tests: Distribute test files and test directories 2010-01-08 13:37:25 +01:00
Martin Nordholts 86e14c2c2f app/tests: Add a GIMP 2.8 XCF feature test template
Add template code for writing a test that makes sure GIMP 2.8 images
do not lose information when written to a file and loaded again, in
hope that mitch will fill in the rest ;)
2010-01-02 23:30:14 +01:00
Martin Nordholts 19183f81b2 app/tests: Test loading of an XCF file created with GIMP 2.6
Do a basic regression test on being able to load XCF files created
with GIMP 2.6. To add things to this file, add things to
gimp_write_and_read_file() and run the code in GIMP 2.6.

Also add a file-local helper function gimp_test_load_image().
2010-01-02 23:16:55 +01:00
Martin Nordholts f86f9e2adf app/tests: Sort TESTS in Makefile.am 2010-01-02 23:10:54 +01:00
Martin Nordholts 745d2dbf76 app/tests: Add a "gimp-comment" with an explanation of the file
Make it clear that the file is created from pure code execution and
not graphically with GIMP.
2010-01-02 23:09:21 +01:00
Martin Nordholts 0724959b61 app/tests: Make channel same size as image in XCF test
In order to avoid crashes when rending the image, make the channel the
same size as the image.
2010-01-02 23:06:57 +01:00
Martin Nordholts c380512ce1 Revert "app: Add gimp_vectors_get_stroke()"
This reverts commit 2d2b6f03c5 and
adapts the code. We can use gimp_vectors_stroke_get_next (vectors,
NULL) instead of gimp_vectors_get_stroke (vectors, 0). Thanks to nomis
for pointing this out.
2010-01-02 20:20:10 +01:00
Martin Nordholts 3e81e87bca app/tests: Improve code coverage and test names in XCF test
Add another layer, a channel, a selection and two vectors to the test
image. Parameterize the image construction so we can create different
variants of test images, and add a test for an "unusual" GimpImage,
which is an image with compatible vectors and with a floating
selection. The test are renamed to something with "GIMP 2.6" to
emphasize that the tests work with files that might as well have been
constructed with GIMP 2.6. Also adjust the list of things that should
be tested, but that isn't tested yet.

FWIW, using the GNU gcc gcov tool it can be seen that xcf-load.c now
has a code coverage of 67.04% of 722 lines.
2010-01-02 18:55:44 +01:00
Michael Natterer a58e7ee918 app: add .libs to .gitignore 2009-12-30 15:22:35 +01:00
Martin Nordholts 14ca90ac2f app/tests: Clean up test-ui.c a bit 2009-12-28 11:00:40 +01:00
Sven Neumann a3a8cf16c0 add libgimpapptestutils.a to .gitignore 2009-12-27 19:47:14 +01:00
Martin Nordholts 780ebd7c24 app/tests: Fix warnings about files not existing
Let each test sets GIMP2_DIRECTORY on their own through the help of a
new test utility function gimp_test_utils_set_gimp2_directory() that
is compiled into its own lib which tests are then linked with. Also,
instead of using "/tmp/gimpdir", we use "gimpdir-empty" in the source
dir. This way we get rid of a bunch of annoying warnings when running
the tests and have more control.
2009-12-24 23:01:48 +01:00
Martin Nordholts 47709fab18 app/tests: Use implicit _SOURCES 2009-12-24 18:54:11 +01:00
Martin Nordholts 999fb38164 app/tests: Create brushes, gradients and patterns dirs in gimpdir
Create brushes, gradients and patterns dirs in gimpdir to get rid of
warnings for those dirs not existing.
2009-12-24 18:15:43 +01:00