[gnome-builder] libide/tweaks: add test-tweaks
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/tweaks: add test-tweaks
- Date: Sun, 31 Jul 2022 03:45:00 +0000 (UTC)
commit da625c2850cbd76ebf3575a99ad76059f3bf9741
Author: Christian Hergert <chergert redhat com>
Date: Sat Jul 30 20:43:48 2022 -0700
libide/tweaks: add test-tweaks
This will just let us start testing things like .ui merging as we add new
object types to be loaded.
src/libide/tweaks/meson.build | 4 +++
src/libide/tweaks/test-tweaks.c | 54 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+)
---
diff --git a/src/libide/tweaks/meson.build b/src/libide/tweaks/meson.build
index acdd5f9d4..17952d97d 100644
--- a/src/libide/tweaks/meson.build
+++ b/src/libide/tweaks/meson.build
@@ -60,3 +60,7 @@ gnome_builder_public_sources += files(libide_tweaks_public_sources)
gnome_builder_public_headers += files(libide_tweaks_public_headers)
gnome_builder_include_subdirs += libide_tweaks_header_subdir
gnome_builder_gir_extra_args += ['--c-include=libide-tweaks.h', '-DIDE_TWEAKS_COMPILATION']
+
+test_tweaks = executable('test-tweaks', 'test-tweaks.c',
+ dependencies: [libide_tweaks_dep],
+)
\ No newline at end of file
diff --git a/src/libide/tweaks/test-tweaks.c b/src/libide/tweaks/test-tweaks.c
new file mode 100644
index 000000000..050985e0d
--- /dev/null
+++ b/src/libide/tweaks/test-tweaks.c
@@ -0,0 +1,54 @@
+/* test-tweaks.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#include <unistd.h>
+
+#include <libide-tweaks.h>
+
+#include "ide-tweaks-init.h"
+
+int
+main (int argc,
+ char *argv[])
+{
+ g_autoptr(IdeTweaks) tweaks = NULL;
+
+ _ide_tweaks_init ();
+
+ tweaks = ide_tweaks_new ();
+
+ for (guint i = 1; i < argc; i++)
+ {
+ const char *path = argv[i];
+ g_autoptr(GFile) file = g_file_new_for_commandline_arg (path);
+ g_autoptr(IdeTweaks) to_merge = ide_tweaks_new ();
+ g_autoptr(GError) error = NULL;
+
+ if (!ide_tweaks_load_from_file (to_merge, file, NULL, &error))
+ {
+ g_printerr ("Failed to parse %s: %s\n", path, error->message);
+ return EXIT_FAILURE;
+ }
+
+ g_print ("TODO: merge files\n");
+ }
+
+ return EXIT_SUCCESS;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]