Commit graph

49 commits

Author SHA1 Message Date
Adrien Plazas
555ef00b18 network: Use a HdyColumn
This allows the window to reach narrower sizes.
2019-09-09 22:25:23 +00:00
Robert Ancell
b02a49cfc6 info: Rename info panel to info-overview for consistency 2019-09-09 21:52:08 +00:00
Ting-Wei Lan
299647f970 build: Include generated sources in declared dependencies
Sometimes ninja decides to compile tests/interactive-panels/main.c,
which requires shell/resources.h, before shell/resources.h is generated.

The fix is to use 'sources' argument of declare_dependency to properly
declare the dependency on generated headers.

A fix for tests/datetime and panels/datetime is also included in the
commit to fix a similar problem.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/472
2019-08-25 09:42:22 +00:00
Georges Basile Stavracas Neto
597dc3d8ac
project: Disable datetime test 2019-08-08 22:43:23 -03:00
Georges Basile Stavracas Neto
75f150d5a2 shell: Add position to cc_shell_embed_widget_in_header()
So we can control where the widget should be added to. The
main window only supports left and right positions.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 12:59:36 -03:00
Benjamin Berg
3cbe926f46 tests: Disable ATK as it is currently creating issues 2018-12-07 15:49:13 +01:00
Georges Basile Stavracas Neto
896ff73c2b
tests: Add test panels for sidebar widget
Two tests for sidebar widget were added: one at the main
sidebar view, the other inside the Details category.
2018-11-16 19:25:13 -02:00
Georges Basile Stavracas Neto
fdf22ad255
tests: Properly generate desktop files 2018-11-16 19:25:13 -02:00
Benjamin Berg
1ab42b4ec5 tests: Ensure generated function have a __qualname__ attribute
This is solely used for filtering by unittest, however, if it is
missing, then unittest will fail. So generate a reasonable name (which
is unfortunately not identical to the real name of the attribute).
2018-11-13 02:32:28 +01:00
Piotr Drąg
99f73303e8 tests: Remove translatable attributes from .ui files 2018-11-12 15:59:23 +01:00
Benjamin Berg
127fb4d75b Revert "tests: Temporarily disable Python tests"
The python based tests are working again. Re-enable them so that they
get run by the CI.

This reverts commit 2f44c441ff.
2018-11-12 11:27:10 +01:00
Georges Basile Stavracas Neto
65ede4f409
Introduce interactive test for panels
The purpose of this interactive test is to be able to
prototype new features for CcPanel without having to
adapt existing panels.

Three test panels were added as part of this initial
patch:

 * Dynamic panels: panel exercising the ability to
   show and hide itself at runtime.
 * Header: panel that embeds a header widget.
 * Static Initializer: panel that sets a static init
   function to run at startup.
2018-11-11 23:46:19 -02:00
Georges Basile Stavracas Neto
2f44c441ff tests: Temporarily disable Python tests
They're broken on my computer, and Python does a really
terrible job at communicating why. So after 8 hours of
debugging, I decided this is just a lost battle to me
and not important enough.
2018-08-27 21:42:03 -03:00
RyuzakiKK
b8972e885c tests: free TzInfo
The timezone information is allocated with `tz_info_from_location` but
never deallocated.
LeakSanitizer complains about this memory leak.

```
Direct leak of 13568 byte(s) in 424 object(s) allocated from:
/build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:95
    #1 0x7f63899bab21 in g_malloc0 (/usr/lib/libglib-2.0.so.0+0x51b21)
../tests/datetime/test-timezone-gfx.c:30
    #3 0x7f63899dc76a  (/usr/lib/libglib-2.0.so.0+0x7376a)
```
2018-08-24 14:43:29 +00:00
RyuzakiKK
2b14ccdf86 tests: close opened directory
The directory opened with `g_dir_open` is never closed, so LeakSanitizer
complains about a memory leaks.

