Browse Source

add metainfo test

Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
Stephan Lachnit 4 years ago
parent
commit
6453a123ab
2 changed files with 18 additions and 1 deletions
  1. 2 0
      .travis.yml
  2. 16 1
      data/meson.build

+ 2 - 0
.travis.yml

@@ -5,6 +5,7 @@ sudo: false
 addons:
   apt:
     packages:
+      - appstream
       - clang
       - clang-format
       - libinih-dev
@@ -18,6 +19,7 @@ addons:
 script:
   - ./scripts/format-check.sh
   - ./bootstrap.sh -Dwith-examples=true
+  - meson test -C build
   - gamemoded -v
   - dbus-run-session -- gamemode-simulate-game
   - ./scripts/static-analyser-check.sh 

+ 16 - 1
data/meson.build

@@ -66,7 +66,22 @@ install_man(
 )
 
 # Install metainfo
+metainfo_file = files('io.github.feralinteractive.gamemode.metainfo.xml')
+
 install_data(
-    'io.github.feralinteractive.gamemode.metainfo.xml',
+    metainfo_file,
     install_dir: join_paths(path_datadir, 'metainfo')
 )
+
+# Validate metainfo
+appstreamcli = find_program(
+  'appstreamcli',
+  required: false
+)
+if appstreamcli.found()
+  test(
+    'validate metainfo file',
+    appstreamcli,
+    args: ['validate', '--no-net', '--pedantic', metainfo_file],
+  )
+endif