diff --git a/data/meson.build b/data/meson.build index 2ddcd896..2c859855 100644 --- a/data/meson.build +++ b/data/meson.build @@ -31,10 +31,6 @@ install_data( install_dir: get_option('datadir') / 'glib-2.0' / 'schemas', ) -compile_schemas = find_program('glib-compile-schemas', required: false) -if compile_schemas.found() - test('Validate schema file', compile_schemas, args: ['--strict', '--dry-run', meson.current_source_dir()]) -endif #======================== # metainfo confuses windows, and icons are handled differently there @@ -71,10 +67,7 @@ if not windows install_dir: get_option('datadir') / 'applications', ) - desktop_utils = find_program('desktop-file-validate', required: false) - if desktop_utils.found() - test('Validate desktop file', desktop_utils, args: [desktop_file]) - endif + #======================== @@ -96,9 +89,4 @@ if not windows install_dir: get_option('datadir') / 'metainfo', ) - appstreamcli = find_program('appstreamcli', required: false) - if appstreamcli.found() - test('Validate appstream file', appstreamcli, args: ['validate', '--pedantic', '--no-net', '--explain', appstream_file]) - endif - endif \ No newline at end of file diff --git a/meson.build b/meson.build index 7e75ae3b..b48c178e 100644 --- a/meson.build +++ b/meson.build @@ -14,7 +14,6 @@ correct_app_path = '/io/github/elly_code/' + app_name legacy_app_id = 'io.github.ellie_commons.' + app_name legacy_app_path = '/io/github/ellie_commons/' + app_name -vala_flags = [] development = get_option('development') legacy_rdnn = get_option('legacy-rdnn') windows = get_option('windows') @@ -25,7 +24,7 @@ if legacy_rdnn app_path = legacy_app_path #TODO: Remove once appcenter has latte - vala_flags += ['--define', 'LATTE'] + add_project_arguments('--define', 'LATTE', language: 'vala') else app_id = correct_app_id alternate_app_id = legacy_app_id @@ -33,9 +32,9 @@ else endif if development - app_id += '.devel' - vala_flags += ['--define', 'DEVEL'] - vala_flags += ['--define', 'LATTE'] + app_id += '.devel' + add_project_arguments('--define', 'DEVEL', language: 'vala') + add_project_arguments('--define', 'LATTE', language: 'vala') endif #================================ @@ -43,9 +42,9 @@ endif icon_variant = get_option('icon-variant') if icon_variant == 'halloween' - vala_flags += ['--define', 'HALLOWEEN'] + add_project_arguments('--define', 'HALLOWEEN', language: 'vala') else - vala_flags += ['--define', 'DEFAULT'] + add_project_arguments('--define', 'DEFAULT', language: 'vala') endif #================================ @@ -59,7 +58,7 @@ if build_machine.system() == 'windows' endif if windows - vala_flags += ['--define', 'WINDOWS'] + add_project_arguments('--define', 'WINDOWS', language: 'vala') endif add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (app_name), language:'c') @@ -70,7 +69,7 @@ add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (app_name), language:'c') # https://gitlab.gnome.org/GNOME/vala/-/issues/1413#note_1707480 if meson.get_compiler ('c').get_id () == 'clang' - add_project_arguments('-Wno-incompatible-function-pointer-types', language: 'c') + add_project_arguments('-Wno-incompatible-function-pointer-types', language: 'c') endif @@ -96,6 +95,9 @@ if windows subdir('windows') endif +subdir('tests') + + gnome.post_install( glib_compile_schemas: true, gtk_update_icon_cache: true, diff --git a/src/meson.build b/src/meson.build index 6276d8bc..10cab86b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -84,7 +84,6 @@ executable( config_file, sources, dependencies: dependencies, - vala_args: vala_flags, win_subsystem: 'windows', install : true ) diff --git a/tests/meson.build b/tests/meson.build index c7d8aaac..f389850c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,7 +1,50 @@ +# +# TESTS +# + +#======================== +# Linter and Appstream stuff + +vala_linter = find_program('io.elementary.vala-lint', required: false) +if vala_linter.found() + test('lint', + vala_linter, + args: [meson.project_source_root() / 'src'], + is_parallel: true) +endif + +compile_schemas = find_program('glib-compile-schemas', required: false) +if compile_schemas.found() + test('schema', + compile_schemas, + args: ['--strict', '--dry-run', meson.project_source_root() / 'data'], + is_parallel: true) +endif + +# Windows cares not for Appstream +if not windows + desktop_utils = find_program('desktop-file-validate', required: false) + if desktop_utils.found() + test('desktop', + desktop_utils, + args: [desktop_file], + is_parallel: true) + endif + + appstreamcli = find_program('appstreamcli', required: false) + if appstreamcli.found() + test('metainfo', + appstreamcli, + args: ['validate', '--pedantic', '--no-net', '--explain', appstream_file], + is_parallel: true) + endif +endif + + +#======================== +# Services + -########### META: -# Linter -# Appstream files and co # Storage: Load and save ### Services @@ -9,7 +52,8 @@ # Build some services and enums. Do random manipulations and compare -#### UI +#======================== +# Widgets # build specific widgets: # Textview