```
Direct leak of 8 byte(s) in 1 object(s) allocated from:
/build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:86
    #1 0x7f2012908ac9 in g_malloc (/usr/lib/libglib-2.0.so.0+0x51ac9)
    #2 0x7f2012922aac in g_memdup (/usr/lib/libglib-2.0.so.0+0x6baac)
    #3 0x7f20128ed2d5  (/usr/lib/libglib-2.0.so.0+0x362d5)
    #4 0x7f20128ed338 in g_dir_open (/usr/lib/libglib-2.0.so.0+0x36338)
../tests/datetime/test-endianess.c:29
    #6 0x7f201292a76a  (/usr/lib/libglib-2.0.so.0+0x7376a)
    #7 0x7f201292a69a  (/usr/lib/libglib-2.0.so.0+0x7369a)
(/usr/lib/libglib-2.0.so.0+0x73951)
    #9 0x7f201292a972 in g_test_run (/usr/lib/libglib-2.0.so.0+0x73972)
    #10 0x560ad630cbff in main ../tests/datetime/test-endianess.c:66
```
2018-08-24 14:43:29 +00:00
Ting-Wei Lan
9df14924d4 tests: Don't hard-code the path to python
Python isn't always installed in /usr/bin. If we hard-code the path,
these tests will fail on *BSD because they install python in different
prefixes such as /usr/local and /usr/pkg.
2018-08-13 01:18:16 +00:00
Claudio André
4f8a64ac25 tests: increase the tests timeout
This is only needed for non AMD64.
2018-07-15 01:47:24 +00:00
Robert Ancell
86d1d30c63 common: Use g_auto for variables 2018-06-07 01:08:07 +00:00
Benjamin Berg
e1e82ccda4 tests: Add VPN related tests
This adds tests for the VPN section. Note that the tests to check
sorting are disabled currently as sorting is not implemented.
2018-05-29 15:22:17 +02:00
Benjamin Berg
870b64b848 tests: Also wait for ConnectionAdded signal from NetworkManager
Also wait for the connection-added signal instead of only waiting for the
property notification for the connections. While not neccessary, this is
more correct.
2018-05-29 15:21:59 +02:00
Benjamin Berg
12555d62eb tests: Add helper to find a parent widget to network test
In preparation for testing VPN sorting. Looks for a parent of a specific
type.
2018-05-29 15:20:30 +02:00
Benjamin Berg
d45512d680 tests: Check that Bluetooth section is not shown
This simply ensure the section does not randomly show up after making
unrelated changes.
2018-05-29 15:20:15 +02:00
Benjamin Berg
ab59a8f658 tests: Use g_assert_nonnull rather than testing for != NULL
Just a small code cleanup in the network panel test code.
2018-05-29 15:20:04 +02:00
Benjamin Berg
4f3aec794e tests: Add delete_cb for network panel testing
Having a delete_cb to handle connection removal is useful for other
tests. Add the function in preparation for VPN testing.
2018-05-29 15:19:50 +02:00
Benjamin Berg
edc85abf91 tests: Return NMRemoteConnection from add_cb
The add_cb can be useful in other tests. Return the remote connection in
the info struct to allow its use in other situations.
2018-05-29 15:19:30 +02:00
Benjamin Berg
bfdd2e0a8f tests: Use the same NMClient as the panel
Doing so means we handle the same events as the panel. This probably
makes no difference, but this way it is guaranteed we are not getting
weird inconsistencies during testing.

