diff options
| author | mbkma <[email protected]> | 2026-03-22 10:18:37 +0100 |
|---|---|---|
| committer | mbkma <[email protected]> | 2026-03-22 22:08:28 +0100 |
| commit | 4a14e878c1187d6cc1f76b87a24a6007314d996e (patch) | |
| tree | 14e01a5357bd807b95d368da78202cb495658718 /tests | |
| parent | f1fd658bda21506fac8966821fcdb4c2a154b590 (diff) | |
| download | pluma-meson.tar.bz2 pluma-meson.tar.xz | |
add meson supportmeson
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/document-saver.c | 24 | ||||
| -rw-r--r-- | tests/meson.build | 27 |
2 files changed, 49 insertions, 2 deletions
diff --git a/tests/document-saver.c b/tests/document-saver.c index 3f012c19..d327eeb4 100644 --- a/tests/document-saver.c +++ b/tests/document-saver.c @@ -154,7 +154,11 @@ mount_ready_callback (GObject *object, } else { - g_assert_no_error (error); + mount_success = FALSE; + if (error) + { + g_error_free (error); + } } mount_completed = TRUE; @@ -223,7 +227,16 @@ test_saver (const gchar *filename_or_uri, uri = g_file_get_uri (file); existed = g_file_query_exists (file, NULL); - ensure_mounted (file); + if (!ensure_mounted (file)) + { + g_test_skip ("Remote mount unavailable"); + + g_free (uri); + g_object_unref (file); + saver_test_data_free (data); + g_object_unref (document); + return; + } pluma_document_save_as (document, uri, pluma_encoding_get_utf8 (), save_flags); @@ -408,6 +421,13 @@ test_permissions (const gchar *uri, GFileInfo *info; guint mode; + if (!ensure_mounted (file)) + { + g_test_skip ("Remote mount unavailable"); + g_object_unref (file); + return; + } + g_file_delete (file, NULL, NULL); stream = g_file_create (file, 0, NULL, &error); diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 00000000..e600ca36 --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,27 @@ +test_targets = { + 'smart-converter': 'smart-converter.c', + 'document-input-stream': 'document-input-stream.c', + 'document-output-stream': 'document-output-stream.c', + 'document-loader': 'document-loader.c', + 'document-saver': 'document-saver.c', +} + +test_env = environment() +test_env.set('GSETTINGS_SCHEMA_DIR', gsettings_schema_builddir) + +foreach t, src : test_targets + test_exe = executable( + t, + sources: src, + include_directories: [root_inc, pluma_inc], + dependencies: pluma_deps, + link_with: libpluma, + c_args: pluma_cflags, + ) + test( + t, + test_exe, + env: test_env, + depends: gsettings_schema_target, + ) +endforeach |
