File: runtests

package info (click to toggle)
fbautostart 2.718281828-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch, wheezy
  • size: 560 kB
  • ctags: 118
  • sloc: sh: 1,093; cpp: 558; makefile: 47; ansic: 45
file content (53 lines) | stat: -rwxr-xr-x 841 bytes parent folder | download
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
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash

CWD=`pwd`
TESTROOT=$CWD/testdirs
RUNROOT=$CWD/runroot

if [ ! -d $RUNROOT ]; then
    mkdir -p $RUNROOT
fi

function assert {
    if [ ! -e $1 ]; then
        echo "ERROR! FILE DNE: $1"
        exit 1
    fi
    echo "$1 OK"
}
function assert_not {
    if [ -e $1 ]; then
        echo "ERROR! FILE EXISTS: $1"
        exit 1
    fi
    echo "$1 OK (DNE)"
}

export XDG_CONFIG_HOME=$TESTROOT/testdirl1
export XDG_CONFIG_DIRS=$TESTROOT/testdirg1:$TESTROOT/testdirg2:$TESTROOT/testdirg3

rm $RUNROOT/*
cd $RUNROOT

fbautostart >/dev/null
sleep 1

for x in tdg1.1  tdg1.2  tdg2.1  tdg2.2  tdg3.1  tdg3.2  tdl1.1  tdl1.2; do
    assert $x
done

echo "Stage one OK"

cd -

rm $RUNROOT/*
cd $RUNROOT

export XDG_CONFIG_HOME=$XDG_CONFIG_HOME:$TESTROOT/testdirl2
fbautostart >/dev/null
sleep 1

assert_not tdg1.1
assert_not tdg1.2

cd -