OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 ## Include utility functions. |
| 4 . "$XDG_TEST_DIR/include/testassertions.sh" |
| 5 |
| 6 . "$XDG_TEST_DIR/include/testcontrol.sh" |
| 7 |
| 8 ## Test function |
| 9 test_icon_system_install() { |
| 10 test_start "$FUNCNAME: verify $ICON is installed correctly with --mode system" |
| 11 |
| 12 ## Begin the test. |
| 13 icondir="$XDG_TEST_DIR/icons" |
| 14 systempath="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:/usr/share/pixmaps" |
| 15 |
| 16 # Dependencies section |
| 17 test_init |
| 18 |
| 19 require_root |
| 20 set_no_display |
| 21 |
| 22 use_file "$XDG_TEST_DIR/icons/$ICON" ICONFILE |
| 23 assert_file "$ICONFILE" |
| 24 |
| 25 # Verify the test icon is not installed already. |
| 26 assert_file_not_in_path "$ICONFILE" "$systempath" |
| 27 |
| 28 # Test steps section |
| 29 test_procedure |
| 30 |
| 31 assert_exit 0 xdg-icon-resource install --mode system --size "$SIZE" "$ICONFILE" |
| 32 assert_nostdout |
| 33 assert_nostderr |
| 34 |
| 35 assert_file_in_path "$ICONFILE" "$systempath" |
| 36 |
| 37 ## Cleanup |
| 38 xdg-icon-resource uninstall --mode system --size "$SIZE" "$ICONFILE" |
| 39 |
| 40 test_result |
| 41 } |
| 42 |
| 43 repeat_test test_icon_system_install 2 ICON SIZE 'red-16.png' 'red-22.png' 'red-
24.png' 'red-32.png' 16 22 24 32 |
| 44 repeat_test test_icon_system_install 2 ICON SIZE 'red-48.png' 'red-64.png' 'red-
128.png' 48 64 128 |
OLD | NEW |