diff options
author | Christian Dywan <christian@twotoasts.de> | 2013-03-13 20:03:43 +0100 |
---|---|---|
committer | Christian Dywan <christian@twotoasts.de> | 2013-03-13 20:03:43 +0100 |
commit | 99107743a263c67c4fe0660e033a215bab83609c (patch) | |
tree | ece03791da782d84d913c9cb56e7e790903d719b /tests/desktop.sh | |
parent | a3ff05fdffaddfa846b07aa46a4ab80f3f205a05 (diff) | |
download | midori-git-99107743a263c67c4fe0660e033a215bab83609c.tar.gz |
Add .desktop file validation unit test and fix errors
Pantheon not being recognized is a known false positive.
Diffstat (limited to 'tests/desktop.sh')
-rwxr-xr-x | tests/desktop.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/desktop.sh b/tests/desktop.sh new file mode 100755 index 00000000..c670ab88 --- /dev/null +++ b/tests/desktop.sh @@ -0,0 +1,21 @@ +#! /usr/bin/env sh +# Copyright 2013 Christian Dywan <christian@twotoasts.de> +# +# This script 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.1 of the License, or (at your option) any later version. +echo Validating .desktop files +test -z $(which desktop-file-validate) && echo ...SKIPPED: not installed && return 0 +test -z "$SRCDIR" && SRCDIR=$PWD +test -z "$BLDDIR" && BLDDIR=_build +cd "$SRCDIR/$BLDDIR/default/data" +ERRORS=0 +for i in $(ls | GREP_OPTIONS= grep .desktop); do + for j in $(desktop-file-validate $i | grep -v 'unregistered value "Pantheon"' | tr ' ' '_'); do + ERRORS=1 + echo $j | tr '_' ' ' + done +done +test "$ERRORS" = 1 && echo ...FAILED && exit 1 +echo ...OK |