]>
git.saurik.com Git - apt.git/blob - test/libapt/run-tests
4 DIR
=$(readlink -f $(dirname $0))
5 if [ -z "$MAKELEVEL" ]; then
6 echo 'Compiling the tests …'
8 echo 'Running all testcases …'
10 LDPATH
="$DIR/../../build/bin"
14 # detect if output is on a terminal (colorful) or better not
15 if expr match
"$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev
/null
; then
18 TESTOKAY
='\033[1;32mOKAY\033[0m'
19 TESTFAIL
='\033[1;31mFAILED\033[0m'
24 TESTFAIL
='###FAILED###'
27 for testapp
in $(ls ${LDPATH}/*$EXT)
29 name
=$(basename ${testapp})
30 NAME
="${COLHIGH}${name}${COLRESET}"
33 if [ $name = "GetListOfFilesInDir${EXT}" ]; then
34 # TODO: very-low: move env creation to the actual test-app
36 touch "${tmppath}/anormalfile" \
37 "${tmppath}/01yet-anothernormalfile" \
38 "${tmppath}/anormalapt.conf" \
39 "${tmppath}/01yet-anotherapt.conf" \
40 "${tmppath}/anormalapt.list" \
41 "${tmppath}/01yet-anotherapt.list" \
42 "${tmppath}/wrongextension.wron" \
43 "${tmppath}/wrong-extension.wron" \
44 "${tmppath}/strangefile." \
45 "${tmppath}/s.t.r.a.n.g.e.f.i.l.e" \
46 "${tmppath}/.hiddenfile" \
47 "${tmppath}/.hiddenfile.conf" \
48 "${tmppath}/.hiddenfile.list" \
49 "${tmppath}/multi..dot" \
50 "${tmppath}/multi.dot.conf" \
51 "${tmppath}/multi.dot.list" \
52 "${tmppath}/disabledfile.disabled" \
53 "${tmppath}/disabledfile.conf.disabled" \
54 "${tmppath}/disabledfile.list.disabled" \
55 "${tmppath}/invälid.conf" \
56 "${tmppath}/invalíd" \
57 "${tmppath}/01invalíd"
58 mkdir "${tmppath}/invaliddir" \
59 "${tmppath}/directory.conf" \
60 "${tmppath}/directory.list" \
61 "${tmppath}/directory.wron" \
62 "${tmppath}/directory.list.disabled"
63 ln -s "${tmppath}/anormalfile" "${tmppath}/linkedfile.list"
64 ln -s "${tmppath}/non-existing-file" "${tmppath}/brokenlink.list"
65 elif [ $name = "getLanguages${EXT}" ]; then
67 touch "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-tr" \
68 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-pt" \
69 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-se~" \
70 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-st.bak" \
71 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-ast_DE" \
72 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-tlh%5fDE"
73 elif [ $name = "HashSums${EXT}" ]; then
74 TMP
="$(readlink -f "./${0}")"
76 tmppath
="${tmppath} $(md5sum $TMP | cut -d' ' -f 1)"
77 tmppath
="${tmppath} $(sha1sum $TMP | cut -d' ' -f 1)"
78 tmppath
="${tmppath} $(sha256sum $TMP | cut -d' ' -f 1)"
79 tmppath
="${tmppath} $(sha512sum $TMP | cut -d' ' -f 1)"
80 elif [ $name = "CompareVersion${EXT}" ]; then
81 tmppath
="${DIR}/versions.lst"
82 elif [ $name = "CdromFindPackages${EXT}" ]; then
84 mkdir -p "${tmppath}/.disk" "${tmppath}/pool" \
85 "${tmppath}/dists/stable/main/binary-i386" \
86 "${tmppath}/dists/stable/main/source" \
87 "${tmppath}/dists/stable/contrib/binary-amd64" \
88 "${tmppath}/dists/stable/contrib/binary-all" \
89 "${tmppath}/dists/unstable/main/binary-i386" \
90 "${tmppath}/dists/unstable/main/i18n" \
91 "${tmppath}/dists/unstable/main/source" \
92 "${tmppath}/dists/broken/non-free/source"
93 touch "${tmppath}/dists/broken/.aptignr" \
94 "${tmppath}/dists/stable/main/binary-i386/Packages" \
95 "${tmppath}/dists/stable/main/binary-i386/Packages.bz2" \
96 "${tmppath}/dists/stable/main/source/Sources.xz" \
97 "${tmppath}/dists/stable/contrib/binary-amd64/Packages" \
98 "${tmppath}/dists/stable/contrib/binary-amd64/Packages.gz" \
99 "${tmppath}/dists/stable/contrib/binary-all/Packages" \
100 "${tmppath}/dists/unstable/main/binary-i386/Packages.xz" \
101 "${tmppath}/dists/unstable/main/binary-i386/Packages.lzma" \
102 "${tmppath}/dists/unstable/main/i18n/Translation-en" \
103 "${tmppath}/dists/unstable/main/i18n/Translation-de.bz2" \
104 "${tmppath}/dists/unstable/main/source/Sources.xz" \
105 "${tmppath}/dists/broken/non-free/source/Sources.gz" \
106 "${tmppath}/dists/stable/Release.gpg" \
107 "${tmppath}/dists/stable/Release" \
108 "${tmppath}/dists/unstable/InRelease" \
109 "${tmppath}/dists/broken/Release.gpg"
110 ln -s "${tmppath}/dists/unstable" "${tmppath}/dists/sid"
113 echo -n "Testing with ${NAME} "
114 if LD_LIBRARY_PATH
=${LDPATH} ${testapp} ${tmppath} ; then
121 if [ -n "$tmppath" -a -d "$tmppath" ]; then