platform/test: split initialization of platform tests out

test-route-manager soon wants a different initialization

(cherry picked from commit 24288f713a)
This commit is contained in:
Thomas Haller 2015-03-26 12:01:03 +01:00
parent 643d412688
commit 3b014ddef8
6 changed files with 28 additions and 1 deletions

View file

@ -246,6 +246,12 @@ test_ip6_address_external (void)
free_signal (address_removed);
}
void
init_tests (int *argc, char ***argv)
{
nmtst_init_with_logging (argc, argv, NULL, "ALL");
}
void
setup_tests (void)
{

View file

@ -86,6 +86,12 @@ test_cleanup_internal (void)
g_array_unref (routes6);
}
void
init_tests (int *argc, char ***argv)
{
nmtst_init_with_logging (argc, argv, NULL, "ALL");
}
void
setup_tests (void)
{

View file

@ -255,7 +255,7 @@ main (int argc, char **argv)
int result;
const char *program = *argv;
nmtst_init_with_logging (&argc, &argv, NULL, "ALL");
init_tests (&argc, &argv);
NM_PRAGMA_WARNING_DISABLE("-Wtautological-compare")
if (SETUP == nm_linux_platform_setup && getuid() != 0) {

View file

@ -9,6 +9,8 @@
#include "nm-fake-platform.h"
#include "nm-linux-platform.h"
#include "nm-test-utils.h"
#define DEVICE_NAME "nm-test-device"
#define debug(...) nm_log_dbg (LOGD_PLATFORM, __VA_ARGS__)
@ -43,5 +45,6 @@ void link_callback (NMPlatform *platform, int ifindex, NMPlatformLink *received,
void run_command (const char *format, ...);
void init_tests (int *argc, char ***argv);
void setup_tests (void);

View file

@ -539,6 +539,12 @@ test_external (void)
free_signal (link_removed);
}
void
init_tests (int *argc, char ***argv)
{
nmtst_init_with_logging (argc, argv, NULL, "ALL");
}
void
setup_tests (void)
{

View file

@ -311,6 +311,12 @@ test_ip6_route (void)
free_signal (route_removed);
}
void
init_tests (int *argc, char ***argv)
{
nmtst_init_with_logging (argc, argv, NULL, "ALL");
}
void
setup_tests (void)
{