diff options
author | Waldo Bastian <waldo.bastian@intel.com> | 2006-09-10 00:54:20 +0000 |
---|---|---|
committer | Waldo Bastian <waldo.bastian@intel.com> | 2006-09-10 00:54:20 +0000 |
commit | bebef221155795f170f3403d2ec6260bb1d2c8cc (patch) | |
tree | c3d73070192169adb84a5cc7b968955eae5eed92 /tests | |
parent | 311ddafb415243674e666af11be1cf68b9af1360 (diff) |
Install .desktop files with proper categories, test all main categories
Diffstat (limited to 'tests')
5 files changed, 24 insertions, 126 deletions
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 d3a7545..07cf2da 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 @@ -8,8 +8,7 @@ test_simple_menu_item_user_install() { ## Begin the test. 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" +test_purpose "A basic desktop file is installed into the menu." # Dependencies section test_init @@ -19,7 +18,7 @@ USERPATH="$HOME/.local" set_no_display -use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP +use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_category.desktop" DESKTOP edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE edit_file "$DESKTOP" 'Test Menu Item Install' ITEM_TEXT "TEST $XDG_TEST_SHORTID" edit_file "$DESKTOP" '/tmp' WORK_DIR "$XDG_TEST_TMPDIR" @@ -40,17 +39,21 @@ assert_file_in_path "$DESKTOP" "$USERPATH" if [ -z "$XDG_TEST_NO_INTERACTIVE" -a `whoami` != 'root' ]; then -assert_interactive "Is an item called '$ITEM_TEXT' somewhere in the menu tree, possibly in a generic location?\n\t(NOTE: If you are using KDE, it may take a few seconds to appear.)" y +assert_interactive "Is an item called '$ITEM_TEXT' somewhere in the menu tree, possibly in a menu dedicated to 'Development'?" y assert_interactive "Please select the menu item '$ITEM_TEXT'" ## Double clicking will result in the command 'touch xdg-test-menu-item-install.tmp' to be run assert_file "$WORK_DIR/$CREATEFILE" fi -## Cleanup -xdg-desktop-menu uninstall --mode user "$DESKTOP" >/dev/null 2>&1 +assert_exit 0 xdg-desktop-menu uninstall --mode user "$DESKTOP" +assert_nostdout +assert_nostderr + +assert_file_not_in_path "$DESKTOP" "$USERPATH" + +assert_interactive_notroot "Is the menu item '$ITEM_TEXT' still present?" n -test_failoverride WARN test_result } 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 deleted file mode 100755 index 1392d21..0000000 --- a/tests/xdg-desktop-menu/t.11-simple_menu_item_user_uninstall +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -## Include utility functions. -. "$XDG_TEST_DIR/include/testassertions.sh" -. "$XDG_TEST_DIR/include/testcontrol.sh" - -## Test function -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 - -# Generate .desktop file -USERPATH="$HOME/.local:$HOME/.gnome:$HOME/.kde" - -set_no_display - -use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP -edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE -edit_file "$DESKTOP" 'Test Menu Item Install' ITEM_TEXT "TEST $XDG_TEST_SHORTID" - -assert_file "$DESKTOP" - -assert_exit 0 xdg-desktop-menu install --mode user "$DESKTOP" - -assert_file_in_path "$DESKTOP" "$USERPATH" - - -assert_interactive_notroot "Is an item called '$ITEM_TEXT' somewhere in the menu tree, possibly in a generic location?\n\t(NOTE: If you are using KDE, it may take a few seconds to appear.)" y - -# Test steps section -test_procedure - -assert_exit 0 xdg-desktop-menu uninstall --mode user "$DESKTOP" -assert_nostdout -assert_nostderr - -assert_file_not_in_path "$DESKTOP" "$USERPATH" - -assert_interactive_notroot "Is the menu item '$ITEM_TEXT' still present?\n\t(NOTE: If you are using KDE, it may take a few seconds to disappear.)" n - -test_failoverride WARN -test_result -} - -run_test test_simple_menu_item_user_uninstall diff --git a/tests/xdg-desktop-menu/t.14-menu_install_category b/tests/xdg-desktop-menu/t.14-menu_install_category index 465a247..bb7b981 100755 --- a/tests/xdg-desktop-menu/t.14-menu_install_category +++ b/tests/xdg-desktop-menu/t.14-menu_install_category @@ -7,7 +7,7 @@ ## Test function test_menu_install_category() { ## Begin the test. -test_start "$FUNCNAME: verify a desktop file is installed in the correct category" +test_start "$FUNCNAME: verify that the menu properly supports the '$CATEGORY' category" # Dependencies section test_init @@ -20,6 +20,7 @@ set_no_display use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_category.desktop" DESKTOP edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE edit_file "$DESKTOP" 'Test Menu Categories' ITEM_TEXT "TEST $XDG_TEST_SHORTID" +edit_file "$DESKTOP" 'Development' TMP "$CATEGORY" edit_file "$DESKTOP" '/tmp' WORK_DIR "$XDG_TEST_TMPDIR" assert_file "$DESKTOP" @@ -38,11 +39,7 @@ assert_nostderr #if [ -z "$XDG_TEST_NO_INTERACTIVE" -a `whoami` != 'root' ]; then -assert_interactive "Is an item called '$ITEM_TEXT' somewhere in the menu tree?\n\tThe item is probably in a menu that is related to 'Development'\n\t(NOTE: If you are using KDE, it may take a few seconds to appear.)" y -assert_interactive "Please select the menu item '$ITEM_TEXT'" - -## Double clicking will result in the command 'touch xdg-test-menu-item-install.tmp' to be run -assert_file "$WORK_DIR/$CREATEFILE" +assert_interactive "Is an item called '$ITEM_TEXT' somewhere in the menu tree?\n\tThe item is probably in a menu that is related to '$CATEGORY'?" y #fi ## Cleanup @@ -53,4 +50,4 @@ assert_nostderr test_result } -run_test test_menu_install_category +repeat_test test_menu_install_category 1 CATEGORY AudioVideo Game Office System Education Graphics Network Utility 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 083059e..8ec1233 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,9 +8,7 @@ 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" - +test_purpose "A basic desktop file is installed into the menu." # Dependencies section test_init @@ -21,7 +19,7 @@ USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:${XDG_CONFIG_DIRS-/etc/xd require_root set_no_display -use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP +use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_category.desktop" DESKTOP edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE edit_file "$DESKTOP" 'Test Menu Item Install' ITEM_TEXT "TEST $XDG_TEST_SHORTID" edit_file "$DESKTOP" '/tmp' WORK_DIR "$XDG_TEST_TMPDIR" @@ -41,7 +39,7 @@ assert_nostderr assert_file_in_path "$DESKTOP" "$USERPATH" if [ -z "$XDG_TEST_NO_INTERACTIVE" ]; then -assert_interactive "Is an item called '$ITEM_TEXT' somewhere in the menu tree, possibly in a generic location?\n\t(NOTE: If you are using KDE, it may take a few seconds to appear.)" y +assert_interactive "Is an item called '$ITEM_TEXT' somewhere in the menu tree, possibly in a menu dedicated to 'Development'?" y assert_interactive "Please select the menu item '$ITEM_TEXT'" ## Double clicking will result in the command 'touch xdg-test-menu-item-install.tmp' to be run @@ -49,11 +47,14 @@ assert_file "$WORK_DIR/$CREATEFILE" fi -## Cleanup -xdg-desktop-menu uninstall --mode system "$DESKTOP" >/dev/null 2>&1 +assert_exit 0 xdg-desktop-menu uninstall --mode system "$DESKTOP" +assert_nostdout +assert_nostderr + +assert_file_not_in_path "$DESKTOP" "$USERPATH" + +assert_interactive_notroot "Is the menu item '$ITEM_TEXT' still present?" n -## This test installs a questionalble .desktop file. -test_failoverride WARN test_result } 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 deleted file mode 100755 index f7abefc..0000000 --- a/tests/xdg-desktop-menu/t.21-simple_menu_item_system_uninstall +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -## Include utility functions. -. "$XDG_TEST_DIR/include/testassertions.sh" -. "$XDG_TEST_DIR/include/testcontrol.sh" - -## Test function -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 - -# Generate .desktop file -USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:${XDG_CONFIG_DIRS-/etc/xdg}" - -require_root -set_no_display - -use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP -edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE -edit_file "$DESKTOP" 'Test Menu Item Install' ITEM_TEXT "TEST $XDG_TEST_SHORTID" - -assert_file "$DESKTOP" - -assert_exit 0 xdg-desktop-menu install --mode system "$DESKTOP" - -assert_file_in_path "$DESKTOP" "$USERPATH" -assert_interactive "Is an item called '$ITEM_TEXT' somewhere in the menu tree, possibly in a generic location?\n\t(NOTE: If you are using KDE, it may take a few seconds to appear.)" y - - -# Test steps section -test_procedure - -assert_exit 0 xdg-desktop-menu uninstall --mode system "$DESKTOP" -assert_nostdout -assert_nostderr - -assert_file_not_in_path "$DESKTOP" "$USERPATH" - -assert_interactive "Is the menu item '$ITEM_TEXT' still present?\n\t(NOTE: see above about KDE)" n - -# Desktop file not totally OK. -test_failoverride WARN -test_result -} - -run_test test_simple_menu_item_system_uninstall |