diff options
author | Waldo Bastian <waldo.bastian@intel.com> | 2006-09-07 01:35:39 +0000 |
---|---|---|
committer | Waldo Bastian <waldo.bastian@intel.com> | 2006-09-07 01:35:39 +0000 |
commit | b82fe2bbffabe6b09de2c4166308fd23cbe6137c (patch) | |
tree | afe5fef2cca9802f3ad8039d2f5de749ae7256d6 | |
parent | 5e2cdc43ea246d85a4024ce8114e276e7e20f92f (diff) |
Adjust tests to new xdg-desktop-menu syntax
-rw-r--r-- | tests/xdg-desktop-menu/data/menu_install.directory | 1 | ||||
-rw-r--r-- | tests/xdg-desktop-menu/data/menu_install.menu | 13 | ||||
-rwxr-xr-x | tests/xdg-desktop-menu/t.12-menu_user_install | 35 | ||||
-rwxr-xr-x | tests/xdg-desktop-menu/t.13-menu_user_uninstall | 35 | ||||
-rwxr-xr-x | tests/xdg-desktop-menu/t.22-menu_system_install | 35 | ||||
-rwxr-xr-x | tests/xdg-desktop-menu/t.23-menu_system_uninstall | 36 |
6 files changed, 13 insertions, 142 deletions
diff --git a/tests/xdg-desktop-menu/data/menu_install.directory b/tests/xdg-desktop-menu/data/menu_install.directory index f759d94..a6f5c2b 100644 --- a/tests/xdg-desktop-menu/data/menu_install.directory +++ b/tests/xdg-desktop-menu/data/menu_install.directory @@ -1,2 +1,3 @@ [Desktop Entry] +Type=Directory Name=XDG UTILS TEST diff --git a/tests/xdg-desktop-menu/data/menu_install.menu b/tests/xdg-desktop-menu/data/menu_install.menu deleted file mode 100644 index 7ba7dbf..0000000 --- a/tests/xdg-desktop-menu/data/menu_install.menu +++ /dev/null @@ -1,13 +0,0 @@ -<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 0.8//EN" - "http://www.freedesktop.org/standards/menu-spec/menu-0.8.dtd"> -<Menu> - <Name>Applications</Name> - <Menu> - <Name>XDG UTILS TEST</Name> - <Directory>menu_install.directory</Directory> - <Include> - <Filename>menu_item_test.desktop</Filename> - <Filename>menu_item_dummy.desktop</Filename> - </Include> - </Menu> -</Menu> diff --git a/tests/xdg-desktop-menu/t.12-menu_user_install b/tests/xdg-desktop-menu/t.12-menu_user_install index 356283e..612889e 100755 --- a/tests/xdg-desktop-menu/t.12-menu_user_install +++ b/tests/xdg-desktop-menu/t.12-menu_user_install @@ -20,55 +20,30 @@ 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_dummy.desktop" DESKTOP2 use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.directory" DIRECTORY -use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.menu" MENU -edit_file "$MENU" 'menu_install.directory' tmp "$DIRECTORY" -edit_file "$MENU" 'menu_item_test.desktop' tmp "$DESKTOP" -edit_file "$MENU" 'menu_item_dummy.desktop' tmp "$DESKTOP2" -edit_file "$MENU" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" - -edit_file "$DIRECTORY" 'XDG UTILS TEST' tmp "$MENU_NAME" +edit_file "$DIRECTORY" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" 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" assert_file "$DESKTOP" -assert_file "$MENU" assert_file "$DIRECTORY" # Verify the test icon is not installed already. assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" -assert_file_not_in_path "$MENU" "$USERPATH" # Test steps section test_procedure -assert_exit 0 xdg-desktop-menu install --noupdate --mode user "$DESKTOP" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu install --noupdate --mode user "$DESKTOP2" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu install --noupdate --mode user "$DIRECTORY" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu install --noupdate --mode user "$MENU" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu forceupdate --mode system +assert_exit 0 xdg-desktop-menu install --mode user "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_nostdout assert_nostderr assert_file_in_path "$DESKTOP" "$USERPATH" assert_file_in_path "$DESKTOP2" "$USERPATH" assert_file_in_path "$DIRECTORY" "$USERPATH" -assert_file_in_path "$MENU" "$USERPATH" if [ "$GDMSESSION" = "kde" ] ; then # TODO: HACK: this shouldn't be necessary. @@ -85,11 +60,7 @@ assert_file "$WORK_DIR/$CREATEFILE" fi ## Cleanup -xdg-desktop-menu uninstall --mode user "$DESKTOP" >/dev/null 2>&1 -xdg-desktop-menu uninstall --mode user "$DESKTOP2" >/dev/null 2>&1 -xdg-desktop-menu uninstall --mode user "$DIRECTORY" >/dev/null 2>&1 -xdg-desktop-menu uninstall --mode user "$MENU" >/dev/null 2>&1 -xdg-desktop-menu forceupdate --mode user >/dev/null 2>&1 +xdg-desktop-menu uninstall --mode user "$DIRECTORY" "$DESKTOP" "$DESKTOP2">/dev/null 2>&1 test_result } diff --git a/tests/xdg-desktop-menu/t.13-menu_user_uninstall b/tests/xdg-desktop-menu/t.13-menu_user_uninstall index dbdcffe..62e6b3e 100755 --- a/tests/xdg-desktop-menu/t.13-menu_user_uninstall +++ b/tests/xdg-desktop-menu/t.13-menu_user_uninstall @@ -20,62 +20,33 @@ 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_dummy.desktop" DESKTOP2 use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.directory" DIRECTORY -use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.menu" MENU -edit_file "$MENU" 'menu_install.directory' tmp "$DIRECTORY" -edit_file "$MENU" 'menu_item_test.desktop' tmp "$DESKTOP" -edit_file "$MENU" 'menu_item_dummy.desktop' tmp "$DESKTOP2" -edit_file "$MENU" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" - -edit_file "$DIRECTORY" 'XDG UTILS TEST' tmp "$MENU_NAME" +edit_file "$DIRECTORY" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" 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_file "$MENU" assert_file "$DIRECTORY" -assert_exit 0 xdg-desktop-menu install --noupdate --mode user "$DESKTOP" -assert_exit 0 xdg-desktop-menu install --noupdate --mode user "$DESKTOP2" -assert_exit 0 xdg-desktop-menu install --noupdate --mode user "$DIRECTORY" -assert_exit 0 xdg-desktop-menu install --noupdate --mode user "$MENU" -assert_exit 0 xdg-desktop-menu forceupdate --mode user +assert_exit 0 xdg-desktop-menu install --mode user "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_file_in_path "$DESKTOP" "$USERPATH" assert_file_in_path "$DESKTOP" "$USERPATH2" assert_file_in_path "$DIRECTORY" "$USERPATH" -assert_file_in_path "$MENU" "$USERPATH" assert_interactive_notroot "Is the menu '<main>/$MENU_NAME present with items 'EXTRA_ITEM' and '$ITEM_TEXT'\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 --noupdate --mode user "$DESKTOP" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu uninstall --noupdate --mode user "$DESKTOP2" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu uninstall --noupdate --mode user "$DIRECTORY" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu uninstall --noupdate --mode user "$MENU" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu forceupdate --mode user +assert_exit 0 xdg-desktop-menu uninstall --mode user "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_nostdout assert_nostderr assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DESKTOP2" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" -assert_file_not_in_path "$MENU" "$USERPATH" assert_interactive_notroot "Is the menu '<main>/$MENU_NAME' still present?" n assert_interactive_notroot "Is '$ITEM_TEXT' present anywhere in the menu tree?" n diff --git a/tests/xdg-desktop-menu/t.22-menu_system_install b/tests/xdg-desktop-menu/t.22-menu_system_install index 4e2f358..2a2a71a 100755 --- a/tests/xdg-desktop-menu/t.22-menu_system_install +++ b/tests/xdg-desktop-menu/t.22-menu_system_install @@ -21,55 +21,30 @@ 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_dummy.desktop" DESKTOP2 use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.directory" DIRECTORY -use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.menu" MENU -edit_file "$MENU" 'menu_install.directory' tmp "$DIRECTORY" -edit_file "$MENU" 'menu_item_dummy.desktop' tmp "$DESKTOP2" -edit_file "$MENU" 'menu_item_test.desktop' tmp "$DESKTOP" -edit_file "$MENU" 'XDG UTILS TEST' MENU_NAME "TEST MENU $XDG_TEST_SHORTID" - -edit_file "$DIRECTORY" 'XDG UTILS TEST' tmp "$MENU_NAME" +edit_file "$DIRECTORY" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" 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" assert_file "$DESKTOP" -assert_file "$MENU" assert_file "$DIRECTORY" # Verify the test icon is not installed already. assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" -assert_file_not_in_path "$MENU" "$USERPATH" # Test steps section test_procedure -assert_exit 0 xdg-desktop-menu install --noupdate --mode system "$DESKTOP" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu install --noupdate --mode system "$DESKTOP2" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu install --noupdate --mode system "$DIRECTORY" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu install --noupdate --mode system "$MENU" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu forceupdate --mode system +assert_exit 0 xdg-desktop-menu install --mode system "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_nostdout assert_nostderr assert_file_in_path "$DESKTOP" "$USERPATH" assert_file_in_path "$DESKTOP2" "$USERPATH" assert_file_in_path "$DIRECTORY" "$USERPATH" -assert_file_in_path "$MENU" "$USERPATH" if [ -z "$XDG_TEST_NO_INTERACTIVE" ]; then @@ -84,11 +59,7 @@ assert_file "$WORK_DIR/$CREATEFILE" fi ## Cleanup -xdg-desktop-menu uninstall --mode system "$DESKTOP" >/dev/null 2>&1 -xdg-desktop-menu uninstall --mode system "$DESKTOP2" >/dev/null 2>&1 -xdg-desktop-menu uninstall --mode system "$DIRECTORY" >/dev/null 2>&1 -xdg-desktop-menu uninstall --mode system "$MENU" >/dev/null 2>&1 -xdg-desktop-menu forceupdate --mode system >/dev/null 2>&1 +xdg-desktop-menu uninstall --mode system "$DIRECTORY" "$DESKTOP" "$DESKTOP2">/dev/null 2>&1 test_result } diff --git a/tests/xdg-desktop-menu/t.23-menu_system_uninstall b/tests/xdg-desktop-menu/t.23-menu_system_uninstall index 810dae9..05bcc47 100755 --- a/tests/xdg-desktop-menu/t.23-menu_system_uninstall +++ b/tests/xdg-desktop-menu/t.23-menu_system_uninstall @@ -21,68 +21,38 @@ USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:${XDG_CONFIG_DIRS-/etc/xd 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_dummy.desktop" DESKTOP2 use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.directory" DIRECTORY -use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.menu" MENU -edit_file "$MENU" 'menu_install.directory' tmp "$DIRECTORY" -edit_file "$MENU" 'menu_item_test.desktop' tmp "$DESKTOP" -edit_file "$MENU" 'menu_item_dummy.desktop' tmp "$DESKTOP2" -edit_file "$MENU" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" - -edit_file "$DIRECTORY" 'XDG UTILS TEST' tmp "$MENU_NAME" +edit_file "$DIRECTORY" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" 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_file "$MENU" assert_file "$DIRECTORY" # Verify the test icon is not installed already. assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" -assert_file_not_in_path "$MENU" "$USERPATH" -assert_exit 0 xdg-desktop-menu install --noupdate --mode system "$DESKTOP" -assert_exit 0 xdg-desktop-menu install --noupdate --mode system "$DESKTOP2" -assert_exit 0 xdg-desktop-menu install --noupdate --mode system "$DIRECTORY" -assert_exit 0 xdg-desktop-menu install --noupdate --mode system "$MENU" -assert_exit 0 xdg-desktop-menu forceupdate --mode system +assert_exit 0 xdg-desktop-menu install --mode system "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_file_in_path "$DESKTOP" "$USERPATH" assert_file_in_path "$DESKTOP" "$USERPATH2" assert_file_in_path "$DIRECTORY" "$USERPATH" -assert_file_in_path "$MENU" "$USERPATH" assert_interactive "Is the menu '<main>/$MENU_NAME present with items 'EXTRA_ITEM' and '$ITEM_TEXT'.\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 --noupdate --mode system "$DESKTOP" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu uninstall --noupdate --mode system "$DESKTOP2" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu uninstall --noupdate --mode system "$DIRECTORY" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu uninstall --noupdate --mode system "$MENU" -assert_nostdout -assert_nostderr - -assert_exit 0 xdg-desktop-menu forceupdate --mode system +assert_exit 0 xdg-desktop-menu uninstall --mode system "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_nostdout assert_nostderr assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DESKTOP2" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" -assert_file_not_in_path "$MENU" "$USERPATH" assert_interactive "Is the menu '<main>/$MENU_NAME' still present?\n\t(NOTE: If you are using KDE, it may take a few seconds to disappear.)" n assert_interactive "Is '$ITEM_TEXT' present anywhere in the menu tree?" n |