Also fixes a NMClient memory leak in the process.
2018-05-29 15:19:22 +02:00
Benjamin Berg
b14e5145f0 tests: Improve helpers to wait for NM events
This adds support for waiting on an NMConnection object and also allows
waiting for both signals and properties.
2018-05-29 15:19:15 +02:00
Benjamin Berg
77edec52ed tests: Allow creating VPNs in the NM test service
This is in preparation for adding VPN related tests.
2018-05-29 15:19:00 +02:00
Benjamin Berg
7c43f95ef9 tests: Add trivial test to check empty network panel
If there are no connections or devices then we should not be showing
e.g. the Bluetooth list. Add a simple check that this is handled
correctly.
2018-05-29 15:17:50 +02:00
Benjamin Berg
f3322b495c tests: Do not show_all the network panel
This has the side effect of showing UI elements that should not be
visible at startup. Just add the correct gtk_widget_show calls to show
all relevant widgets.
2018-05-29 15:17:24 +02:00
Benjamin Berg
3950e66bd2 tests: Unset wayland display environment variable correctly
Otherwise the test might run on a develpers wayland session rather than
using the created X11 server.
2018-05-29 15:17:09 +02:00
Georges Basile Stavracas Neto
017643dbf9 ci: Reorganize files 2018-05-16 15:18:57 -03:00
Claudio André
f4433b3766 CI: print some info about the build env
It is not possible to debug if the developer knows nothing about
the CI running environment.
2018-05-14 19:39:45 -03:00
Ting-Wei Lan
949f8cb227 tests/network: Disable on non-Linux systems
NetworkManager is only available on Linux, so we cannot build or run the
network test on non-Linux systems.
2018-05-12 04:03:45 +00:00
Georges Basile Stavracas Neto
eea231dc1c tests: Run each datetime test under Xvfb
That way, gtk_init() cannot fail.
2018-05-09 18:52:48 -03:00
Georges Basile Stavracas Neto
8404f526b6 tests: Make logging verbose 2018-05-09 18:33:18 -03:00
Georges Basile Stavracas Neto
c23e8f3547 tests: Rework test-timezone-gfx 2018-05-09 18:33:18 -03:00
Georges Basile Stavracas Neto
0b854910bb tests: Rely only on zone.tab
First of all, this is a complete rewrite of the
timezone tests. Everything was revisited, starting
from code style, to concepts, etc.

The problem  with the previous timezone test was that
is was relying on listing the /usr/share/zoneinfo
directory, and assuming that those entries would be
always present.

Turns out, some of them are extensions, some of them
are undocumented files, etc. A huge mess. I could've
blacklisted the undesired files and folders, but that
would still be insufficient for other OSes like *BSDs
and Sun.

The final solution was pretty straightforward: only
use the information from zone.tab to run the tests.
2018-05-09 15:38:12 -03:00
Georges Basile Stavracas Neto
af0186aaf9 project: Update meson files
I probably have OCD. Seeing these files
with this poor alignment gives me physical
pain.
2018-05-03 00:45:29 -03:00
Benjamin Berg
f655e46ce7 tests/network: Add basic testing of network panel
This adds tests for the network panel based on the test service found in
NetworkManager. Another possible solution may be to use the one from
dbusmock, however NetworkManager already has readily available code to
write tests in C which makes checking the widget hierarchy easier.
2018-05-02 22:29:33 +00:00
Benjamin Berg
7630bf963e tests: Add helper for glib based test binaries
This makes running glib based tests inside a dbusmock environment easier
and more beautiful (i.e. output is supressed unless an error occurs).

This helper has been submitted for inclusion in dbusmock. If it cannot$
live there in some form, then we should try to find a home in the GNOME$
project for it.$
2018-05-02 22:29:33 +00:00
Benjamin Berg
8c9be792f2 tests: Add dbusmock helper starting X server and system/session busses
This helper has been submitted for inclusion in dbusmock. If it cannot
live there in some form, then we should try to find a home in the GNOME
project for it.
2018-05-02 22:29:32 +00:00
Benjamin Berg
466d91afd3 tests/network: Fix deprecation warning in NM test service
This just fixes a simple deprecation warning in the NetworkManager test
service.
2018-05-02 22:29:32 +00:00
Benjamin Berg
9bab137bb4 tests/network: Add status and carrier setting to NM test service
This adds a bit of new functionality to the test service to set the
status and reason for the status change as well as whether the carrier
is connected.
2018-05-02 22:29:32 +00:00
Benjamin Berg
2ebdb532cf tests/network: Copy files from network manager for network panel testing
This copies a number of files from network manager in preparation of
adding network panel tests.
2018-05-02 22:29:32 +00:00
Benjamin Berg
b15be07738 Move datetime tests into tests subdirectory 2018-04-17 15:26:59 +02:00
Benjamin Berg
3c76d52e8e Move info panel test to tests subdirectory 2018-04-17 15:26:59 +02:00
Benjamin Berg
a9d8ec5747 Move printers panel tests into tests folder 2018-04-17 15:26:59 +02:00
Benjamin Berg
d2d4980ce8 Move panel/common tests into new tests subdirectory 2018-04-17 15:26:59 +02:00