Age | Commit message (Collapse) | Author | Files | Lines |
|
There are multiple tests with the same in different directories; add a
unique prefix to test names so that it is clear from the output which
one is running.
|
|
Some tests were disabled because they failed when run in parallel.
Now that we use the wrapper script they succeed and can be enabled
again.
|
|
Like autotools, use the wrapper script 'run-nm-test.sh' that starts a
separate D-Bus session when needed.
|
|
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
https://bugzilla.gnome.org/show_bug.cgi?id=744250
|
|
If an operation is cancelled through the GCancellable, then the idiom is
that the operation is always cancelled, even if it has finished
successfully. To ensure this is the case, add calls to
g_simple_async_result_set_check_cancellable everywhere.
Without this, e.g. gnome-control-center will crash when switching away
from the power panel quickly, as the NMClient creation finishes
asynchronously and g-c-c assume that G_IO_ERROR_CANCELLED is returned to
ensure it doesn't access the now invalid user_data parameter.
https://bugzilla.gnome.org/show_bug.cgi?id=794088
|
|
GCC 8.0's -Wcast-function-type objects casting function pointers to ones
with incompatible prototypes. Sometimes we do that on purpose though.
Notably, the g_source_set_callback()'s func argument can point to functions
of various prototypes. Also, libnm-glib/nm-remote-connection is perhaps
just not worth reworking, that would just be a waste of time.
A cast to void(*)(void) avoids the GCC warning, let's use it.
|
|
This makes GCC 8.0 unhappy and it is probably right about that -- it's more
difficult to get things wrong when the function prototypes actually match.
|
|
|
|
We commonly only allow tabs at the beginning of a line, not
afterwards. The reason for this style is so that the code
looks formated right with tabstop=4 and tabstop=8.
|
|
RHEL 7.1 and Ubuntu 14.04 LTS both have this.
https://bugzilla.gnome.org/show_bug.cgi?id=792323
|
|
|
|
The following symbols are missing from the libnm-glib library:
* libnm_glib_get_network_state
* libnm_glib_init
* libnm_glib_register_callback
* libnm_glib_shutdown
* libnm_glib_unregister_callback
This has been changed by linking `libdeprecated_nm_glib` as a whole.
https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00056.html
|
|
|
|
We also unconditionally use them with autotools.
Also, the detection for have_version_script does
not seem correct to me. At least, it didn't work
with clang.
|
|
I think it's because meson doesn't run the tests in their
own D-Bus session, hence the use the system service.
automake solves this running all tests via ./tools/run-nm-test.sh,
which knows how to prepare a suitable environment for the tests.
|
|
The strings holding the names used for libraries have also been
moved to different variables. This way they would be less error
as these variables can be reused easily and any typing error
would be quickly detected.
|
|
Some targets are missing dependencies on some generated sources in
the meson port. These makes the build to fail due to missing source
files on a highly parallelized build.
These dependencies have been resolved by taking advantage of meson's
internal dependencies which can be used to pass source files,
include directories, libraries and compiler flags.
One of such internal dependencies called `core_dep` was already in
use. However, in order to avoid any confusion with another new
internal dependency called `nm_core_dep`, which is used to include
directories and source files from the `libnm-core` directory, the
`core_dep` dependency has been renamed to `nm_dep`.
These changes have allowed minimizing the build details which are
inherited by using those dependencies. The parallelized build has
also been improved.
|
|
Note that:
- we compile some source files multiple times. Most notably those
under "shared/".
- we include a default header "shared/nm-default.h" in every source
file. This header is supposed to setup a common environment by defining
and including parts that are commonly used. As we always include the
same header, the header must behave differently depending
one whether the compilation is for libnm-core, NetworkManager or
libnm-glib. E.g. it must include <glib/gi18n.h> or <glib/gi18n-lib.h>
depending on whether we compile a library or an application.
For that, the source files need the NETWORKMANAGER_COMPILATION #define
to behave accordingly.
Extend the define to be composed of flags. These flags are all named
NM_NETWORKMANAGER_COMPILATION_WITH_*, they indicate which part of the
build are available. E.g. when building libnm-core.la itself, then
WITH_LIBNM_CORE, WITH_LIBNM_CORE_INTERNAL, and WITH_LIBNM_CORE_PRIVATE
are available. When building NetworkManager, WITH_LIBNM_CORE_PRIVATE
is not available but the internal parts are still accessible. When
building nmcli, only WITH_LIBNM_CORE (the public part) is available.
This granularily controls the build.
|
|
The install directories of those targets that match the default
install directories have been removed because they are redundant.
This also allows a simple meson build files and it is unnecessary
to create some paths.
https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00078.html
|
|
Source files for enum types are generated by passing segments of the
source code of the files to the `glib-mkenums` command.
This patch removes those parameters where source code is used from
meson build files by moving those segmeents to template files.
https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00057.html
|
|
There are some tests located in different directories which are
using the same name. To avoid any confussion a prefix was used to
name the test and the target.
This patch uses the prefix just for the target, to avoid any
collision that may happen, and uses the `test-` pattern as the
name.
https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00051.html
|
|
meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.
[thaller@redhat.com: rebased patch and adjusted for iwd support]
https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00022.html
|
|
When building with assertions, they nm_assert() for the
type. Otherwise, they are identical to a C cast.
Also, where possible, don't cast at all, but adjust
the type instead.
Also, there were a few missing casts.
|
|
This fixes the build with related bug https://bugzilla.gnome.org/show_bug.cgi?id=790697
https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00005.html
|
|
GHashTable optimizes a NULL equality function to use direct pointer
comparison. That saves the overhead of calling g_direct_equal().
This is also documented behavior for g_hash_table_new().
While at it, also don't pass g_direct_hash() but use the default
of %NULL. The behavior is the same, but consistently don't use
g_direct_hash().
|
|
https://bugzilla.gnome.org/show_bug.cgi?id=783173
|
|
It's perfectly valid to call the function with out_connection == NULL
when connection_hash == NULL too, as cancel_get_secrets() does.
Fixes: fbb1662269e3c47fa51abfe37d1f3c8f0a213bd0
(cherry picked from commit c4a0002f05fd0f57091b95646f1c9064e208ea66)
|
|
Suppress warnings and avoid assertions in
nm_access_point_connection_valid().
https://bugzilla.gnome.org/show_bug.cgi?id=773675
|
|
DRY.
|
|
libgudev is just a wrapper around libudev. We can
use libudev directly and drop the dependency for
libgudev.
|
|
Fixes: f7b1b2820245aff26da0c2c946b55752e91112e5
|
|
In practice, this should only matter when there are multiple
header files with the same name. That is something we try
to avoid already, by giving headers a distinct name.
When building NetworkManager itself, we clearly want to use
double-quotes for including our own headers.
But we also want to do that in our public headers. For example:
./a.c
#include <stdio.h>
#include <nm-1.h>
void main() {
printf ("INCLUDED %s/nm-2.h\n", SYMB);
}
./1/nm-1.h
#include <nm-2.h>
./1/nm-2.h
#define SYMB "1"
./2/nm-2.h
#define SYMB "2"
$ cc -I./2 -I./1 ./a.c
$ ./a.out
INCLUDED 2/nm-2.h
Exceptions to this are
- headers in "shared/nm-utils" that include <NetworkManager.h>. These
headers are copied into projects and hence used like headers owned by
those projects.
- examples/C
|
|
Unify marking GObject properties that are G_PARAM_CONSTRUCT_ONLY
with a comment
/* construct-only */
|
|
If no D-Bus connection is provided to the constructor of an NMObject, a
default one will be assigned in set_property(). However, construction of
that default D-Bus connection might fail (if our connection to the
system bus is refused, for example), so priv->connection might still be
NULL. This will cause the constructor to fail construction of the
NMObject, which is correct, but hard to debug.
Instead, move the default D-Bus connection handling into the
constructor, so all the (priv->connection == NULL) handling is in the
same place. Print out any error message.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://bugzilla.gnome.org/show_bug.cgi?id=778610
|
|
To validate the connection and path for NmObject subclass instances.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://bugzilla.gnome.org/show_bug.cgi?id=778610
|
|
libnm-glib/nm-object-private.h:28: Warning: NMClient: symbol='PropertyMarshalFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:28: Warning: NMClient: symbol='PropertyMarshalFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:28: Warning: NMClient: symbol='PropertyMarshalFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:28: Warning: NMClient: symbol='PropertyMarshalFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:82: Warning: NMClient: symbol='NMObjectTypeFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:82: Warning: NMClient: symbol='NMObjectTypeFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:83: Warning: NMClient: symbol='NMObjectTypeCallbackFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:83: Warning: NMClient: symbol='NMObjectTypeCallbackFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:84: Warning: NMClient: symbol='NMObjectTypeAsyncFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:84: Warning: NMClient: symbol='NMObjectTypeAsyncFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:84: Warning: NMClient: symbol='NMObjectTypeAsyncFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:84: Warning: NMClient: symbol='NMObjectTypeAsyncFunc': missing parameter name; undocumentable
|
|
...so that we don't have to fix the following:
libnm-glib/nm-object-private.h:30: Warning: NMClient: symbol='NMObjectCreatorFunc': missing parameter name; undocumentable
libnm-glib/nm-object-private.h:30: Warning: NMClient: symbol='NMObjectCreatorFunc': missing parameter name; undocumentable
Fixes: ad5daa098c308ae58a6d54c453c73451044598fc
|
|
|
|
|
|
|
|
"run-nm-test.sh"
No need to have two test-runners. Combine them, and call tests always
via "tools/run-nm-test.sh".
Yes, this brings an overhead, that we now always invoke the test with
a test wrapper script, also --without-vagrind. Previously, that was only
necessary for libnm tests that require their own D-Bus session.
Later we will do non-recursive Makefiles, thus all tests should have the
same LOG_COMPILER.
|
|
|
|
We should enable tests by default, probably we even should drop
the configure flags to enable tests and just always build them.
Anyway, at this point there is no use in guarding check-local
with a check for ENABLE_TESTS. A user who does't want to run
the tests, should just not call `make check`.
|
|
sed 's#^/\*\{5\}\*\+/$#/*****************************************************************************/#' $(git grep -l '\*\{5\}' | grep '\.[hc]$') -i
|
|
- don't include "nm-default.h" in header files. Every source file must
include as first header "nm-default.h", thus our headers get the
default include already implicitly.
- we don't support compiling NetworkManager itself with a C++ compiler. Remove
G_BEGIN_DECLS/G_END_DECLS from internal headers. We do however support
users of libnm to use C++, thus they stay in public headers.
(cherry picked from commit f19aff89095ca192b8b2e37534b7a899aecd82f9)
|
|
|
|
Fixes: a52d4654ec4d3afbbb0ef70ada55f4a5ddac92db
|
|
Abuse the 'name' property for this, for now, so we don't have to grab
a free slot from NMDeviceClass.
https://bugzilla.gnome.org/show_bug.cgi?id=592819
|
|
This adds two new options to the configure scripts to compile NM,
clients and libraries with the address and undefined-behavior
sanitizers available in recent GCC versions. Clang is not supported at
moment.
|
|
|