talkatu/talkatu

Some CI fixes/updates

2020-09-21, Gary Kramlich
b8f1e12f028f
Some CI fixes/updates

Add fedora-33-amd64 as a build target

Use the meson macros in talkatu.spec.in rather than running it manually.

Testing Done:
Successfully ran the build for `fedora-31-amd64` and `fedora-32-amd64` but `fedora-33-amd64` and `fedora-rawhide-amd64` are failing with the `c compiler can't build executables` error I'm still working on figuring out.

Reviewed at https://reviews.imfreedom.org/r/123/
/*
* talkatu
* Copyright (C) 2017-2019 Gary Kramlich <grim@reaperworld.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <talkatu.h>
static void
talkatu_test_action_group_activate_simple(void) {
GtkTextBuffer *buffer = talkatu_whole_buffer_new();
GSimpleActionGroup *ag = talkatu_buffer_get_action_group(TALKATU_BUFFER(buffer));
gchar **activated = NULL;
talkatu_action_group_activate_format(TALKATU_ACTION_GROUP(ag), TALKATU_ACTION_FORMAT_BOLD);
activated = talkatu_action_group_get_activated_formats(TALKATU_ACTION_GROUP(ag));
g_assert_cmpuint(g_strv_length(activated), ==, 1);
g_assert_true(g_strv_contains((const gchar * const *)activated, TALKATU_ACTION_FORMAT_BOLD));
g_strfreev(activated);
g_object_unref(G_OBJECT(buffer));
}
static void
talkatu_test_action_group_activate_multiple(void) {
GtkTextBuffer *buffer = talkatu_whole_buffer_new();
GSimpleActionGroup *ag = talkatu_buffer_get_action_group(TALKATU_BUFFER(buffer));
gchar **activated = NULL;
talkatu_action_group_activate_format(TALKATU_ACTION_GROUP(ag), TALKATU_ACTION_FORMAT_BOLD);
talkatu_action_group_activate_format(TALKATU_ACTION_GROUP(ag), TALKATU_ACTION_FORMAT_ITALIC);
activated = talkatu_action_group_get_activated_formats(TALKATU_ACTION_GROUP(ag));
g_assert_cmpuint(g_strv_length(activated), ==, 2);
g_assert_true(g_strv_contains((const gchar * const *)activated, TALKATU_ACTION_FORMAT_BOLD));
g_assert_true(g_strv_contains((const gchar * const *)activated, TALKATU_ACTION_FORMAT_ITALIC));
g_strfreev(activated);
g_object_unref(G_OBJECT(buffer));
}
static void
talkatu_test_action_group_activate_complex(void) {
GtkTextBuffer *buffer = talkatu_whole_buffer_new();
GSimpleActionGroup *ag = talkatu_buffer_get_action_group(TALKATU_BUFFER(buffer));
gchar **activated = NULL;
talkatu_action_group_activate_format(TALKATU_ACTION_GROUP(ag), TALKATU_ACTION_FORMAT_BOLD);
talkatu_action_group_activate_format(TALKATU_ACTION_GROUP(ag), TALKATU_ACTION_FORMAT_ITALIC);
talkatu_action_group_activate_format(TALKATU_ACTION_GROUP(ag), TALKATU_ACTION_FORMAT_BOLD);
activated = talkatu_action_group_get_activated_formats(TALKATU_ACTION_GROUP(ag));
g_assert_cmpuint(g_strv_length(activated), ==, 1);
g_assert_true(g_strv_contains((const gchar * const *)activated, TALKATU_ACTION_FORMAT_ITALIC));
g_strfreev(activated);
g_object_unref(G_OBJECT(buffer));
}
gint
main(gint argc, gchar **argv) {
gint ret = 0;
g_test_init(&argc, &argv, NULL);
gtk_init(&argc, &argv);
talkatu_init();
g_test_add_func(
"/action-group/activate/simple",
talkatu_test_action_group_activate_simple
);
g_test_add_func(
"/action-group/activate/multiple",
talkatu_test_action_group_activate_multiple
);
g_test_add_func(
"/action-group/activate/complex",
talkatu_test_action_group_activate_complex
);
ret = g_test_run();
talkatu_uninit();
return ret;
}