summaryrefslogtreecommitdiff
path: root/tests/xdg-icon-resource/t.icon_user_install
blob: 0570519bb990a447e318cd0c15574bc4cdb1a5f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

## Include utility functions.
. "$TEST_CODE_DIR/include/testassertions.sh"
. "$TEST_CODE_DIR/include/testdep.sh"
. "$TEST_CODE_DIR/include/testcontrol.sh"

## Test function
test_icon_user_install() {
test_start "$FUNCNAME: verify $ICON is installed correctly"

## Begin the test.
icondir="$TEST_CODE_DIR/icons"
userpath="$HOME/.icons:$HOME/.local:$XDG_DATA_HOME"
systempath="$XDG_DATA_DIRS:/usr/share/pixmaps"

# Dependencies section
test_init

set_no_display
assert_file "$icondir/$ICON"

# Verify the test icon is not installed already.
assert_file_not_in_path "$ICON" "$userpath"

# Test steps section
test_procedure

assert_exit 0 xdg-icon-resource install --user --size "$SIZE" "$icondir/$ICON"
assert_nostdout
assert_nostderr

assert_file_in_path "$ICON" "$userpath"

assert_exit 0 xdg-icon-resource uninstall --user --size "$SIZE" "$icondir/$ICON"

test_result
} 

repeat_test test_icon_user_install 2 ICON SIZE 'red-16.png' 'red-22.png' 'red-24.png' 'red-32.png' 'red-48.png' 'red-64.png' 'red-128.png' 16 22 24 32 48 64 128