From c7845d1878aebb13a4eee11d9fd8bcf790257613 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 7 Sep 2017 12:37:46 -0300 Subject: [PATCH] tests: add initial test suite --- meson.build | 1 + tests/meson.build | 17 +++++++++++++++ tests/test-manager.c | 49 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 tests/meson.build create mode 100644 tests/test-manager.c diff --git a/meson.build b/meson.build index 40ff784c..51129216 100644 --- a/meson.build +++ b/meson.build @@ -201,6 +201,7 @@ subdir('contrib') subdir('data') subdir('src') subdir('po') +subdir('tests') if enable_gtk_doc subdir('doc/reference') diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 00000000..c35fe37c --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,17 @@ +test_incs = [ + include_directories('.'), + src_inc +] + +########### +# Manager # +########### + +test_manager = executable( + 'test-manager', + 'test-manager.c', + dependencies: calendar_deps, + include_directories: test_incs +) + +test('test-manager', test_manager) diff --git a/tests/test-manager.c b/tests/test-manager.c new file mode 100644 index 00000000..5aa9d11b --- /dev/null +++ b/tests/test-manager.c @@ -0,0 +1,49 @@ +/* test-manager.c + * + * Copyright (C) 2017 Georges Basile Stavracas Neto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include + +#include "gcal-manager.h" + +/*********************************************************************************************************************/ + +static void +manager_new_with_settings (void) +{ + g_autoptr (GcalManager) manager; + g_autoptr (GSettings) settings; + + settings = g_settings_new ("org.gnome.calendar"); + manager = gcal_manager_new_with_settings (settings); + + g_assert_nonnull (manager); +} + +/*********************************************************************************************************************/ + +gint +main (gint argc, + gchar *argv[]) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/manager/new_with_settings", manager_new_with_settings); + + return g_test_run (); +} +