summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTom Whipple <tw@tomwhipple.com>2006-08-24 23:05:12 +0000
committerTom Whipple <tw@tomwhipple.com>2006-08-24 23:05:12 +0000
commit041d362c266f3b34578fbcee662d81954294dcce (patch)
tree281b0848d35ae1ba22889970629cd412319dcdbb /tests
parentfde8dfe2cffd70963a379bc83208983ca9ab8da6 (diff)
add documentation
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.in1
-rw-r--r--tests/debug/README5
-rwxr-xr-xtests/debug/t.extraout17
-rwxr-xr-xtests/debug/t.failoverride17
-rwxr-xr-xtests/debug/t.interactive20
-rwxr-xr-xtests/debug/t.nodisplay35
-rwxr-xr-xtests/debug/t.var_bleed55
-rwxr-xr-xtests/doc_gen.pl164
-rw-r--r--tests/include/testassertions.sh139
-rw-r--r--tests/include/testfuncs.sh61
-rwxr-xr-xtests/xdg-desktop-icon/t.00-apply_generic3
-rwxr-xr-xtests/xdg-desktop-menu/t.00-apply_generic3
-rwxr-xr-xtests/xdg-desktop-menu/t.10-simple_menu_item_user_install4
-rwxr-xr-xtests/xdg-desktop-menu/t.11-simple_menu_item_user_uninstall3
-rwxr-xr-xtests/xdg-desktop-menu/t.20-simple_menu_item_system_install3
-rwxr-xr-xtests/xdg-desktop-menu/t.21-simple_menu_item_system_uninstall3
-rwxr-xr-xtests/xdg-email/t.00-apply_generic2
-rwxr-xr-xtests/xdg-icon-resource/t.apply_generic3
-rwxr-xr-xtests/xdg-mime/t.00-apply_generic3
-rwxr-xr-xtests/xdg-open/t.00-apply_generic4
-rwxr-xr-xtests/xdg-screensaver/t.00-apply_generic3
-rwxr-xr-xtests/xdg-su/t.00-apply_generic3
22 files changed, 473 insertions, 78 deletions
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 83f3afd..83b7167 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -42,3 +42,4 @@ install:
uninstall:
doc:
+ perl doc_gen.pl
diff --git a/tests/debug/README b/tests/debug/README
new file mode 100644
index 0000000..1a15fd5
--- /dev/null
+++ b/tests/debug/README
@@ -0,0 +1,5 @@
+The "tests" in this directory are here to verify the functionality of the test suite itself. Likely these tests are not useful to a general audience.
+
+You should probably not do anything with them unless you have a good idea what they do.
+
+Questions should be addressed to the test developer: Tom Whipple <mail@tomwhipple.com>
diff --git a/tests/debug/t.extraout b/tests/debug/t.extraout
new file mode 100755
index 0000000..ea84b33
--- /dev/null
+++ b/tests/debug/t.extraout
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+. "$XDG_TEST_DIR/include/testassertions.sh"
+. "$XDG_TEST_DIR/include/testcontrol.sh"
+
+test_extraout() {
+test_start "$FUNCNAME: verify functionallity of assert_nostdout"
+
+test_procedure
+
+assert_exit 0 echo foobar
+assert_nostdout
+
+test_result
+}
+
+run_test test_extraout
diff --git a/tests/debug/t.failoverride b/tests/debug/t.failoverride
new file mode 100755
index 0000000..c3cf257
--- /dev/null
+++ b/tests/debug/t.failoverride
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+. "$XDG_TEST_DIR/include/testassertions.sh"
+. "$XDG_TEST_DIR/include/testcontrol.sh"
+
+test_verify_failoverride() {
+test_start "$FUNCNAME: verify it works to change a fail to a warn"
+
+test_procedure
+
+test_fail "Manual failure"
+
+test_failoverride WARN
+test_result
+}
+
+run_test test_verify_failoverride
diff --git a/tests/debug/t.interactive b/tests/debug/t.interactive
new file mode 100755
index 0000000..fa203c2
--- /dev/null
+++ b/tests/debug/t.interactive
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+. "$XDG_TEST_DIR/include/testassertions.sh"
+. "$XDG_TEST_DIR/include/testcontrol.sh"
+
+test_interactive() {
+test_start "$FUNCNAME: verify functionallity of assert_interactive"
+
+test_procedure
+
+assert_interactive "Enter 'y'" y
+assert_interactive "Enter 'n'" n
+assert_interactive "neg Enter 'y'" n
+assert_interactive "neg Enter 'n'" y
+assert_interactive "Wait"
+
+test_result
+}
+
+run_test test_interactive
diff --git a/tests/debug/t.nodisplay b/tests/debug/t.nodisplay
new file mode 100755
index 0000000..b50b206
--- /dev/null
+++ b/tests/debug/t.nodisplay
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+. "$XDG_TEST_DIR/include/testassertions.sh"
+. "$XDG_TEST_DIR/include/testcontrol.sh"
+
+
+test_nodisplay() {
+
+test_start "$FUNCNAME: verify display is not set."
+
+test_init
+
+echo '#!/bin/bash' > showdisp.sh
+echo '(echo "DISPLAY:($DISPLAY)")' >> showdisp.sh
+
+chmod 755 showdisp.sh
+
+echo "Display before: '$DISPLAY'"
+set_no_display
+echo "Display after: '$DISPLAY'"
+
+test_procedure
+
+echo "Display in procedure: '$DISPLAY'"
+
+assert_exit 0 ./showdisp.sh
+assert_stdout
+assert_nostderr
+
+cat out.stdout
+
+test_result
+}
+
+run_test test_nodisplay
diff --git a/tests/debug/t.var_bleed b/tests/debug/t.var_bleed
new file mode 100755
index 0000000..f0fb0ed
--- /dev/null
+++ b/tests/debug/t.var_bleed
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+. "$XDG_TEST_DIR/include/testassertions.sh"
+. "$XDG_TEST_DIR/include/testcontrol.sh"
+
+test_var_bleed_set() {
+test_start "$FUNCNAME: set the BLEEDTEST variable"
+
+test_procedure
+
+export BLEED1=i_am_set
+BLEED2=set
+assert_exit 0 export BLEED3="set_within_assert_exit"
+
+test_result
+}
+
+test_var_bleed_read() {
+test_start "$FUNCNAME: read the BLEEDTEST variable"
+
+
+test_procedure
+
+assert_exit 0 echo -n "$BLEED1"
+assert_nostdout
+assert_nostderr
+
+assert_exit 0 echo -n "$BLEED2"
+assert_nostdout
+assert_nostderr
+
+assert_exit 0 echo -n "$BLEED3"
+assert_nostdout
+assert_nostderr
+
+assert_exit 0 echo -n "$BLEED4"
+assert_nostdout
+assert_nostderr
+
+test_result
+}
+
+test_stdout_capture() {
+test_start "$FUNCNAME: stdout capture test. note: FAIL=PASS"
+
+assert_exit 0 echo -n "some output"
+assert_nostdout
+assert_nostderr
+
+test_result
+}
+
+run_test test_var_bleed_set
+run_test test_var_bleed_read
+run_test test_stdout_capture
diff --git a/tests/doc_gen.pl b/tests/doc_gen.pl
new file mode 100755
index 0000000..ed29d94
--- /dev/null
+++ b/tests/doc_gen.pl
@@ -0,0 +1,164 @@
+#!perl
+
+use Data::Dumper;
+
+my @test_files = split('\s+',`ls generic/t.* xdg-*/t.*`);
+
+my $cvs_pre = "http://webcvs.freedesktop.org/portland/portland/xdg-utils/tests/";
+my $cvs_post = '?view=markup';
+my $assert_doc = "assertions.html";
+my $now = scalar localtime;
+my $style = "<style type=\"text/css\" media=\"all\">@import url(\"layout.css\");</style></head>\n";
+my $root_header = qq{| <a href="index.html">Tests</a> | <a href="$assert_doc">Assertions</a> | <a href="http://portland.freedesktop.org/wiki/WritingXdgTests">Overview</a> |<hr/>\n};
+my $group_header = qq{| <a href="../index.html">Tests</a> | <a href="../$assert_doc">Assertions</a> | <a href="http://portland.freedesktop.org/wiki/WritingXdgTests">Overview</a> |<hr/>\n};
+my $footer = "<hr><font size=\"-1\">xdg-utils test documentation generated $now</font>\n";
+
+my %fcns;
+
+my %group;
+my %shortdesc;
+
+## Read assertion file
+open IN, 'include/testassertions.sh' or die "Failed to open assertion file: $!\n";
+my $state = 'NULL';
+my %assertions;
+while ( <IN> ) {
+ if ( m/(\w+)\s*\(\)/ ) {
+ $state = $1;
+ $assertions{$state} = ();
+ }
+ elsif ( $state ne 'NULL' and m/^#(.*)/ ) {
+ my $txt = $1;
+ chomp $txt;
+ push @{ $assertions{$state} }, $txt;
+ }
+ else {
+ $state = 'NULL';
+ }
+}
+close IN;
+
+if ( ! -d 'doc' ) { mkdir 'doc'; }
+
+open OUT, ">doc/$assert_doc" or die "Failed to open $assert_doc: $!\n";
+print OUT "<html><head><title>xdg-utils test assertions</title>$style</head><body>\n$root_header";
+
+my @s_assert = sort keys %assertions ;
+print OUT qq{<h2>Defined Assertions in <a href="$cvs_pre}.qq{include/testassertions.sh$cvs_post">include/testassertions.sh</a></h2>\n};
+for $a ( @s_assert ) {
+ print OUT qq{<a href="#$a">$a</a><br>\n};
+}
+for $a ( @s_assert ) {
+ print OUT qq{<hr><h2><a name="$a">$a</a></h2>\n};
+ print OUT "<pre>", join("\n",@{ $assertions{$a} } ), "</pre>\n";
+}
+print OUT "$footer</body></html>";
+
+
+## Read test files
+for $f ( @test_files ) {
+ open IN, $f or die "Failed to open $f: $!\n";
+ $f =~ m{(.+)/t\.(.+)};
+ my $dir = $1;
+ my $test = $2;
+ `mkdir -p doc/$dir`;
+ my $o = "doc/$dir/$test.html";
+
+ push @{ $group{$dir} }, $test;
+
+ open HTM, ">$o" or die "Failed to open '$o': $!\n";
+ print HTM "<html><head><title>xdg-utils test: $f</title>\n";
+ print HTM $style;
+
+ print HTM "<body>$group_header<h1>Test: <a href=\"$cvs_pre$f$cvs_post\">$f</a></h1><hr/>\n";
+ my $fcn = '';
+ my $state = 'BEGIN';
+ while ( <IN> ) {
+ #find the test function
+ if ( m/(\w+)\s*\(\)/ ) {
+ $fcn = $1;
+ if (defined $fcns{$fcn} ){
+ print "WARNING in $f: $fcn already exists in $fcns{$fcn}!\n"
+ }
+ $fcns{$fcn} = $f;
+ $state = 'FUNCTION';
+ }
+ #find test_start
+ elsif ( m/test_start (.*)/ ) {
+ print HTM "<h2>Purpose of $fcn</h2>";
+ my $txt = $1;
+ $txt =~ s/\$FUNCNAME:*\s*//;
+ $txt =~ s/\"//g;
+ $shortdesc{ $test } = $txt;
+ print HTM "<p>$txt</p>\n";
+ $state = 'START';
+ }
+ #find test_purpose
+ elsif ( m/test_purpose (.*)/ ) {
+ print HTM "<h2>Description</h2>";
+ my $txt = $1;
+ $txt =~ s/\"//g;
+ print HTM "<p>$txt</p>\n";
+ }
+ #find initilization
+ elsif ( m/test_init/ ) {
+ print HTM "<h2>Depencencies</h2>\n";
+ $state = 'INIT';
+ next;
+ }
+ elsif ( m/test_procedure/ ) {
+ print HTM "<h2>Test Procedure</h2>\n";
+ $state = 'TEST';
+ next;
+ }
+ elsif ( m/test_note (.*)/ ) {
+ print HTM "<h2>Note</h2><p>$1</p>\n";
+ next;
+ }
+ elsif ( m/test_result/ ) {
+ $state = 'DONE';
+ }
+ if ( m/^#/ ) {
+ next;
+ }
+ if ( $state eq 'INIT' or $state eq 'TEST' ) {
+ $line = $_;
+ $line =~ s/^\s*(\w+)/<a href="\.\.\/$assert_doc#$1">$1<\/a>/;
+ if ( $assertions{$1} ) {
+ print HTM "<p>$line</p>\n";
+ #print "$f:\t'$1' found\n";
+ }
+ else {
+ #print "$f:\t'$1' not found\n";
+ print HTM "<p>$_</p>\n";
+ }
+ #print HTM "<p>$_</p>\n";
+ }
+ }
+ print HTM "$footer</body></html>\n";
+ close HTM;
+ close IN;
+}
+
+open INDEX, ">doc/index.html" or die "Could not open index: $!";
+print INDEX "<html><head><title>xdg-utils test suite</title>\n";
+print INDEX $style;
+
+print INDEX "<body>$root_header<h1>xdg-utils test documentation</h1>";
+
+my @s_groups = sort keys %group;
+
+for $g ( @s_groups ) {
+ print INDEX qq{<a href="#$g">$g</a> \n};
+}
+print INDEX "<table border=0>\n";
+for $k ( @s_groups ) {
+ print INDEX qq{<tr><td colspan=2><hr><h2><a name="$k">$k</a></h2></td></tr>\n};
+ for $i ( @{ $group{$k} } ) {
+ print INDEX "<tr><td><a href=\"$k/$i.html\">$i</a></td><td>$shortdesc{$i}</td></tr>\n";
+ }
+}
+print INDEX "</table>$footer</body></html>\n";
+close INDEX;
+
+#print Dumper keys %assertions;
diff --git a/tests/include/testassertions.sh b/tests/include/testassertions.sh
index cabdac0..476fb41 100644
--- a/tests/include/testassertions.sh
+++ b/tests/include/testassertions.sh
@@ -4,8 +4,14 @@
. "$XDG_TEST_DIR/include/testfuncs.sh"
-assert_exit() # execute command (saving output) and check exit code
-{
+## NOTE: Documentation is generated AUTOMATICALLY from this file
+## Function usage must immediately follow function delcaration
+
+assert_exit() {
+# execute command (saving output) and check exit code
+# Usage: assert_exit N command ...
+# where N is a number or a literal 'N' (for non-zero)
+# command can be an unquoted string, but be careful.
EXPECT="$1"
shift 1
@@ -89,6 +95,12 @@ assert_interactive() {
assert_file_in_path() {
+# Assert that some file is present in a path.
+#
+# Usage:
+# assert_file_in_path FILENAME PATH
+# where FILE is the exact name of the file and
+# PATH is a ':' separated list of directories
search_dirs=`echo "$2" | tr ':' ' '`
found_files=`find $search_dirs -name "$1" 2>/dev/null`
@@ -98,6 +110,8 @@ assert_file_in_path() {
}
assert_file_not_in_path() {
+# Assert the some file is NOT present in a path.
+# Opposite of 'assert_file_in_path'
search_dirs=`echo "$2" | tr ':' ' '`
found_files=`find $search_dirs -name "$1" 2>/dev/null`
@@ -108,6 +122,8 @@ assert_file_not_in_path() {
assert_file() {
+# Assert the existance of an exact filename
+# Usage: assert_file FILE
if [ ! -e "$1" ] ; then
test_fail "'$1' does not exist"
return
@@ -124,14 +140,17 @@ assert_file() {
}
assert_nofile() {
+# Assert the non existance of an exact filename.
+# Opposite of 'assert_file'
if [ -e "$1" ] ; then
test_fail "'$1' exists."
fi
}
-assert_nostdout() # check that nothing went to stdout
-{
+assert_nostdout() {
+# assert nothing was written to a stdout.
+# NOTE: Failing this assertion will WARN rather than FAIL
if [ -s out.stdout ]
then
test_infoline "Unexpected output from '$LASTCOMMAND' written to stdout, as shown below:"
@@ -140,8 +159,9 @@ assert_nostdout() # check that nothing went to stdout
fi
}
-assert_nostderr() # check that nothing went to stderr
-{
+assert_nostderr() {
+# assert nothing was written to stderr.
+# NOTE: Failing this assertion will WARN rather than FAIL
if [ ! -z "$XDG_UTILS_DEBUG_LEVEL" ] ; then
test_infoline "not checking STDERR from '$LASTCOMMAND' because XDG_UTILS_DEBUG_LEVEL=$XDG_UTILS_DEBUG_LEVEL"
test_infoline out.stderr stderr:
@@ -152,10 +172,10 @@ assert_nostderr() # check that nothing went to stderr
fi
}
-assert_stderr() # check that stderr matches expected error
-{
- # $1 is file containing regexp for expected error
- # if no argument supplied, just check out.stderr is not empty
+assert_stderr() {
+# check that stderr matches expected error
+# $1 is file containing regexp for expected error
+# if no argument supplied, just check out.stderr is not empty
if [ ! -s out.stderr ]
then
@@ -193,10 +213,10 @@ assert_stderr() # check that stderr matches expected error
fi
}
-assert_stdout() # check that stderr matches expected error
-{
- # $1 is file containing regexp for expected error
- # if no argument supplied, just check out.stderr is not empty
+assert_stdout() {
+# check that stderr matches expected error
+# $1 is file containing regexp for expected error
+# if no argument supplied, just check out.stderr is not empty
if [ ! -s out.stdout ]
then
@@ -239,49 +259,116 @@ assert_stdout() # check that stderr matches expected error
fi
}
-
-infofile() # write file to journal using tet_infoline
-{
- # $1 is file name, $2 is prefix for tet_infoline
-
- prefix="$2"
- while read line
- do
- test_infoline "$prefix$line"
- done < "$1"
-}
-
require_interactive() {
+# if $XDG_TEST_NO_INTERACTIVE is set, test result becomes UNTESTED
if [ ! -z "$XDG_TEST_NO_INTERACTIVE" ] ; then
test_result UNTESTED "XDG_TEST_NO_INTERACTIVE is set, but this test needs interactive"
fi
}
require_root() {
+# if the test is not being run as root, test result is UNTESTED
if [ `whoami` != 'root' ] ; then
test_result UNTESTED "not running as root, but test requires root privileges"
fi
}
require_notroot() {
+# if the test is being run as root, the test result is UNTESTED
+# opposite of 'require_root'
if [ `whoami` = 'root' ] ; then
test_result UNTESTED "running as root, but test must be run as a normal user"
fi
}
set_no_display() {
+# Clear $DISPLAY
unset DISPLAY
}
assert_display() {
+# Assert that the $DISPLAY variable is set.
if [ -z "$DISPLAY" ] ; then
test_fail "DISPLAY not set!"
fi
}
assert_util_var() {
+# Assert that the $XDGUTIL varilable is set.
+# DEPRICATED. Only used by generic tests.
if [ "x$XDGUTIL" = x ]; then
test_fail "XDGUTIL variable not set"
fi
}
+use_file() {
+# Copy a datafile from it's defult location into the test directory
+# Usage:
+# use_file ORIG_FILE VAR
+# Where ORIG_FILE is the name of the file, and VAR is the name of the
+# variable to create that will contain the new (unique) filename.
+# DO NOT put a '$' in front of VAR. VAR will be created via eval.
+#
+# $VAR will be set to 'xdgtestdata-$XDG_TEST_ID-$file' after the
+# directory is stripped from $file.
+ src="$1"
+ file=${src##/*/}
+ varname="$2"
+
+ if [ $# -lt 2 ] ; then
+ echo "TEST SYNTAX ERROR: use_file must have two arguments" >&2
+ exit 255
+ fi
+
+ assert_file "$src"
+
+ outfile="xdgtestdata-$XDG_TEST_ID-$file"
+ eval "$varname=$outfile"
+
+ cp "$src" "$XDG_TEST_TMPDIR/$outfile"
+}
+
+get_unique_name() {
+# Get a unique name for a file, similar to 'use_file'
+# except that no file is copied. You are left to create file $VAR.
+ varname="$1"
+ file="$2"
+ if [ -z "$varname" ] ; then
+ echo "TEST SYNAX ERROR: get_unique_name requries a variable name"
+ exit 255
+ fi
+
+ outfile="xdgtestdata-$XDG_TEST_ID-$file"
+ eval "$varname=$outfile"
+}
+
+edit_file() {
+# Edit file via sed.
+# Usage:
+# edit_file $FILE origstr VARNAME [newstr]
+# Where:
+# $FILE is a file, probably copied from 'use_file'
+# VARNAME is created via 'eval' to contain the newstr
+# newstr is the optional substitution. If newstr is not present,
+# it will become 'xdgtestdata-$XDG_TEST_ID-$origstr'
+ file="$1"
+ origstr="$2"
+ varname="$3"
+ newstr="$4"
+
+ if [ $# -lt 3 ] ; then
+ echo "TEST SYNTAX ERROR: edit_file must have at least 3 arguments."
+ exit 255
+ fi
+
+ assert_file "$file"
+
+ if [ -z "$newstr" ] ; then
+ newstr="xdgtestdata-$XDG_TEST_ID-$origstr"
+ fi
+
+ eval "$varname=\"$newstr\""
+
+ sed -i -e "s|$origstr|$newstr|g" "$file"
+}
+
diff --git a/tests/include/testfuncs.sh b/tests/include/testfuncs.sh
index dab72e2..d8d73e5 100644
--- a/tests/include/testfuncs.sh
+++ b/tests/include/testfuncs.sh
@@ -41,8 +41,9 @@ test_purpose() {
# TODO: generate a manpage or something.
}
test_note() {
- verify_test_context
+ #verify_test_context
# TODO: generate even more docs.
+ tmp=1
}
## Used for setup/dependency verification.
@@ -124,56 +125,14 @@ test_result() {
exit "$RESULT"
}
-use_file() {
- src="$1"
- file=${src##/*/}
- varname="$2"
-
- if [ $# -lt 2 ] ; then
- echo "TEST SYNTAX ERROR: use_file must have two arguments" >&2
- exit 255
- fi
-
- assert_file "$src"
+infofile() # write file to journal using tet_infoline
+{
+ # $1 is file name, $2 is prefix for tet_infoline
- outfile="xdgtestdata-$XDG_TEST_ID-$file"
- eval "$varname=$outfile"
-
- cp "$src" "$XDG_TEST_TMPDIR/$outfile"
+ prefix="$2"
+ while read line
+ do
+ test_infoline "$prefix$line"
+ done < "$1"
}
-get_unique_name() {
- varname="$1"
- file="$2"
- if [ -z "$varname" ] ; then
- echo "TEST SYNAX ERROR: get_unique_name requries a variable name"
- exit 255
- fi
-
- outfile="xdgtestdata-$XDG_TEST_ID-$file"
- eval "$varname=$outfile"
-}
-
-edit_file() {
- file="$1"
- origstr="$2"
- varname="$3"
- newstr="$4"
-
- if [ $# -lt 3 ] ; then
- echo "TEST SYNTAX ERROR: edit_file must have at least 3 arguments."
- exit 255
- fi
-
- assert_file "$file"
-
- if [ -z "$newstr" ] ; then
- newstr="xdgtestdata-$XDG_TEST_ID-$origstr"
- fi
-
- eval "$varname=\"$newstr\""
-
- sed -i -e "s|$origstr|$newstr|g" "$file"
-}
-
-
diff --git a/tests/xdg-desktop-icon/t.00-apply_generic b/tests/xdg-desktop-icon/t.00-apply_generic
index 36e7017..f97b1c8 100755
--- a/tests/xdg-desktop-icon/t.00-apply_generic
+++ b/tests/xdg-desktop-icon/t.00-apply_generic
@@ -1,6 +1,9 @@
#!/bin/bash
. "$XDG_TEST_DIR/include/testcontrol.sh"
+. "$XDG_TEST_DIR/include/testfuncs.sh"
+
+test_note This is a dummy test to run the generic tests for this utility.
generic_tests=`ls $XDG_TEST_DIR/generic/t.*`
for t in $generic_tests; do
diff --git a/tests/xdg-desktop-menu/t.00-apply_generic b/tests/xdg-desktop-menu/t.00-apply_generic
index 63ba594..f80aebc 100755
--- a/tests/xdg-desktop-menu/t.00-apply_generic
+++ b/tests/xdg-desktop-menu/t.00-apply_generic
@@ -1,6 +1,9 @@
#!/bin/bash
. "$XDG_TEST_DIR/include/testcontrol.sh"
+. "$XDG_TEST_DIR/include/testfuncs.sh"
+
+test_note This is a dummy test to run the generic tests for this utility.
generic_tests=`ls $XDG_TEST_DIR/generic/t.*`
for t in $generic_tests; do
diff --git a/tests/xdg-desktop-menu/t.10-simple_menu_item_user_install b/tests/xdg-desktop-menu/t.10-simple_menu_item_user_install
index bfd1f79..d3a7545 100755
--- a/tests/xdg-desktop-menu/t.10-simple_menu_item_user_install
+++ b/tests/xdg-desktop-menu/t.10-simple_menu_item_user_install
@@ -7,7 +7,9 @@
## Test function
test_simple_menu_item_user_install() {
## Begin the test.
-test_start "$FUNCNAME: verify a desktop file is installed in the user's applications menu"
+test_start "$FUNCNAME: verify a basic desktop file is installed in the user's applications menu"
+test_purpose "A basic desktop file (no category defined) is installed into the menu. It should show up somewhere, but this behavior is not well defined by the spec. This test fails for many systems."
+test_note "Because this behavior is not well defined this test will WARN instead of FAIL"
# Dependencies section
test_init
diff --git a/tests/xdg-desktop-menu/t.11-simple_menu_item_user_uninstall b/tests/xdg-desktop-menu/t.11-simple_menu_item_user_uninstall
index 62a9524..1392d21 100755
--- a/tests/xdg-desktop-menu/t.11-simple_menu_item_user_uninstall
+++ b/tests/xdg-desktop-menu/t.11-simple_menu_item_user_uninstall
@@ -8,6 +8,9 @@
test_simple_menu_item_user_uninstall() {
## Begin the test.
test_start "$FUNCNAME: verify a desktop file is uninstalled from the user applications menu"
+test_purpose "A basic desktop file (no category defined) is installed into the menu. It should show up somewhere, but this behavior is not well defined by the spec. This test fails for many systems. This test verifies proper uninstall."
+test_note "Because this behavior is not well defined this test will WARN instead of FAIL"
+
# Dependencies section
test_init
diff --git a/tests/xdg-desktop-menu/t.20-simple_menu_item_system_install b/tests/xdg-desktop-menu/t.20-simple_menu_item_system_install
index 96e737a..083059e 100755
--- a/tests/xdg-desktop-menu/t.20-simple_menu_item_system_install
+++ b/tests/xdg-desktop-menu/t.20-simple_menu_item_system_install
@@ -8,6 +8,9 @@
test_simple_menu_item_system_install() {
## Begin the test.
test_start "$FUNCNAME: verify a desktop file is installed in the system applications menu"
+test_purpose "A basic desktop file (no category defined) is installed into the menu. It should show up somewhere, but this behavior is not well defined by the spec. This test fails for many systems."
+test_note "Because this behavior is not well defined this test will WARN instead of FAIL"
+
# Dependencies section
test_init
diff --git a/tests/xdg-desktop-menu/t.21-simple_menu_item_system_uninstall b/tests/xdg-desktop-menu/t.21-simple_menu_item_system_uninstall
index 4703a5e..f7abefc 100755
--- a/tests/xdg-desktop-menu/t.21-simple_menu_item_system_uninstall
+++ b/tests/xdg-desktop-menu/t.21-simple_menu_item_system_uninstall
@@ -8,6 +8,9 @@
test_simple_menu_item_system_uninstall() {
## Begin the test.
test_start "$FUNCNAME: verify a desktop file is uninstalled from the system applications menu"
+test_purpose "A basic desktop file (no category defined) is installed into the menu. It should show up somewhere, but this behavior is not well defined by the spec. This test fails for many systems. This is the corresponding uninstall test."
+test_note "Because this behavior is not well defined this test will WARN instead of FAIL"
+
# Dependencies section
test_init
diff --git a/tests/xdg-email/t.00-apply_generic b/tests/xdg-email/t.00-apply_generic
index 0d574e3..2d4f54e 100755
--- a/tests/xdg-email/t.00-apply_generic
+++ b/tests/xdg-email/t.00-apply_generic
@@ -1,6 +1,8 @@
#!/bin/bash
. "$XDG_TEST_DIR/include/testcontrol.sh"
+. "$XDG_TEST_DIR/include/testfuncs.sh"
+test_note This is a dummy test to run the generic tests for this utility.
generic_tests=`ls $XDG_TEST_DIR/generic/t.*`
for t in $generic_tests; do
diff --git a/tests/xdg-icon-resource/t.apply_generic b/tests/xdg-icon-resource/t.apply_generic
index 476cf7b..4d6614e 100755
--- a/tests/xdg-icon-resource/t.apply_generic
+++ b/tests/xdg-icon-resource/t.apply_generic
@@ -1,6 +1,9 @@
#!/bin/bash
. "$XDG_TEST_DIR/include/testcontrol.sh"
+. "$XDG_TEST_DIR/include/testfuncs.sh"
+
+test_note This is a dummy test to run the generic tests for this utility.
generic_tests=`ls $XDG_TEST_DIR/generic/t.*`
for t in $generic_tests; do
diff --git a/tests/xdg-mime/t.00-apply_generic b/tests/xdg-mime/t.00-apply_generic
index 30ee705..d3058e6 100755
--- a/tests/xdg-mime/t.00-apply_generic
+++ b/tests/xdg-mime/t.00-apply_generic
@@ -1,6 +1,9 @@
#!/bin/bash
. "$XDG_TEST_DIR/include/testcontrol.sh"
+. "$XDG_TEST_DIR/include/testfuncs.sh"
+
+test_note This is a dummy test to run the generic tests for this utility.
generic_tests=`ls $XDG_TEST_DIR/generic/t.*`
for t in $generic_tests; do
diff --git a/tests/xdg-open/t.00-apply_generic b/tests/xdg-open/t.00-apply_generic
index 1e1279d..7da4243 100755
--- a/tests/xdg-open/t.00-apply_generic
+++ b/tests/xdg-open/t.00-apply_generic
@@ -1,6 +1,10 @@
#!/bin/bash
. "$XDG_TEST_DIR/include/testcontrol.sh"
+. "$XDG_TEST_DIR/include/testfuncs.sh"
+
+
+test_note This is a dummy test to run the generic tests for this utility.
generic_tests=`ls $XDG_TEST_DIR/generic/t.*`
for t in $generic_tests; do
diff --git a/tests/xdg-screensaver/t.00-apply_generic b/tests/xdg-screensaver/t.00-apply_generic
index 14f73ed..ed07e30 100755
--- a/tests/xdg-screensaver/t.00-apply_generic
+++ b/tests/xdg-screensaver/t.00-apply_generic
@@ -1,6 +1,9 @@
#!/bin/bash
. "$XDG_TEST_DIR/include/testcontrol.sh"
+. "$XDG_TEST_DIR/include/testfuncs.sh"
+
+test_note This is a dummy test to run the generic tests for this utility.
generic_tests=`ls $XDG_TEST_DIR/generic/t.*`
for t in $generic_tests; do
diff --git a/tests/xdg-su/t.00-apply_generic b/tests/xdg-su/t.00-apply_generic
index cd6522e..187dc82 100755
--- a/tests/xdg-su/t.00-apply_generic
+++ b/tests/xdg-su/t.00-apply_generic
@@ -1,6 +1,9 @@
#!/bin/bash
. "$XDG_TEST_DIR/include/testcontrol.sh"
+. "$XDG_TEST_DIR/include/testfuncs.sh"
+
+test_note This is a dummy test to run the generic tests for this utility.
generic_tests=`ls $XDG_TEST_DIR/generic/t.*`
for t in $generic_tests; do