From 43536f7e7d6cd53115a9e40a758e0c5647bc967e Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Tue, 1 Aug 2006 01:24:02 +0000 Subject: Eliminate interference between user and root tests --- portland/xdg-utils/tests/include/testcontrol.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portland/xdg-utils/tests/include/testcontrol.sh b/portland/xdg-utils/tests/include/testcontrol.sh index cdd1610..b53f148 100644 --- a/portland/xdg-utils/tests/include/testcontrol.sh +++ b/portland/xdg-utils/tests/include/testcontrol.sh @@ -107,7 +107,7 @@ test_setup() { export XDG_TEST_TMPDIR="$TMPSUBDIR" cd "$XDG_TEST_TMPDIR" - get_shortid "$XDG_TEST_DIR/tmp/shortid" + get_shortid "$XDG_TEST_DIR/tmp/shortid-$UID" export XDG_TEST_SHORTID="$SHORTID" } -- cgit v1.2.3 From 929f6959861a693172a07378e91da23054d45c5f Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Tue, 1 Aug 2006 01:34:51 +0000 Subject: Use proper defaults --- portland/xdg-utils/tests/xdg-desktop-menu/t.02-menu_system_as_nonroot | 2 +- .../tests/xdg-desktop-menu/t.20-simple_menu_item_system_install | 2 +- .../tests/xdg-desktop-menu/t.21-simple_menu_item_system_uninstall | 2 +- portland/xdg-utils/tests/xdg-desktop-menu/t.22-menu_system_install | 2 +- portland/xdg-utils/tests/xdg-desktop-menu/t.23-menu_system_uninstall | 2 +- portland/xdg-utils/tests/xdg-icon-resource/t.icon_svg_system_install | 2 +- portland/xdg-utils/tests/xdg-icon-resource/t.icon_svg_system_uninstall | 2 +- portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_as_nonroot | 2 +- portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_install | 2 +- portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_uninstall | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/portland/xdg-utils/tests/xdg-desktop-menu/t.02-menu_system_as_nonroot b/portland/xdg-utils/tests/xdg-desktop-menu/t.02-menu_system_as_nonroot index 5308af9..7c972e9 100755 --- a/portland/xdg-utils/tests/xdg-desktop-menu/t.02-menu_system_as_nonroot +++ b/portland/xdg-utils/tests/xdg-desktop-menu/t.02-menu_system_as_nonroot @@ -7,7 +7,7 @@ ## Test function test_menu_system_as_nonroot() { -USERPATH="$XDG_DATA_DIRS:$HOME/.local:$HOME/.config:$XDG_DATA_HOME" +USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:$HOME/.local:$HOME/.config:$XDG_DATA_HOME" ## Begin the test. test_start "$FUNCNAME: verify error for --mode system when run as a normal user" diff --git a/portland/xdg-utils/tests/xdg-desktop-menu/t.20-simple_menu_item_system_install b/portland/xdg-utils/tests/xdg-desktop-menu/t.20-simple_menu_item_system_install index eda90cc..84f89b8 100755 --- a/portland/xdg-utils/tests/xdg-desktop-menu/t.20-simple_menu_item_system_install +++ b/portland/xdg-utils/tests/xdg-desktop-menu/t.20-simple_menu_item_system_install @@ -13,7 +13,7 @@ test_start "$FUNCNAME: verify a desktop file is installed in the system applicat test_init # Generate .desktop file -USERPATH="$XDG_DATA_DIRS:$XDG_CONFIG_DIRS" +USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:${XDG_CONFIG_DIRS-/etc/xdg}" require_root set_no_display diff --git a/portland/xdg-utils/tests/xdg-desktop-menu/t.21-simple_menu_item_system_uninstall b/portland/xdg-utils/tests/xdg-desktop-menu/t.21-simple_menu_item_system_uninstall index d9c0922..6c832a9 100755 --- a/portland/xdg-utils/tests/xdg-desktop-menu/t.21-simple_menu_item_system_uninstall +++ b/portland/xdg-utils/tests/xdg-desktop-menu/t.21-simple_menu_item_system_uninstall @@ -13,7 +13,7 @@ test_start "$FUNCNAME: verify a desktop file is uninstalled from the system appl test_init # Generate .desktop file -USERPATH="$XDG_DATA_DIRS:$XDG_CONFIG_DIRS" +USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:${XDG_CONFIG_DIRS-/etc/xdg}" require_root set_no_display diff --git a/portland/xdg-utils/tests/xdg-desktop-menu/t.22-menu_system_install b/portland/xdg-utils/tests/xdg-desktop-menu/t.22-menu_system_install index 19d8304..63a4c7b 100755 --- a/portland/xdg-utils/tests/xdg-desktop-menu/t.22-menu_system_install +++ b/portland/xdg-utils/tests/xdg-desktop-menu/t.22-menu_system_install @@ -12,7 +12,7 @@ test_start "$FUNCNAME: verify a system menu is created correctly" # Dependencies section test_init -USERPATH="$XDG_DATA_DIRS:$XDG_CONFIG_DIRS" +USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:${XDG_CONFIG_DIRS-/etc/xdg}" require_root set_no_display diff --git a/portland/xdg-utils/tests/xdg-desktop-menu/t.23-menu_system_uninstall b/portland/xdg-utils/tests/xdg-desktop-menu/t.23-menu_system_uninstall index aa7e56b..421f831 100755 --- a/portland/xdg-utils/tests/xdg-desktop-menu/t.23-menu_system_uninstall +++ b/portland/xdg-utils/tests/xdg-desktop-menu/t.23-menu_system_uninstall @@ -15,7 +15,7 @@ test_init require_root set_no_display -USERPATH="$XDG_DATA_DIRS:$XDG_CONFIG_DIRS" +USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:${XDG_CONFIG_DIRS-/etc/xdg}" # Generate .desktop file use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP diff --git a/portland/xdg-utils/tests/xdg-icon-resource/t.icon_svg_system_install b/portland/xdg-utils/tests/xdg-icon-resource/t.icon_svg_system_install index a87d118..c5dccdc 100755 --- a/portland/xdg-utils/tests/xdg-icon-resource/t.icon_svg_system_install +++ b/portland/xdg-utils/tests/xdg-icon-resource/t.icon_svg_system_install @@ -12,7 +12,7 @@ ICON="red-SVG.svg" test_start "$FUNCNAME: verify $ICON is installed correctly with --mode system" ## Begin the test. -systempath="$XDG_DATA_DIRS:/usr/share/pixmaps" +systempath="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:/usr/share/pixmaps" # Dependencies section test_init diff --git a/portland/xdg-utils/tests/xdg-icon-resource/t.icon_svg_system_uninstall b/portland/xdg-utils/tests/xdg-icon-resource/t.icon_svg_system_uninstall index 1f16f6d..c0b9f6b 100755 --- a/portland/xdg-utils/tests/xdg-icon-resource/t.icon_svg_system_uninstall +++ b/portland/xdg-utils/tests/xdg-icon-resource/t.icon_svg_system_uninstall @@ -13,7 +13,7 @@ test_start "$FUNCNAME: verify $ICON is uninstalled correctly with --mode system" ## Begin the test. icondir="$XDG_TEST_DIR/icons" -systempath="$XDG_DATA_DIRS:/usr/share/pixmaps" +systempath="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:/usr/share/pixmaps" # Dependencies section test_init diff --git a/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_as_nonroot b/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_as_nonroot index 8c62ba3..a9d46f7 100755 --- a/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_as_nonroot +++ b/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_as_nonroot @@ -7,7 +7,7 @@ ## Test function test_icon_system_as_nonroot() { -ICON_PATH="$HOME/.icons:$XDG_DATA_DIRS:/usr/share/pixmaps:$HOME/.local/icons:$XDG_DATA_HOME" +ICON_PATH="$HOME/.icons:${XDG_DATA_DIRS-/usr/local/share:/usr/share}:/usr/share/pixmaps:$HOME/.local/icons:$XDG_DATA_HOME" ## Begin the test. test_start "$FUNCNAME: verify error for --mode system when run as a normal user" diff --git a/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_install b/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_install index a7e7150..4f0dd07 100755 --- a/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_install +++ b/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_install @@ -11,7 +11,7 @@ test_start "$FUNCNAME: verify $ICON is installed correctly with --mode system" ## Begin the test. icondir="$XDG_TEST_DIR/icons" -systempath="$XDG_DATA_DIRS:/usr/share/pixmaps" +systempath="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:/usr/share/pixmaps" # Dependencies section test_init diff --git a/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_uninstall b/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_uninstall index 3114edd..86477c7 100755 --- a/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_uninstall +++ b/portland/xdg-utils/tests/xdg-icon-resource/t.icon_system_uninstall @@ -9,7 +9,7 @@ test_icon_system_uninstall() { test_start "$FUNCNAME: verify $ICON is uninstalled correctly with --mode system" ## Begin the test. -systempath="$XDG_DATA_DIRS:/usr/share/pixmaps" +systempath="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:/usr/share/pixmaps" # Dependencies section test_init -- cgit v1.2.3 From 46a2cb260ac23d5830a4ea0735e0d56627ab82e8 Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Tue, 1 Aug 2006 05:26:42 +0000 Subject: Updated for beta2 --- portland/xdg-utils/tests/README | 68 ++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/portland/xdg-utils/tests/README b/portland/xdg-utils/tests/README index 1c385d3..26469f2 100644 --- a/portland/xdg-utils/tests/README +++ b/portland/xdg-utils/tests/README @@ -5,7 +5,8 @@ Created 6/27/2006 by Tom Whipple RUNNING XDG-UTILS TESTS ----------------------- -At a minimum, you must have your current directory be the same as the directory containing this README. Then, simply execute +At a minimum, you must have your current directory be the same as the +directory containing this README. Then, simply execute: $ ./testrun WARNING: guessed XDG_TEST_DIR to be /home/tw/portland/xdg-utils/tests @@ -20,11 +21,12 @@ NOT OK! FAIL indicates (not suprisingly) a test failure. NORESULT indicates that the test prerequisites failed for some reason. (e.g. the install phase of an uninstall test failed) -UNTESTED means that something needed was not found. This is fine and should be ignored. - These tests are not counted in the total, only attempted. +UNTESTED means that something needed was not found. This is fine and should + be ignored. These tests are not counted in the total, only attempted. (e.g. test requires root, but we are not running as root) -NOTE: The test runner makes guesses about appropriate values of XDG_TEST_DIR and PATH. These values can be overriden explicitly. +NOTE: The test runner makes guesses about appropriate values of XDG_TEST_DIR + and PATH. These values can be overriden explicitly. To run tests individually, or as smaller groups do something like @@ -32,69 +34,91 @@ $ ./testrun xdg-mime OR -$ ./testrun xdg-mime/t.user_mime_install +$ ./testrun xdg-mime/t.10-user_mime_install OR (if you have defined XDG_TEST_DIR and PATH correctly) -$ xdg-mime/t.user_mime_install +$ xdg-mime/t.10-user_mime_install BACKUPS ------- -THESE TESTS CHANGE YOUR USER ENVIRONMENT. Effort is made to keep pollution to a minimum, but we make no guarantees!! Back up your environment/system early and often. This is especially critical if you run tests as root. You have been warned. +THESE TESTS CHANGE YOUR USER ENVIRONMENT. Effort is made to keep pollution +to a minimum, but we make no guarantees!! Back up your environment/system +early and often. This is especially critical if you run tests as root. You +have been warned. INTERACTIVE TESTS ----------------- -Because it is difficult to verify the way things appear to the user, some tests are interactive and require the user to verify or perform actions. This is sometimes annoying, so interactive tests can be disabled with the -I flag. Note that if you run tests non-interactively, some tests (xdg-email) may generate strange errors on the screen, since the test cleans up support files before the email client tries to read them. Use the -C option to work around this. +Because it is difficult to verify the way things appear to the user, some +tests are interactive and require the user to verify or perform actions. +This is sometimes annoying, so interactive tests can be disabled with the +-I flag. Note that if you run tests non-interactively, some tests +(xdg-email) may generate strange errors on the screen, since the test +cleans up support files before the email client tries to read them. Use +the -C option to work around this. PRIVILEGED TESTS --------------- BACK UP YOUR SYSTEM. See above. -Some tests require root (e.g. those commands with a --system option). So, tests in this group return UNTESTED if they are not run as root. - -It is STRONGLY recommended to do 'su -' and then run the tests, rather than using sudo or su -c, since both of the latter methods leave various environment variables (HOME, etc) unchanged from the login user's shell. +Some tests require root (e.g. those commands with a --system option). So, +tests in this group return UNTESTED if they are not run as root. + +The test runner will ask for the root password in order to run these tests +as the root user. CLEANUP ------- -Tests should clean up after themselves. However, this sometimes fails, so use -'sudo make tests-clean' or 'make tests-userclean'. (Note that you must have generated a makefile via 'cd .. && ./configure' at some point.) +Tests should clean up after themselves. However, this sometimes fails, +so use 'sudo make tests-clean' or 'make tests-userclean'. +(Note that you must have generated a makefile via 'cd .. && ./configure' +at some point.) DIRECTORY STRUCTURE ------------------- xdg-* tests for each util include "library" code used by most tests -generic generic tests to be run on most utilities. See xdg-mime/t.apply_generic +generic generic tests to be run on most utilities. + See xdg-mime/t.apply_generic WRITING XDG-UTILS TESTS ----------------------- -See xdg-mime/t.user_mime_install as an example. +See xdg-mime/t.10-user_mime_install as an example. Each test is as follows test_function() { -- Tests are functions for TET integration. test_start "test description" -- required to begin a test -test_purpose "verbose text" -- optionally provide a verbose description. not used. -test_init -- optionally begin a prerequisite section. assertions - that fail here cause NORESULT rather than FAIL +test_purpose "verbose text" -- optionally provide a verbose description. + not used. +test_init -- optionally begin a prerequisite section. + assertions that fail here cause NORESULT + rather than FAIL -test_procedure -- required to begin the actuall test assertions +test_procedure -- required to begin the actuall test + assertions -test_result -- required to generate result codes. Must be last. +test_result -- required to generate result codes. + Must be last. } run_test test_function - OR - repeat_test test_function NVARS V1 ... VN V1val1 ... V1valM ... VNval1 ... VNvalM -- one of the above is required. - see inlcude/testcontrol.sh for detail + see include/testcontrol.sh for detail -Questions? Email tom.whipple@intel.com +For questions or feedback, please use the Portland mailinglist at +http://lists.freedesktop.org/mailman/listinfo/portland + +Test results can be submitted on +http://portland.freedesktop.org/testreport.html -- cgit v1.2.3 From d2fbedf451600f63e5d7a58d8d350c223e3fb637 Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Tue, 1 Aug 2006 05:37:49 +0000 Subject: Urge people to send in test report --- portland/xdg-utils/tests/testrun | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/portland/xdg-utils/tests/testrun b/portland/xdg-utils/tests/testrun index 7370c16..5d7caca 100755 --- a/portland/xdg-utils/tests/testrun +++ b/portland/xdg-utils/tests/testrun @@ -166,6 +166,10 @@ if [ -z "$XDG_TEST_SELF_LAUNCH" ] ; then # not su'd EC=0 echo "ok" fi + if [ -z "$*" ] ; then + echo "Please consider submitting your test report to" + echo "http://portland.freedesktop.org/testreport.html" + fi exit "$EC" else ## Running su'd. save results. -- cgit v1.2.3